Class: Trout::VersionList

Inherits:
Object
  • Object
show all
Defined in:
lib/trout/version_list.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ VersionList

Returns a new instance of VersionList.



7
8
9
# File 'lib/trout/version_list.rb', line 7

def initialize(path)
  @path = path
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



5
6
7
# File 'lib/trout/version_list.rb', line 5

def entries
  @entries
end

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/trout/version_list.rb', line 5

def path
  @path
end

Instance Method Details

#git_url_for(filename) ⇒ Object



11
12
13
14
# File 'lib/trout/version_list.rb', line 11

def git_url_for(filename)
  read
  entries[filename]['git_url']
end

#update(filename, info) ⇒ Object



21
22
23
24
25
26
# File 'lib/trout/version_list.rb', line 21

def update(filename, info)
  read
  entries[filename] ||= {}
  entries[filename].update(info)
  write
end

#version_for(filename) ⇒ Object



16
17
18
19
# File 'lib/trout/version_list.rb', line 16

def version_for(filename)
  read
  entries[filename]['version']
end