class RKit::Core::Engineer

Attributes

_base[RW]
pathname[RW]
sprockets[RW]

Public Class Methods

new(base) click to toggle source
# File lib/r_kit/core/engineer.rb, line 4
def initialize base
  @_base = base
end

Public Instance Methods

load!() click to toggle source
# File lib/r_kit/core/engineer.rb, line 38
def load!
  load_engine! if load_engine?
  load_sprockets! if load_sprockets?
end
load_engine!() click to toggle source
# 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?() click to toggle source
# File lib/r_kit/core/engineer.rb, line 9
def load_engine?
  @pathname
end
load_sprockets!() click to toggle source
Calls superclass method
# 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?() click to toggle source
# File lib/r_kit/core/engineer.rb, line 22
def load_sprockets?
  @sprockets
end