produce 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f1298d8993f1a0bfa7ca5a98349f8c43f428ee6
4
- data.tar.gz: d1229985cfdc3dd717655096b6394525f33981d8
3
+ metadata.gz: d8becb8d4af003c48c8ab30a54ab0f3271f1b587
4
+ data.tar.gz: 4070c10bdecd9d45c0699ea0af277b83fc8527fa
5
5
  SHA512:
6
- metadata.gz: ac92d64e9e110bb5b84dff7c25e7a66edcf69c9b071386b54f745298a1a41083a8da75a0d403dfe7f21e053a706b1d0cc6e358449723f1c15844c73f4dee6190
7
- data.tar.gz: 40233a20a2eb1c4a4e8c616c250274c488ee9192b9872d7ec0f1e7961bfea87ede47136ac55d1c425cb78a6d9f44bee23b0984a6e26e64a661f21846810d77f7
6
+ metadata.gz: 4e3b535ff76b7f9d35d95c7ce105ff9878b5a7c7af5e8c72406f6237c5ecd4721eeaf826533f464622a79a1834a5c10d5661c3e423d1f99f0b6139f9da3f75fe
7
+ data.tar.gz: afee6dd96be076d475ccfa4fc670cdaab8ca4fd10aefc99e56a4b7b0cf7b50e54a9872a1dac1d3f051c5151dd607da5ecdc1687cb68f52dfa7bae80016a389c6
data/README.md CHANGED
@@ -83,20 +83,26 @@ In case you want to pass more information to `produce`:
83
83
  - `PRODUCE_TEAM_ID` (the Team ID, e.g. `Q2CBPK58CA`)
84
84
  - `PRODUCE_TEAM_NAME` (the Team Name, e.g. `Felix Krause`)
85
85
 
86
- ## `fastlane` Integration
86
+ ## [`fastlane`](https://github.com/KrauseFx/fastlane) Integration
87
87
 
88
- Your `Fastfile`
88
+ Your `Fastfile` should look like this
89
89
  ```ruby
90
90
  lane :appstore do
91
91
  produce({
92
- ...
92
+ produce_username: 'felix@krausefx.com',
93
+ produce_app_identifier: 'com.krausefx.app',
94
+ produce_app_name: 'MyApp',
95
+ produce_language: 'English',
96
+ produce_version: '1.0',
97
+ produce_sku: 123,
98
+ produce_team_name: 'SunApps GmbH' # only necessary when in multiple teams
93
99
  })
94
100
 
95
101
  deliver
96
102
  end
97
103
  ```
98
104
 
99
- To use the newly generated app in `deliver`, you have to adapt your `Deliverfile`:
105
+ To use the newly generated app in `deliver`, you need to add this line to your `Deliverfile`:
100
106
 
