Class: Pod

Inherits:
Object
  • Object
show all
Defined in:
lib/updater/pod.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



2
3
4
# File 'lib/updater/pod.rb', line 2

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path.



2
3
4
# File 'lib/updater/pod.rb', line 2

def path
  @path
end

Instance Method Details

#gitObject



23
24
25
# File 'lib/updater/pod.rb', line 23

def git
  @git ||= Git.new(path: @path)
end

#git_sourceObject



15
16
17
# File 'lib/updater/pod.rb', line 15

def git_source
  versions.sort.last.contents["source"]["git"]
end

#saveObject



19
20
21
# File 'lib/updater/pod.rb', line 19

def save
  versions.each(&:save)
end

#versionsObject



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