Git Product home page Git Product logo

coffee-filter's People

Contributors

exviva avatar jordimassaguerpla avatar norman avatar paulnicholson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

coffee-filter's Issues

Rails 3.1 (master) stacktrace

Hello,

Gemfile

gem "coffee-script"
gem "coffee-filter", :git => "git://github.com/paulnicholson/coffee-filter.git"
gem "haml", :git => "git://github.com/nex3/haml.git"

Trace

/Users/kain/.rvm/gems/ruby-1.9.2-p180/bundler/gems/coffee-filter-1f0ad0e93c06/lib/coffee-filter/coffeescript.rb:4:in `<module:Coffeescript>': uninitialized constant Coffee::Filter::Coffeescript::Haml (NameError)
    from /Users/kain/.rvm/gems/ruby-1.9.2-p180/bundler/gems/coffee-filter-1f0ad0e93c06/lib/coffee-filter/coffeescript.rb:3:in `<module:Filter>'
    from /Users/kain/.rvm/gems/ruby-1.9.2-p180/bundler/gems/coffee-filter-1f0ad0e93c06/lib/coffee-filter/coffeescript.rb:2:in `<module:Coffee>'
    from /Users/kain/.rvm/gems/ruby-1.9.2-p180/bundler/gems/coffee-filter-1f0ad0e93c06/lib/coffee-filter/coffeescript.rb:1:in `<top (required)>'
    from /Users/kain/.rvm/gems/ruby-1.9.2-p180/bundler/gems/coffee-filter-1f0ad0e93c06/lib/coffee-filter.rb:1:in `<top (required)>'

undefined method `lazy_require' for Coffee::Filter::Coffeescript:Module

I got this error when I upgraded to haml 4.0 release candidate:

gems/coffee-filter-0.1.2/lib/coffee-filter/coffeescript.rb:8:in `<module:Coffeescript>': undefined method `lazy_require' for Coffee::Filter::Coffeescript:Module (NoMethodError)

Looks like haml 4.0 is going to be officially released in 2 days: haml/haml-rails#38

Fortunately, it looks like it includes official support for :coffee / :coffeescript filters so this gem will no longer be needed. (Thanks for providing it in the meantime though!)

Use without `require`?

I'm glad to see this gem—the various coffee-haml-filter forks were pretty undermaintained—but I'm curious: Is there any way to get around the requirement that I use a require 'coffee-filter' from Ruby code before using the filter? If I simply do

gem install coffee-filter
haml example.haml

(where example.haml contains your example code), I get

Haml error on line 3: Filter "coffeescript" is not defined.
  Use --trace for backtrace.

ExecJS::RuntimeError

Some strange errors I'm getting today when I rebooted my rails app
Anytime I use :coffeescript I get an error.

For example

:coffeescript
alert("a")

The page results in:


ExecJS::RuntimeError in Users#index

Showing /index.html.haml where line # raised:

["ok","(function() {\n\n alert("a");\n\n}).call(this);\n"]


Which is weird because it looks like the script actually converted into coffeescript, but now it's just erroring anytime. I'm using thin web server on windows, and I have execjs installed. i'm not 100% sure it's the coffee-filter, but I do know that all my other coffeescripts in external files are being loaded OK.

String Interpolation error when there is a variable in expression.

When I use only numbers in the expression there is no error.
console.log "#{1+3}"
But when I use a variable in the expression, there is an error
a=3; console.log "#{a}"
The error message

