Module: Traceur::Config

Defined in:
lib/traceur/config.rb

Class Method Summary collapse

Class Method Details

.add_prefix_pattern(pattern, prefix) ⇒ Object



16
17
18
# File 'lib/traceur/config.rb', line 16

def add_prefix_pattern(pattern, prefix)
  prefix_patterns << [pattern, prefix]
end

.compile_toObject



4
5
6
# File 'lib/traceur/config.rb', line 4

def compile_to
  @compile_to || :amd
end

.compile_to=(target) ⇒ Object



8
9
10
# File 'lib/traceur/config.rb', line 8

def compile_to=(target)
  @compile_to = target
end

.compiler_optionsObject



25
26
27
# File 'lib/traceur/config.rb', line 25

def compiler_options
  @compiler_options ||= {}
end

.lookup_prefix(path) ⇒ Object



20
21
22
23
# File 'lib/traceur/config.rb', line 20

def lookup_prefix(path)
  _, prefix = prefix_patterns.detect {|pattern, prefix| pattern =~ path }
  prefix
end

.prefix_patternsObject



12
13
14
# File 'lib/traceur/config.rb', line 12

def prefix_patterns
  @prefix_patterns ||= []
end