Class: Establish::App

Inherits:
Object
  • Object
show all
Defined in:
lib/establish/app.rb

Defined Under Namespace

Modules: AppStatus

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(apple_id = nil, app_identifier = nil) ⇒ App

Returns a new instance of App.



28
29
30
31
32
33
34
35
36
37
# File 'lib/establish/app.rb', line 28

def initialize(apple_id = nil, app_identifier = nil)
  self.apple_id = apple_id
  self.app_identifier = app_identifier

  if apple_id and not app_identifier
    # Fetch the app identifier based on the given Apple ID
    self.app_identifier = Establish::ItunesSearchApi.fetch_bundle_identifier(apple_id)
    Helper.log.debug "Created app with ID #{apple_id} and app_identifier #{self.app_identifier}"
  end
end

Instance Attribute Details

#app_identifierObject

Returns the value of attribute app_identifier.



3
4
5
# File 'lib/establish/app.rb', line 3

def app_identifier
  @app_identifier
end

#apple_idObject

Returns the value of attribute apple_id.



3
4
5
# File 'lib/establish/app.rb', line 3

def apple_id
  @apple_id
end

#metadataObject

Returns the value of attribute metadata.



3
4
5
# File 'lib/establish/app.rb', line 3

def 
  
end

#metadata_dirObject

Returns the value of attribute metadata_dir.



3
4
5
# File 'lib/establish/app.rb', line 3

def 
  
end

Instance Method Details

#create_new_version!(version_number) ⇒ Object

Destructive/Constructive methods



74
75
76
# File 'lib/establish/app.rb', line 74

def create_new_version!(version_number)
  itc.create_new_version!(self, version_number)
end

#get_app_statusObject



47
48
49
# File 'lib/establish/app.rb', line 47

def get_app_status
  itc.get_app_status(self)
end

#get_metadata_directoryObject



61
62
63
# File 'lib/establish/app.rb', line 61

def 
  metdata_dir || './'
end

#itcObject



39
40
41
# File 'lib/establish/app.rb', line 39

def itc
  @itc ||= Establish::ItunesConnect.new
end

#open_in_itunes_connectObject



43
44
45
# File 'lib/establish/app.rb', line 43

def open_in_itunes_connect
  itc.open_app_page(self)
end

#set_metadata_directory(dir) ⇒ Object

Use this method to change the default download location for the metadata packages



56
57
58
59
# File 'lib/establish/app.rb', line 56

def (dir)
  raise "Can not change metadata directory after accessing metdata of an app" if 
  self. = dir
end

#to_sObject



51
52
53
# File 'lib/establish/app.rb', line 51

def to_s
  "#{apple_id} - #{app_identifier}"
end

#upload_metadata!Object

This method has to be called, after modifying the values of .metadata It will take care of uploading all changes to Apple



80
81
82
83
84
# File 'lib/establish/app.rb', line 80

def upload_metadata!
  raise "You first have to modify the metadata using app.metadata.setDescription" unless 

  self..upload!
end