Class: HtmlMockup::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/html_mockup/project.rb

Overview

Loader for mockupfile and project dependencies

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, options = {}) ⇒ Project

Returns a new instance of Project.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/html_mockup/project.rb', line 19

def initialize(path, options={})
  @path = Pathname.new(path)
  
  @options = {
    :html_path => @path + "html",
    :partial_path => @path + "partials",
    :layouts_path => @path + "layouts"
  }
  
  # Clumsy string to symbol key conversion
  options.each{|k,v| @options[k.is_a?(String) ? k.to_sym : k] = v }
  
  self.html_path = @options[:html_path]
  self.partial_path = @options[:partials_path] || @options[:partial_path] || self.html_path + "../partials/"
  self.layouts_path = @options[:layouts_path]
  self.shell = @options[:shell]
  
  load_mockup!
end

Instance Attribute Details

#html_pathObject



13
14
15
# File 'lib/html_mockup/project.rb', line 13

def html_path
  @html_path
end

#layouts_pathObject



13
14
15
# File 'lib/html_mockup/project.rb', line 13

def layouts_path
  @layouts_path
end

#mockupfileObject



13
14
15
# File 'lib/html_mockup/project.rb', line 13

def mockupfile
  @mockupfile
end

#optionsObject

Returns the value of attribute options.



17
18
19
# File 'lib/html_mockup/project.rb', line 17

def options
  @options
end

#partial_pathObject Also known as: partials_path



13
14
15
# File 'lib/html_mockup/project.rb', line 13

def partial_path
  @partial_path
end

#pathObject



13
14
15
# File 'lib/html_mockup/project.rb', line 13

def path
  @path
end

#shellObject

Returns the value of attribute shell.



15
16
17
# File 'lib/html_mockup/project.rb', line 15

def shell
  @shell
end

Instance Method Details

#releaseObject



48
49
50
51
# File 'lib/html_mockup/project.rb', line 48

def release
  options = @options[:release] || {}      
  @release ||= Release.new(self, options)
end

#serverObject



43
44
45
46
# File 'lib/html_mockup/project.rb', line 43

def server
  options = @options[:server] || {}
  @server ||= Server.new(self, options)
end