Module: CoffeeReact::Source

Defined in:
lib/coffee_react.rb

Class Method Summary collapse

Class Method Details

.contents ⇒ Object



24
25
26
# File 'lib/coffee_react.rb', line 24

def self.contents
  @contents ||= File.read(path)
end

.context ⇒ Object



28
29
30
# File 'lib/coffee_react.rb', line 28

def self.context
  @context ||= ExecJS.compile(contents)
end

.gem_dir ⇒ Object



11
12
13
# File 'lib/coffee_react.rb', line 11

def self.gem_dir
  Gem::Specification.find_by_name('coffee-react').gem_dir
end

.path ⇒ Object



15
16
17
# File 'lib/coffee_react.rb', line 15

def self.path
  @path ||= "#{gem_dir}/coffee-react-transform.js"
end

.path=(path) ⇒ Object



19
20
21
22
# File 'lib/coffee_react.rb', line 19

def self.path=(path)
  @contents = @context = nil
  @path = path
end