Skip to content

Commit

Permalink
Merge pull request #11 from wh0/defer-load
Browse files Browse the repository at this point in the history
Load converter when used.
  • Loading branch information
parkr committed Oct 11, 2015
2 parents bff067a + 9c98a3f commit 27b8c7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/jekyll-coffeescript.rb
@@ -1,5 +1,4 @@
require "jekyll"
require "coffee-script"
require "jekyll-coffeescript/version"
require "jekyll/converters/coffeescript"

Expand Down
6 changes: 6 additions & 0 deletions lib/jekyll/converters/coffeescript.rb
Expand Up @@ -4,6 +4,11 @@ class CoffeeScript < Converter
safe true
priority :low

def setup
require "coffee-script"
@setup = true
end

def matches(ext)
ext.downcase == ".coffee"
end
Expand All @@ -13,6 +18,7 @@ def output_ext(ext)
end

def convert(content)
setup unless @setup
::CoffeeScript.compile(content)
end
end
Expand Down

0 comments on commit 27b8c7d

Please sign in to comment.