ERROR: compiling /Users/praphan/Development/lab/rails3.1/hello/app/assets/haml/hello.html.haml RAISED undefined local variable or method a' for #<HamlAssets::HamlSprocketsEngine::ViewContext:0x007fa9e64d6dd0> Backtrace: (haml):3:inblock in render'
/Users/praphan/.rvm/gems/[email protected]/bundler/gems/haml-46d64d1123a9/lib/haml/engine.rb:191:in eval' /Users/praphan/.rvm/gems/[email protected]/bundler/gems/haml-46d64d1123a9/lib/haml/engine.rb:191:inrender'
/Users/praphan/.rvm/gems/[email protected]/gems/haml_assets-0.0.3/lib/haml_assets/haml_sprockets_engine.rb:40:in render_haml' /Users/praphan/.rvm/gems/[email protected]/gems/haml_assets-0.0.3/lib/haml_assets/haml_sprockets_engine.rb:28:inevaluate'
/Users/praphan/.rvm/gems/[email protected]/gems/tilt-1.3.3/lib/tilt/template.rb:76:in render' /Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/context.rb:175:inblock in evaluate'
/Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/context.rb:172:in each' /Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/context.rb:172:inevaluate'
/Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:171:in build_dependency_context_and_body' /Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:135:independency_context'
/Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:194:in build_dependencies_paths_and_assets' /Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:141:independency_paths'
/Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:61:in mtime' /Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/asset.rb:58:inblock in encode_with'
/Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/asset.rb:57:in each' /Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/asset.rb:57:inencode_with'
/Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/bundled_asset.rb:43:in encode_with' /Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/caching.rb:52:incache_asset'
/Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/environment.rb:82:in build_asset' /Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/trail.rb:102:infind_asset_in_path'
/Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/base.rb:101:in find_asset' /Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/environment.rb:72:infind_asset'
/Users/praphan/.rvm/gems/[email protected]/gems/sprockets-2.0.3/lib/sprockets/server.rb:42:in call' /Users/praphan/.rvm/gems/[email protected]/gems/rack-mount-0.8.3/lib/rack/mount/prefix.rb:26:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:152:in block in call' /Users/praphan/.rvm/gems/[email protected]/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:96:inblock in recognize'
/Users/praphan/.rvm/gems/[email protected]/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:68:in optimized_each' /Users/praphan/.rvm/gems/[email protected]/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:95:inrecognize'
/Users/praphan/.rvm/gems/[email protected]/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:141:in call' /Users/praphan/.rvm/gems/[email protected]/gems/actionpack-3.1.1/lib/action_dispatch/routing/route_set.rb:532:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/actionpack-3.1.1/lib/action_dispatch/middleware/best_standards_support.rb:17:in call' /Users/praphan/.rvm/gems/[email protected]/gems/rack-1.3.5/lib/rack/etag.rb:23:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/rack-1.3.5/lib/rack/conditionalget.rb:25:in call' /Users/praphan/.rvm/gems/[email protected]/gems/actionpack-3.1.1/lib/action_dispatch/middleware/head.rb:14:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/actionpack-3.1.1/lib/action_dispatch/middleware/params_parser.rb:21:in call' /Users/praphan/.rvm/gems/[email protected]/gems/actionpack-3.1.1/lib/action_dispatch/middleware/flash.rb:243:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/rack-1.3.5/lib/rack/session/abstract/id.rb:195:in context' /Users/praphan/.rvm/gems/[email protected]/gems/rack-1.3.5/lib/rack/session/abstract/id.rb:190:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/actionpack-3.1.1/lib/action_dispatch/middleware/cookies.rb:331:in call' /Users/praphan/.rvm/gems/[email protected]/gems/activerecord-3.1.1/lib/active_record/query_cache.rb:62:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/activerecord-3.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in call' /Users/praphan/.rvm/gems/[email protected]/gems/actionpack-3.1.1/lib/action_dispatch/middleware/callbacks.rb:29:inblock in call'
/Users/praphan/.rvm/gems/[email protected]/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:392:in _run_call_callbacks' /Users/praphan/.rvm/gems/[email protected]/gems/activesupport-3.1.1/lib/active_support/callbacks.rb:81:inrun_callbacks'
/Users/praphan/.rvm/gems/[email protected]/gems/actionpack-3.1.1/lib/action_dispatch/middleware/callbacks.rb:28:in call' /Users/praphan/.rvm/gems/[email protected]/gems/actionpack-3.1.1/lib/action_dispatch/middleware/reloader.rb:68:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/rack-1.3.5/lib/rack/sendfile.rb:101:in call' /Users/praphan/.rvm/gems/[email protected]/gems/actionpack-3.1.1/lib/action_dispatch/middleware/remote_ip.rb:48:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/actionpack-3.1.1/lib/action_dispatch/middleware/show_exceptions.rb:47:in call' /Users/praphan/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/rack/logger.rb:13:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/rack-1.3.5/lib/rack/methodoverride.rb:24:in call' /Users/praphan/.rvm/gems/[email protected]/gems/rack-1.3.5/lib/rack/runtime.rb:17:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/activesupport-3.1.1/lib/active_support/cache/strategy/local_cache.rb:72:in call' /Users/praphan/.rvm/gems/[email protected]/gems/rack-1.3.5/lib/rack/lock.rb:15:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/actionpack-3.1.1/lib/action_dispatch/middleware/static.rb:53:in call' /Users/praphan/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/engine.rb:456:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/rack/content_length.rb:16:in call' /Users/praphan/.rvm/gems/[email protected]/gems/railties-3.1.1/lib/rails/rack/log_tailer.rb:14:incall'
/Users/praphan/.rvm/gems/[email protected]/gems/rack-1.3.5/lib/rack/handler/mongrel.rb:77:in process' /Users/praphan/.rvm/gems/[email protected]/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:165:inblock in process_client'
/Users/praphan/.rvm/gems/[email protected]/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:164:in each' /Users/praphan/.rvm/gems/[email protected]/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:164:inprocess_client'
/Users/praphan/.rvm/gems/[email protected]/gems/mongrel-1.2.0.pre2/lib/mongrel.rb:291:in `block (2 levels) in run'
Compiled hello.html (6ms) (pid 8920)
Served asset /hello.html - 200 OK (10ms)

I use Rails 3.1.1

My GemFile

gem 'mongrel'
gem 'haml_assets'
gem 'ejs'
gem "haml"
gem "coffee-filter"

gem 'guard-livereload'

Filter "coffeescript" is not defined.

Hello

I have a following problem. I'm using HAML views in my rails app and i wanted to use some coffeescript in them. I added Barista to my gemfile:

gem 'haml'
gem 'coffee-filter'

and ran bundle install.
But when I try to use :coffeescript filter I get:

Haml::Error in carts#index

Showing /home/jesha/ror/prefab/app/views/carts/index.html.haml where line #7 raised:

Filter "coffeescript" is not defined.
Extracted source (around line #7):

4:
5: %br
6:
7: :coffeescript
8:   alert("test")
9:
10: %table

Do you know what am I doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.