Class: Jekyll::Converters::CoffeeScript

Inherits:
Converter
  • Object
show all
Defined in:
lib/jekyll/converters/coffeescript.rb

Instance Method Summary collapse

Instance Method Details

#convert(content) ⇒ Object



22
23
24
25
# File 'lib/jekyll/converters/coffeescript.rb', line 22

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

#matches(ext) ⇒ Object



14
15
16
# File 'lib/jekyll/converters/coffeescript.rb', line 14

def matches(ext)
  ext.casecmp(".coffee").zero?
end

#output_ext(_ext) ⇒ Object



18
19
20
# File 'lib/jekyll/converters/coffeescript.rb', line 18

def output_ext(_ext)
  ".js"
end

#setupObject



9
10
11
12
# File 'lib/jekyll/converters/coffeescript.rb', line 9

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