Class: Establish::App
- Inherits:
-
Object
- Object
- Establish::App
- Defined in:
- lib/establish/app.rb
Defined Under Namespace
Modules: AppStatus
Instance Attribute Summary collapse
-
#app_identifier ⇒ Object
Returns the value of attribute app_identifier.
-
#apple_id ⇒ Object
Returns the value of attribute apple_id.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#metadata_dir ⇒ Object
Returns the value of attribute metadata_dir.
Instance Method Summary collapse
-
#create_new_version!(version_number) ⇒ Object
Destructive/Constructive methods.
- #get_app_status ⇒ Object
- #get_metadata_directory ⇒ Object
-
#initialize(apple_id = nil, app_identifier = nil) ⇒ App
constructor
A new instance of App.
- #itc ⇒ Object
- #open_in_itunes_connect ⇒ Object
-
#set_metadata_directory(dir) ⇒ Object
Use this method to change the default download location for the metadata packages.
- #to_s ⇒ Object
-
#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.
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_identifier ⇒ Object
Returns the value of attribute app_identifier.
3 4 5 |
# File 'lib/establish/app.rb', line 3 def app_identifier @app_identifier end |
#apple_id ⇒ Object
Returns the value of attribute apple_id.
3 4 5 |
# File 'lib/establish/app.rb', line 3 def apple_id @apple_id end |
#metadata ⇒ Object
Returns the value of attribute metadata.
3 4 5 |
# File 'lib/establish/app.rb', line 3 def end |
#metadata_dir ⇒ Object
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_status ⇒ Object
47 48 49 |
# File 'lib/establish/app.rb', line 47 def get_app_status itc.get_app_status(self) end |
#get_metadata_directory ⇒ Object
61 62 63 |
# File 'lib/establish/app.rb', line 61 def metdata_dir || './' end |
#itc ⇒ Object
39 40 41 |
# File 'lib/establish/app.rb', line 39 def itc @itc ||= Establish::ItunesConnect.new end |
#open_in_itunes_connect ⇒ Object
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_s ⇒ Object
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 raise "You first have to modify the metadata using app.metadata.setDescription" unless self..upload! end |