Class: Opal::BuilderProcessors::RubyProcessor
- Inherits:
-
Processor
- Object
- Processor
- Opal::BuilderProcessors::RubyProcessor
show all
- Defined in:
- opal/lib/opal/builder_processors.rb
Instance Attribute Summary
Attributes inherited from Processor
#filename, #options
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Processor
handles, #initialize, #mark_as_required, match_regexp, #to_s
Class Method Details
.match?(other) ⇒ Boolean
Also catch a files with missing extensions and nil.
102
103
104
|
# File 'opal/lib/opal/builder_processors.rb', line 102
def self.match?(other)
super || File.extname(other.to_s) == ''
end
|
Instance Method Details
#compiled ⇒ Object
81
82
83
84
85
86
87
|
# File 'opal/lib/opal/builder_processors.rb', line 81
def compiled
@compiled ||= begin
compiler = compiler_for(@source, file: @filename)
compiler.compile
compiler
end
end
|
#compiler_for(source, options = {}) ⇒ Object
89
90
91
|
# File 'opal/lib/opal/builder_processors.rb', line 89
def compiler_for(source, options = {})
::Opal::Compiler.new(source, @options.merge(options))
end
|
#required_trees ⇒ Object
97
98
99
|
# File 'opal/lib/opal/builder_processors.rb', line 97
def required_trees
compiled.required_trees
end
|
#requires ⇒ Object
93
94
95
|
# File 'opal/lib/opal/builder_processors.rb', line 93
def requires
compiled.requires
end
|
#source ⇒ Object
73
74
75
|
# File 'opal/lib/opal/builder_processors.rb', line 73
def source
compiled.result
end
|
#source_map ⇒ Object
77
78
79
|
# File 'opal/lib/opal/builder_processors.rb', line 77
def source_map
compiled.source_map
end
|