Module: Traceur::Config
- Defined in:
- lib/traceur/config.rb
Class Method Summary collapse
- .add_prefix_pattern(pattern, prefix) ⇒ Object
- .compile_to ⇒ Object
- .compile_to=(target) ⇒ Object
- .compiler_options ⇒ Object
- .lookup_prefix(path) ⇒ Object
- .prefix_patterns ⇒ Object
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_to ⇒ Object
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_options ⇒ Object
25 26 27 |
# File 'lib/traceur/config.rb', line 25 def @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_patterns ⇒ Object
12 13 14 |
# File 'lib/traceur/config.rb', line 12 def prefix_patterns @prefix_patterns ||= [] end |