Closed wh0 closed 9 years ago
Great! In the Markdown Converter in Jekyll core, this is gated via an instance variable. I think requiring each time could be dangerous performance wise, so doing something like this would be preferable:
def setup
require "coffee-script"
@setup = true
end
def convert(content)
setup unless @setup
::CoffeeScript...
end
Thanks, I've updated it to be like https://github.com/jekyll/jekyll/blob/master/lib/jekyll/converters/markdown.rb.
:information_source: http://ruby-doc.org/core-2.2.3/Kernel.html#method-i-require
Kernel::require
has its own mechanism for preventing multiple loads of the same module though.
I'm trying to reduce method calls. Did you not like my example above?
force pushed.
Ok, just asking. Thank you! This looks good to me. :shipit:
cross reference: jekyll/jekyll#2327
Make it so that you can use Jekyll 2.x without a JavaScript runtime, as long as you don't need to compile CoffeeScript.
Sample error when you try to do that: