Class: RKit::Core::Engineer
Instance Attribute Summary collapse
-
#_base ⇒ Object
Returns the value of attribute _base.
-
#pathname ⇒ Object
Returns the value of attribute pathname.
-
#sprockets ⇒ Object
Returns the value of attribute sprockets.
Instance Method Summary collapse
-
#initialize(base) ⇒ Engineer
constructor
A new instance of Engineer.
- #load! ⇒ Object
- #load_engine! ⇒ Object
- #load_engine? ⇒ Boolean
- #load_sprockets! ⇒ Object
- #load_sprockets? ⇒ Boolean
Constructor Details
#initialize(base) ⇒ Engineer
Returns a new instance of Engineer.
4 5 6 |
# File 'lib/r_kit/core/engineer.rb', line 4 def initialize base @_base = base end |
Instance Attribute Details
#_base ⇒ Object
Returns the value of attribute _base.
2 3 4 |
# File 'lib/r_kit/core/engineer.rb', line 2 def _base @_base end |
#pathname ⇒ Object
Returns the value of attribute pathname.
2 3 4 |
# File 'lib/r_kit/core/engineer.rb', line 2 def pathname @pathname end |
#sprockets ⇒ Object
Returns the value of attribute sprockets.
2 3 4 |
# File 'lib/r_kit/core/engineer.rb', line 2 def sprockets @sprockets end |
Instance Method Details
#load! ⇒ Object
38 39 40 41 |
# File 'lib/r_kit/core/engineer.rb', line 38 def load! load_engine! if load_engine? load_sprockets! if load_sprockets? end |
#load_engine! ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/r_kit/core/engineer.rb', line 13 def load_engine! pathname = @pathname Class.new(Rails::Engine) do paths.path = pathname end end |
#load_engine? ⇒ Boolean
9 10 11 |
# File 'lib/r_kit/core/engineer.rb', line 9 def load_engine? @pathname end |
#load_sprockets! ⇒ Object
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/r_kit/core/engineer.rb', line 26 def load_sprockets! digest = _base.digest sprockets_extend = Module.new do define_method 'digest' do super().update(digest) end end Sprockets::Base.send :prepend, sprockets_extend end |
#load_sprockets? ⇒ Boolean
22 23 24 |
# File 'lib/r_kit/core/engineer.rb', line 22 def load_sprockets? @sprockets end |