Skip to content

Instantly share code, notes, and snippets.

@zdennis
Created July 3, 2012 23:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zdennis/3044199 to your computer and use it in GitHub Desktop.
Save zdennis/3044199 to your computer and use it in GitHub Desktop.
Make Middleman compile coffee-script using bare mode.
#
# Add the following to Middleman's config.rb:
#
CoffeeScript.class_eval do
class << self
def compile_with_bare(*args)
options = args.pop if args.last.is_a?(Hash)
(options ||= {})[:bare] = true
args << options
compile_without_bare(*args)
end
alias_method :compile_without_bare, :compile
alias_method :compile, :compile_with_bare
end
end
@rriemann
Copy link

rriemann commented Jul 1, 2014

Thank for providing a solution. Why is Tilt::CoffeeScriptTemplate.default_bare = true not working?

@rriemann
Copy link

rriemann commented Jul 1, 2014

Even easier (actually it is working):

Tilt::CoffeeScriptTemplate.default_bare = true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment