Class: Statistrano::Deployment::Strategy::Branches::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/statistrano/deployment/strategy/branches/index.rb

Defined Under Namespace

Classes: ERBContext

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(releases, template_path = nil) ⇒ Index

Returns a new instance of Index.



12
13
14
15
# File 'lib/statistrano/deployment/strategy/branches/index.rb', line 12

def initialize releases, template_path=nil
  @releases = releases
  @template = IO.read(template_path || File.expand_path("../index/template.html.erb", __FILE__))
end

Instance Attribute Details

#releasesObject (readonly)

Returns the value of attribute releases.



10
11
12
# File 'lib/statistrano/deployment/strategy/branches/index.rb', line 10

def releases
  @releases
end

#templateObject (readonly)

Returns the value of attribute template.



10
11
12
# File 'lib/statistrano/deployment/strategy/branches/index.rb', line 10

def template
  @template
end

Instance Method Details

#to_htmlObject



17
18
19
# File 'lib/statistrano/deployment/strategy/branches/index.rb', line 17

def to_html
  ERB.new(template).result(ERBContext.new(releases).get_binding)
end