Class: Less::Loader
- Inherits:
-
Object
- Object
- Less::Loader
- Defined in:
- lib/less/loader.rb
Defined Under Namespace
Classes: Console, Fs, Http, HttpNodeObj, Path, Process, ServerResponse, Sys, Url
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.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/less/loader.rb', line 11 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('url', Url.new) @environment.native('http', Http.new) @environment.native('fs', Fs.new) end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
9 10 11 |
# File 'lib/less/loader.rb', line 9 def environment @environment end |
Instance Method Details
#require(module_id) ⇒ Object
26 27 28 |
# File 'lib/less/loader.rb', line 26 def require(module_id) @environment.require(module_id) end |