Class: Roger::Project

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

Overview

Loader for rogerfile and project dependencies

Direct Known Subclasses

Testing::MockProject

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Project.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/roger/project.rb', line 24

def initialize(path, options = {})
  @path = Pathname.new(path)

  @options = {
    html_path: @path + "html",
    partial_path: @path + "partials",
    layouts_path: @path + "layouts",
    rogerfile_path: @path + "Rogerfile",
    renderer: {},
    server: {},
    release: {},
    test: {}
  }

  # Clumsy string to symbol key conversion
  options.each { |k, v| @options[k.is_a?(String) ? k.to_sym : k] = v }

  initialize_accessors
  initialize_rogerfile_path
  initialize_roger
end

Instance Attribute Details

#html_pathObject



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

def html_path
  @html_path
end

#layouts_pathObject



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

def layouts_path
  @layouts_path
end

#modeObject



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

def mode
  @mode
end

#optionsObject

Returns the value of attribute options.



22
23
24
# File 'lib/roger/project.rb', line 22

def options
  @options
end

#partial_pathObject Also known as: partials_path



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

def partial_path
  @partial_path
end

#pathObject



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

def path
  @path
end

#rogerfileObject



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

def rogerfile
  @rogerfile
end

#rogerfile_pathObject



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

def rogerfile_path
  @rogerfile_path
end

#shellObject

Returns the value of attribute shell.



20
21
22
# File 'lib/roger/project.rb', line 20

def shell
  @shell
end

Instance Method Details

#release(options = {}) ⇒ Object



54
55
56
# File 'lib/roger/project.rb', line 54

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

#server(options = {}) ⇒ Object



50
51
52
# File 'lib/roger/project.rb', line 50

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

#test(options = {}) ⇒ Object



58
59
60
# File 'lib/roger/project.rb', line 58

def test(options = {})
  @test ||= Test.new(self, merge_options(options, :test))
end