Class: Ubalo::PodArchive

Inherits:
Object
  • Object
show all
Defined in:
lib/ubalo/pod_archive.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account, label, attributes) ⇒ PodArchive

Returns a new instance of PodArchive.



9
10
11
12
13
# File 'lib/ubalo/pod_archive.rb', line 9

def initialize(, label, attributes)
  @account = 
  @label = label
  update_attributes(attributes)
end

Instance Attribute Details

#get_urlObject (readonly)

Returns the value of attribute get_url.



7
8
9
# File 'lib/ubalo/pod_archive.rb', line 7

def get_url
  @get_url
end

#labelObject (readonly)

Returns the value of attribute label.



7
8
9
# File 'lib/ubalo/pod_archive.rb', line 7

def label
  @label
end

#put_urlObject (readonly)

Returns the value of attribute put_url.



7
8
9
# File 'lib/ubalo/pod_archive.rb', line 7

def put_url
  @put_url
end

Class Method Details

.create_with_json(account, json) ⇒ Object



3
4
5
# File 'lib/ubalo/pod_archive.rb', line 3

def self.create_with_json(, json)
  new(, json.fetch('label'), json)
end

Instance Method Details

#==(other) ⇒ Object



40
41
42
# File 'lib/ubalo/pod_archive.rb', line 40

def ==(other)
  label == other.label
end

#activateObject



23
24
25
26
27
# File 'lib/ubalo/pod_archive.rb', line 23

def activate
  request(:put, "/activate")
rescue RestClient::Conflict
  raise Ubalo::Error, "Pod is already compiling"
end

#activate_from(pod_dir) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/ubalo/pod_archive.rb', line 15

def activate_from(pod_dir)
  with_temp_archive do |archive_name|
    pod_dir.make_archive(archive_name)
    Util.put_targz(put_url, archive_name)
    activate
  end
end

#extract_to(pod_dir) ⇒ Object



29
30
31
32
33
34
# File 'lib/ubalo/pod_archive.rb', line 29

def extract_to(pod_dir)
  with_temp_archive do |archive_name|
    Util.get_targz(get_url, archive_name)
    pod_dir.extract_archive(archive_name)
  end
end

#inspectObject



36
37
38
# File 'lib/ubalo/pod_archive.rb', line 36

def inspect
  "#<PodArchive #{label.inspect}>"
end