Class: Opal::Builder::Processor::RubyProcessor
Instance Attribute Summary
#abs_path, #filename, #options
Class Method Summary
collapse
Instance Method Summary
collapse
handles, #initialize, #mark_as_required, match_regexp, #to_s
Class Method Details
.match?(other) ⇒ Boolean
Also catch a files with missing extensions and nil.
116
117
118
|
# File 'opal/lib/opal/builder/processor.rb', line 116
def self.match?(other)
super || File.extname(other.to_s) == ''
end
|
Instance Method Details
#autoloads ⇒ Object
111
112
113
|
# File 'opal/lib/opal/builder/processor.rb', line 111
def autoloads
compiled.autoloads
end
|
#cache_key ⇒ Object
95
96
97
|
# File 'opal/lib/opal/builder/processor.rb', line 95
def cache_key
[self.class, @filename, @source, @options]
end
|
#compiled ⇒ Object
87
88
89
90
91
92
93
|
# File 'opal/lib/opal/builder/processor.rb', line 87
def compiled
@compiled ||= Opal::Cache.fetch(@cache, cache_key) do
compiler = compiler_for(@source, file: @filename)
compiler.compile
compiler
end
end
|
#compiler_for(source, options = {}) ⇒ Object
99
100
101
|
# File 'opal/lib/opal/builder/processor.rb', line 99
def compiler_for(source, options = {})
::Opal::Compiler.new(source, @options.merge(options))
end
|
#required_trees ⇒ Object
107
108
109
|
# File 'opal/lib/opal/builder/processor.rb', line 107
def required_trees
compiled.required_trees
end
|
#requires ⇒ Object
103
104
105
|
# File 'opal/lib/opal/builder/processor.rb', line 103
def requires
compiled.requires
end
|
#source ⇒ Object
79
80
81
|
# File 'opal/lib/opal/builder/processor.rb', line 79
def source
compiled.result
end
|
#source_map ⇒ Object
83
84
85
|
# File 'opal/lib/opal/builder/processor.rb', line 83
def source_map
compiled.source_map
end
|