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
#abs_path, #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.
114
115
116
|
# File 'opal/lib/opal/builder_processors.rb', line 114
def self.match?(other)
super || File.extname(other.to_s) == ''
end
|
Instance Method Details
#autoloads ⇒ Object
109
110
111
|
# File 'opal/lib/opal/builder_processors.rb', line 109
def autoloads
compiled.autoloads
end
|
#cache_key ⇒ Object
93
94
95
|
# File 'opal/lib/opal/builder_processors.rb', line 93
def cache_key
[self.class, @filename, @source, @options]
end
|
#compiled ⇒ Object
85
86
87
88
89
90
91
|
# File 'opal/lib/opal/builder_processors.rb', line 85
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
97
98
99
|
# File 'opal/lib/opal/builder_processors.rb', line 97
def compiler_for(source, options = {})
::Opal::Compiler.new(source, @options.merge(options))
end
|
#required_trees ⇒ Object
105
106
107
|
# File 'opal/lib/opal/builder_processors.rb', line 105
def required_trees
compiled.required_trees
end
|
#requires ⇒ Object
101
102
103
|
# File 'opal/lib/opal/builder_processors.rb', line 101
def requires
compiled.requires
end
|
#source ⇒ Object
77
78
79
|
# File 'opal/lib/opal/builder_processors.rb', line 77
def source
compiled.result
end
|
#source_map ⇒ Object
81
82
83
|
# File 'opal/lib/opal/builder_processors.rb', line 81
def source_map
compiled.source_map
end
|