Class: RKit::Core

Inherits:
Object show all
Defined in:
lib/r_kit/core.rb

Defined Under Namespace

Classes: Configurer, Engineer, Loader

Class Method Summary collapse

Class Method Details

.digestObject



62
63
64
# File 'lib/r_kit/core.rb', line 62

def digest
  Digest::MD5.hexdigest @_config.fingerprint
end

.inherited(subclass) ⇒ Object



14
15
16
17
# File 'lib/r_kit/core.rb', line 14

def inherited subclass
  subclass.init!
  super
end

.init!Object



8
9
10
11
12
# File 'lib/r_kit/core.rb', line 8

def init!
  @_config = Configurer.new self
  @_engine = Engineer.new self
  @_load = Loader.new self
end

.inspectObject



57
58
59
60
# File 'lib/r_kit/core.rb', line 57

def inspect
  "#{ name } config_w/#{ @_config.inspect } loaded/#{ loaded? }"
  # TODO: add link to doc
end

.load(config = {}) ⇒ Object



52
53
54
# File 'lib/r_kit/core.rb', line 52

def load config = {}
  load! config if !loaded?
end

.load!(config) ⇒ Object



44
45
46
47
48
49
50
# File 'lib/r_kit/core.rb', line 44

def load! config
  require "#{ name.underscore }.rb"

  @_config.load! config
  @_engine.load!
  @_load.load!
end

.loaded?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/r_kit/core.rb', line 40

def loaded?
  RKit::Core::Loader.loaded? name
end

.with_engine(file) ⇒ Object



20
21
22
# File 'lib/r_kit/core.rb', line 20

def with_engine file
  @_engine.pathname = Pathname.new(File.dirname(file)) + name.demodulize.underscore
end

.with_sprockets(file) ⇒ Object



24
25
26
27
# File 'lib/r_kit/core.rb', line 24

def with_sprockets file
  @_engine.sprockets = true
  load_path file, 'sass_extend'
end