Class: RKit::Core

Inherits:
Object
  • 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



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

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

.inherited(subclass) ⇒ Object



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

def inherited subclass
  subclass.init!
  super
end

.init!Object



4
5
6
7
8
# File 'lib/r_kit/core.rb', line 4

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

.inspectObject



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

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

.load(config = {}) ⇒ Object



46
47
48
# File 'lib/r_kit/core.rb', line 46

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

.load!(config) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/r_kit/core.rb', line 38

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

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

.loaded?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/r_kit/core.rb', line 34

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

.with_engine(file) ⇒ Object



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

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

.with_sprockets(file) ⇒ Object



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

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