Class: Staticz::Manifest

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/manifest/manifest.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeManifest

Returns a new instance of Manifest.



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

def initialize
  @elements = []
end

Instance Attribute Details

#elementsObject (readonly)

Returns the value of attribute elements.



14
15
16
# File 'lib/manifest/manifest.rb', line 14

def elements
  @elements
end

Class Method Details

.define(&block) ⇒ Object



61
62
63
# File 'lib/manifest/manifest.rb', line 61

def self.define(&block)
  Staticz::Manifest.instance.define(block)
end

Instance Method Details

#buildObject



47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/manifest/manifest.rb', line 47

def build
  load "#{Dir.pwd}/manifest.rb"

  elements.each do |e|
    e.create_link_function
  end

  elements.each do |e|
    e.build
  end

  print
end

#coffee(name) ⇒ Object



43
44
45
# File 'lib/manifest/manifest.rb', line 43

def coffee(name)
  elements.push(Staticz::Cs.new(name))
end

#define(block) ⇒ Object



65
66
67
68
# File 'lib/manifest/manifest.rb', line 65

def define(block)
  elements.clear
  instance_eval(&block)
end

#haml(name) ⇒ Object



27
28
29
# File 'lib/manifest/manifest.rb', line 27

def haml(name)
  elements.push(Staticz::Haml.new(name))
end

#js(name) ⇒ Object



39
40
41
# File 'lib/manifest/manifest.rb', line 39

def js(name)
  elements.push(Staticz::Js.new(name))
end


70
71
72
73
74
75
# File 'lib/manifest/manifest.rb', line 70

def print
  puts "Manifest:"
  elements.each do |e|
    e.print(0)
  end
end

#sass(name) ⇒ Object



31
32
33
# File 'lib/manifest/manifest.rb', line 31

def sass(name)
  elements.push(Staticz::Sass.new(name))
end

#scss(name) ⇒ Object



35
36
37
# File 'lib/manifest/manifest.rb', line 35

def scss(name)
  elements.push(Staticz::Scss.new(name))
end

#sub(name, &block) ⇒ Object



20
21
22
23
24
25
# File 'lib/manifest/manifest.rb', line 20

def sub(name, &block)
  s = Staticz::Sub.new(name)
  elements.push(s)

  s.instance_eval(&block)
end