Class: Less::Loader
- Inherits:
-
Object
- Object
- Less::Loader
- Defined in:
- lib/less/loader.rb
Defined Under Namespace
Classes: Console, Fs, Path, Process, Sys
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
Instance Method Summary collapse
-
#initialize ⇒ Loader
constructor
A new instance of Loader.
- #require(module_id) ⇒ Object
Constructor Details
#initialize ⇒ Loader
Returns a new instance of Loader.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/less/loader.rb', line 9 def initialize context_wrapper = Less::JavaScript.context_wrapper.instance @context = context_wrapper.unwrap @context['process'] = Process.new @context['console'] = Console.new path = Pathname(__FILE__).dirname.join('js', 'lib') @environment = CommonJS::Environment.new(@context, :path => path.to_s) @environment.native('path', Path.new) @environment.native('util', Sys.new) @environment.native('fs', Fs.new) end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
7 8 9 |
# File 'lib/less/loader.rb', line 7 def environment @environment end |
Instance Method Details
#require(module_id) ⇒ Object
21 22 23 |
# File 'lib/less/loader.rb', line 21 def require(module_id) @environment.require(module_id) end |