Class: ReleaseFile

Inherits:
Object
  • Object
show all
Defined in:
lib/karist/release_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(release_file, env_path, templates_path) ⇒ ReleaseFile

Returns a new instance of ReleaseFile.



6
7
8
9
10
11
12
13
# File 'lib/karist/release_file.rb', line 6

def initialize(release_file, env_path, templates_path)
  @env_path = env_path
  @templates_path = templates_path

  @releases = release_file.fetch(:releases, []).map do |release|
    Release.new(release, self)
  end
end

Instance Attribute Details

#env_pathObject (readonly)

Returns the value of attribute env_path.



4
5
6
# File 'lib/karist/release_file.rb', line 4

def env_path
  @env_path
end

#releasesObject (readonly)

Returns the value of attribute releases.



4
5
6
# File 'lib/karist/release_file.rb', line 4

def releases
  @releases
end

#templates_pathObject (readonly)

Returns the value of attribute templates_path.



4
5
6
# File 'lib/karist/release_file.rb', line 4

def templates_path
  @templates_path
end

Instance Method Details

#display_allObject



21
22
23
24
25
# File 'lib/karist/release_file.rb', line 21

def display_all
  @releases.map do |release|
    release.marshal_all_yaml
  end
end

#render_allObject



15
16
17
18
19
# File 'lib/karist/release_file.rb', line 15

def render_all
  @releases.each do |release|
    release.render
  end
end