Class: Pod
- Inherits:
-
Object
- Object
- Pod
- Defined in:
- lib/updater/pod.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #git ⇒ Object
- #git_source ⇒ Object
-
#initialize(path:) ⇒ Pod
constructor
A new instance of Pod.
- #save ⇒ Object
- #versions ⇒ Object
Constructor Details
#initialize(path:) ⇒ Pod
4 5 6 7 |
# File 'lib/updater/pod.rb', line 4 def initialize(path:) @path = path @name = @path.split(File::SEPARATOR).last end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
2 3 4 |
# File 'lib/updater/pod.rb', line 2 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
2 3 4 |
# File 'lib/updater/pod.rb', line 2 def path @path end |
Instance Method Details
#git ⇒ Object
23 24 25 |
# File 'lib/updater/pod.rb', line 23 def git @git ||= Git.new(path: @path) end |
#git_source ⇒ Object
15 16 17 |
# File 'lib/updater/pod.rb', line 15 def git_source versions.sort.last.contents["source"]["git"] end |
#save ⇒ Object
19 20 21 |
# File 'lib/updater/pod.rb', line 19 def save versions.each(&:save) end |
#versions ⇒ Object
9 10 11 12 13 |
# File 'lib/updater/pod.rb', line 9 def versions @versions ||= Dir.glob(File.join(@path, '*')).map do |version_path| Version.new(path: version_path) end end |