101
107
  ```ruby
102
108
  apple_id ENV['PRODUCE_APPLE_ID']
@@ -1,41 +1,74 @@
1
1
  module Produce
2
2
  class Config
3
- attr_accessor :config
3
+ ASK_MESSAGES = {
4
+ bundle_identifier: "App Identifier (Bundle ID, e.g. com.krausefx.app): ",
5
+ app_name: "App Name: ",
6
+ version: "Initial version number (e.g. '1.0'): ",
7
+ sku: "SKU Number (e.g. '1234'): ",
8
+ primary_language: "Primary Language (e.g. 'English', 'German'): "
9
+ }
10
+
11
+ attr_reader :config
4
12
 
5
13
  def self.shared_config
6
14
  @@shared ||= self.new
7
15
  end
8
16
 
9
- def initialize
10
- @config = {
11
- :bundle_identifier => ENV['PRODUCE_APP_IDENTIFIER'],
12
- :app_name => ENV['PRODUCE_APP_NAME'],
13
- :primary_language => ENV['PRODUCE_LANGUAGE'],
14
- :version => ENV['PRODUCE_VERSION'],
15
- :sku => ENV['PRODUCE_SKU']
16
- }
17
+ def self.shared_config= config
18
+ @@shared = config
19
+ end
17
20
 
18
- @config[:bundle_identifier] ||= CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
19
- @config[:bundle_identifier] ||= ask("App Identifier (Bundle ID, e.g. com.krausefx.app): ")
20
- @config[:app_name] ||= ask("App Name: ")
21
-
22
- while @config[:primary_language].to_s.length == 0
23
- input = ask("Primary Language (e.g. 'English', 'German'): ")
24
- input = input.split.map(&:capitalize).join(' ')
25
- if not AvailableDefaultLanguages.all_langauges.include?(input)
26
- Helper.log.error "Could not find langauge #{input} - available languages: #{AvailableDefaultLanguages.all_langauges}"
21
+ def self.env_options
22
+ hash = {
23
+ bundle_identifier: ENV['PRODUCE_APP_IDENTIFIER'],
24
+ app_name: ENV['PRODUCE_APP_NAME'],
25
+ version: ENV['PRODUCE_VERSION'],
26
+ sku: ENV['PRODUCE_SKU'],
27
+ skip_itc: skip_itc?(ENV['PRODUCE_SKIP_ITC'])
28
+ }
29
+ if ENV['PRODUCE_LANGUAGE']
30
+ language = ENV['PRODUCE_LANGUAGE']
31
+ if is_valid_language?(language)
32
+ hash[:primary_language] = language
27
33
  else
28
- @config[:primary_language] = input
34
+ Helper.log.error "PRODUCE_LANGUAGE is set to #{language} but it's not one of available languages. You'll be asked to set language again if needed."
29
35
  end
30
36
  end
37
+ hash[:bundle_identifier] ||= CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
38
+ hash.delete_if { |key, value| value.nil? }
39
+ hash
40
+ end
31
41
 
32
- @config[:version] ||= ask("Initial version number (e.g. '1.0'): ")
33
- @config[:sku] ||= ask("SKU Number (e.g. '1234'): ")
42
+ def initialize(options = {})
43
+ @config = Config.env_options.merge(options)
34
44
  end
35
45
 
36
46
  def self.val(key)
37
- raise "Please only pass symbols, no Strings to this method".red unless key.kind_of?Symbol
38
- self.shared_config.config[key]
47
+ raise "Please only pass symbols, no Strings to this method".red unless key.kind_of? Symbol
48
+
49
+ unless self.shared_config.config.has_key? key
50
+ self.shared_config.config[key] = ask(ASK_MESSAGES[key]) do |q|
51
+ case key
52
+ when :primary_language
53
+ q.validate = lambda { |val| is_valid_language?(val) }
54
+ q.responses[:not_valid] = "Please enter one of available languages: #{AvailableDefaultLanguages.all_langauges}"
55
+ else
56
+ q.validate = lambda { |val| !val.empty? }
57
+ q.responses[:not_valid] = "#{key.to_s.gsub('_', ' ').capitalize} can't be blank"
58
+ end
59
+ end
60
+ end
61
+
62
+ return self.shared_config.config[key]
63
+ end
64
+
65
+ def self.is_valid_language? language
66
+ language = language.split.map(&:capitalize).join(' ')
67
+ AvailableDefaultLanguages.all_langauges.include? language
68
+ end
69
+
70
+ def self.skip_itc? value
71
+ %w( true t 1 yes y ).include? value.to_s.downcase
39
72
  end
40
73
  end
41
74
  end
@@ -126,6 +126,8 @@ module Produce
126
126
 
127
127
  initial_create
128
128
 
129
+ initial_pricing
130
+
129
131
  raise "Something went wrong when creating the new app - it's not listed in the App's list" unless app_exists?
130
132
 
131
133
  Helper.log.info "Finished creating new app '#{Config.val(:app_name)}' on iTunes Connect".green
@@ -180,6 +182,13 @@ module Produce
180
182
  Helper.log.info "Successfully created new app '#{Config.val(:app_name)}' on iTC. Setting up the initial information now.".green
181
183
  end
182
184
 
185
+ def initial_pricing
186
+ sleep 3
187
+ click_on "Pricing"
188
+ first('#pricingPopup > option[value="3"]').select_option
189
+ first('.saveChangesActionButton').click
190
+ end
191
+
183
192
  private
184
193
  def app_exists?
185
194
  open_new_app_popup # to get the dropdown of available app identifier, if it's there, the app was not yet created
@@ -2,7 +2,7 @@ module Produce
2
2
  class Manager
3
3
  def self.start_producing
4
4
  DeveloperCenter.new.run
5
- return ItunesConnect.new.run
5
+ return ItunesConnect.new.run unless Config.val(:skip_itc)
6
6
  end
7
7
  end
8
- end
8
+ end
@@ -33,7 +33,7 @@ module Produce
33
33
 
34
34
  # The currently used version of this gem
35
35
  def self.current_version
36
- Sigh::VERSION
36
+ Produce::VERSION
37
37
  end
38
38
 
39
39
  private
@@ -1,3 +1,3 @@
1
1
  module Produce
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: produce
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-30 00:00:00.000000000 Z
11
+ date: 2015-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -206,8 +206,8 @@ dependencies:
206
206
  - - '>='
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
- description: Because you would rather spend your time building stuff than fighting
210
- provisioning
209
+ description: Create new iOS apps on iTunes Connect and Dev Portal using the command
210
+ line
211
211
  email:
212
212
  - produce@krausefx.com
213
213
  executables:
@@ -252,6 +252,6 @@ rubyforge_project:
252
252
  rubygems_version: 2.2.2
253
253
  signing_key:
254
254
  specification_version: 4
255
- summary: Because you would rather spend your time building stuff than fighting provisioning
255
+ summary: Create new iOS apps on iTunes Connect and Dev Portal using the command line
256
256
  test_files: []
257
257
  has_rdoc: