xcjobs 0.0.4 → 0.0.5

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: eac32d8569de052550d96593eff82cd0a763869a
4
- data.tar.gz: 34e41ea1409433f0c7c10e5e463f75e3fe6b23f1
3
+ metadata.gz: 74786dbd12794c4e84b2ed2b4e124a4c7962f1fd
4
+ data.tar.gz: e85e77554cbf70d0ac3c91240970ce79d1828ca1
5
5
  SHA512:
6
- metadata.gz: da839be27a65f45ae32383785cb749dce1d5c5a63b12d79c6873c3a5ade2bdef79a07fc25c27fc609526588a5b9ec557bf11a4022ab6482ecfdbee46071a87fc
7
- data.tar.gz: 161aaf870817f335ee57b0940bfd501ec6695339ddf7a7d238ac14dd356dd5e8026547fc853160966227b88d9c55dd93b1c6d1085d16cef6ec6aa04300f27314
6
+ metadata.gz: 30d2392f658fd61db0b58815da14d0630b0db9f759f544d587500a4fa1a5f70672dbc82927cd3f65648ea300fa276dbb37582fa1f004a7e8e2f54b165778bc66
7
+ data.tar.gz: 55fa6b6c013c8f6a7abfd9544de2e5a4cd219ac8d4255d04bf42e056aeb0764bd569fb98de48056f085e8cf5a7951f9ba0785e1b909aed5838a1375b622afc5b
data/.travis.yml CHANGED
@@ -4,3 +4,6 @@ rvm:
4
4
  - 1.9.3
5
5
  - 2.0.0
6
6
  - 2.1
7
+ branches:
8
+ only:
9
+ - master
data/README.md CHANGED
@@ -85,9 +85,9 @@ XCJobs::Archive.new do |t|
85
85
  end
86
86
 
87
87
  XCJobs::Export.new do |t|
88
- t.archivePath = File.join("build", "Example.xcarchive")
89
- t.exportPath = File.join("build", "Example.ipa")
90
- t.exportProvisioningProfile = "Ad_Hoc.mobileprovision"
88
+ t.archive_path = File.join("build", "Example.xcarchive")
89
+ t.export_path = File.join("build", "Example.ipa")
90
+ t.export_provisioning_profile = "Ad_Hoc.mobileprovision"
91
91
  t.formatter = "xcpretty -c"
92
92
  end
93
93
  ```
@@ -111,7 +111,7 @@ $ bundle exec rake build:export
111
111
  xcodebuild -exportArchive -exportFormat IPA -archivePath build/Example.xcarchive -exportPath build/Example.ipa -exportProvisioningProfile Ad Hoc Provisioning Profile
112
112
  ```
113
113
 
114
- ### Distribute (Upload to Testfligh/Crittercism)
114
+ ### Distribute (Upload to TestFlight/Crittercism)
115
115
 
116
116
  ```ruby
117
117
  XCJobs::Distribute::Crittercism.new do |t|
@@ -73,6 +73,49 @@ module XCJobs
73
73
  end
74
74
  end
75
75
 
76
+ class DeployGate < Rake::TaskLib
77
+ include Rake::DSL if defined?(Rake::DSL)
78
+ include Distribute
79
+
80
+ attr_accessor :owner_name
81
+
82
+ attr_accessor :token
83
+ attr_accessor :file
84
+ attr_accessor :message
85
+ attr_accessor :distribution_key
86
+ attr_accessor :release_note
87
+ attr_accessor :disable_notify
88
+ attr_accessor :visibility
89
+
90
+ def initialize()
91
+ yield self if block_given?
92
+ define
93
+ end
94
+
95
+ private
96
+
97
+ def define
98
+ namespace :distribute do
99
+ desc 'upload IPA to DeployGate'
100
+ task :deploygate do
101
+ upload("https://deploygate.com/api/users/#{owner_name}/apps", form_data)
102
+ end
103
+ end
104
+ end
105
+
106
+ def form_data
107
+ {}.tap do |fields|
108
+ fields[:token] = token if token
109
+ fields[:file] = "@#{file}" if file
110
+ fields[:message] = message if message
111
+ fields[:distribution_key] = distribution_key if distribution_key
112
+ fields[:release_note] = release_note if release_note
113
+ fields[:disable_notify] = 'yes' if disable_notify
114
+ fields[:visibility] = visibility if visibility
115
+ end
116
+ end
117
+ end
118
+
76
119
  class Crittercism < Rake::TaskLib
77
120
  include Rake::DSL if defined?(Rake::DSL)
78
121
  include Distribute
@@ -1,3 +1,3 @@
1
1
  module XCJobs
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -23,7 +23,7 @@ describe XCJobs::Distribute do
23
23
  describe 'define upload ipa task' do
24
24
  let(:credentials) do
25
25
  { api_token: 'abcde12345efghi67890d543957972cd_MTE3NjUyMjBxMS0wOE0wNiAwMzwzMjoyNy41MTA3MzE',
26
- team_token:'12345ab2692bd1c3093408a3399ee947_NDIzMDYyPDExLGExLTIwIDIxOjM9OjS2LjQxOTgzOA',
26
+ team_token: '12345ab2692bd1c3093408a3399ee947_NDIzMDYyPDExLGExLTIwIDIxOjM9OjS2LjQxOTgzOA',
27
27
  }
28
28
  end
29
29
 
@@ -36,8 +36,8 @@ describe XCJobs::Distribute do
36
36
  let!(:task) do
37
37
  XCJobs::Distribute::TestFlight.new do |t|
38
38
  t.file = file
39
- t.api_token = credentials['api_token']
40
- t.team_token = credentials['team_token']
39
+ t.api_token = credentials[:api_token]
40
+ t.team_token = credentials[:team_token]
41
41
  t.notify = true
42
42
  t.replace = true
43
43
  t.distribution_lists = 'Dev'
@@ -50,11 +50,11 @@ describe XCJobs::Distribute do
50
50
  end
51
51
 
52
52
  it 'configures the api_token' do
53
- expect(task.api_token).to eq credentials['api_token']
53
+ expect(task.api_token).to eq credentials[:api_token]
54
54
  end
55
55
 
56
56
  it 'configures the team_token' do
57
- expect(task.team_token).to eq credentials['team_token']
57
+ expect(task.team_token).to eq credentials[:team_token]
58
58
  end
59
59
 
60
60
  it 'configures the notify' do
@@ -82,6 +82,8 @@ describe XCJobs::Distribute do
82
82
  expect(@url).to eq 'http://testflightapp.com/api/builds.json'
83
83
  expect(@form_data).to eq({
84
84
  file: "@#{file}",
85
+ api_token: credentials[:api_token],
86
+ team_token: credentials[:team_token],
85
87
  notify: true,
86
88
  replace: true,
87
89
  distribution_lists: 'Dev',
@@ -93,11 +95,91 @@ describe XCJobs::Distribute do
93
95
  end
94
96
  end
95
97
 
98
+ describe XCJobs::Distribute::DeployGate do
99
+ describe 'define upload ipa task' do
100
+ let(:owner_name) { 'kishikawakatsumi' }
101
+
102
+ let(:credentials) do
103
+ { token: 'abcde12345efghi67890abcde12345efghi67890',
104
+ distribution_key: '12345abcde67890efghi12345abcde67890efghi',
105
+ }
106
+ end
107
+
108
+ let(:file) do
109
+ File.join('build', 'Example.ipa')
110
+ end
111
+
112
+ let(:message) { 'New build uploaded!' }
113
+ let(:release_note) { "Uploaded: #{DateTime.now.strftime("%Y/%m/%d %H:%M:%S")}" }
114
+
115
+ let!(:task) do
116
+ XCJobs::Distribute::DeployGate.new do |t|
117
+ t.owner_name = owner_name
118
+ t.file = file
119
+ t.token = credentials[:token]
120
+ t.distribution_key = credentials[:distribution_key]
121
+ t.message = message
122
+ t.release_note = release_note
123
+ t.disable_notify = true
124
+ t.visibility = 'public'
125
+ end
126
+ end
127
+
128
+ it 'configures the ipa file path' do
129
+ expect(task.file).to eq file
130
+ end
131
+
132
+ it 'configures the token' do
133
+ expect(task.token).to eq credentials[:token]
134
+ end
135
+
136
+ it 'configures the distribution_key' do
137
+ expect(task.distribution_key).to eq credentials[:distribution_key]
138
+ end
139
+
140
+ it 'configures the message' do
141
+ expect(task.message).to eq message
142
+ end
143
+
144
+ it 'configures the release_note' do
145
+ expect(task.release_note).to eq release_note
146
+ end
147
+
148
+ it 'configures the disable_notify' do
149
+ expect(task.disable_notify).to eq true
150
+ end
151
+
152
+ it 'configures the visibility' do
153
+ expect(task.visibility).to eq 'public'
154
+ end
155
+
156
+ describe 'tasks' do
157
+ describe 'distribute:deploygate' do
158
+ subject { Rake.application['distribute:deploygate'] }
159
+
160
+ it 'executes the appropriate commands' do
161
+ subject.invoke
162
+ expect(@url).to eq "https://deploygate.com/api/users/#{owner_name}/apps"
163
+ expect(@form_data).to eq({
164
+ file: "@#{file}",
165
+ token: credentials[:token],
166
+ distribution_key: credentials[:distribution_key],
167
+ message: message,
168
+ release_note: release_note,
169
+ disable_notify: 'yes',
170
+ visibility: 'public',
171
+ })
172
+ end
173
+ end
174
+ end
175
+ end
176
+ end
177
+
96
178
  describe XCJobs::Distribute::Crittercism do
97
179
  describe 'define upload dSYMs task' do
98
180
  let(:credentials) do
99
181
  { app_id: '123456789abcdefg12345678',
100
- key:'abcdefghijklmnopqrstuvwxyz123456',
182
+ key: 'abcdefghijklmnopqrstuvwxyz123456',
101
183
  }
102
184
  end
103
185
 
@@ -107,18 +189,18 @@ describe XCJobs::Distribute do
107
189
 
108
190
  let!(:task) do
109
191
  XCJobs::Distribute::Crittercism.new do |t|
110
- t.app_id = credentials['app_id']
111
- t.key = credentials['key']
192
+ t.app_id = credentials[:app_id]
193
+ t.key = credentials[:key]
112
194
  t.dsym = dsym_file
113
195
  end
114
196
  end
115
197
 
116
198
  it 'configures the app_id' do
117
- expect(task.app_id).to eq credentials['app_id']
199
+ expect(task.app_id).to eq credentials[:app_id]
118
200
  end
119
201
 
120
202
  it 'configures the key' do
121
- expect(task.app_id).to eq credentials['key']
203
+ expect(task.key).to eq credentials[:key]
122
204
  end
123
205
 
124
206
  it 'configures the dsym file path' do
@@ -131,8 +213,11 @@ describe XCJobs::Distribute do
131
213
 
132
214
  it 'executes the appropriate commands' do
133
215
  subject.invoke
134
- expect(@url).to eq "https://api.crittercism.com/api_beta/dsym/#{credentials['app_id']}"
135
- expect(@form_data).to eq({ dsym: "@#{dsym_file}" })
216
+ expect(@url).to eq "https://api.crittercism.com/api_beta/dsym/#{credentials[:app_id]}"
217
+ expect(@form_data).to eq({
218
+ dsym: "@#{dsym_file}",
219
+ key: credentials[:key],
220
+ })
136
221
  end
137
222
  end
138
223
  end
@@ -143,7 +228,7 @@ describe XCJobs::Distribute do
143
228
  describe 'define upload ipa task' do
144
229
  let(:credentials) do
145
230
  { username: 'kishikawakatsumi',
146
- password:'password1234',
231
+ password: 'password1234',
147
232
  }
148
233
  end
149
234
 
@@ -155,18 +240,18 @@ describe XCJobs::Distribute do
155
240
 
156
241
  let!(:task) do
157
242
  XCJobs::Distribute::ITC.new do |t|
158
- t.username = credentials['username']
159
- t.password = credentials['password']
243
+ t.username = credentials[:username]
244
+ t.password = credentials[:password]
160
245
  t.file = file
161
246
  end
162
247
  end
163
248
 
164
249
  it 'configures the username' do
165
- expect(task.username).to eq credentials['username']
250
+ expect(task.username).to eq credentials[:username]
166
251
  end
167
252
 
168
253
  it 'configures the password' do
169
- expect(task.password).to eq credentials['password']
254
+ expect(task.password).to eq credentials[:password]
170
255
  end
171
256
 
172
257
  it 'configures the file path' do
@@ -179,7 +264,7 @@ describe XCJobs::Distribute do
179
264
 
180
265
  it 'executes the appropriate commands' do
181
266
  subject.invoke
182
- expect(@commands).to eq [%["#{altool}" --upload-app --file "#{file}" --username #{credentials['username']} --password #{credentials['password']}]]
267
+ expect(@commands).to eq [%["#{altool}" --upload-app --file "#{file}" --username #{credentials[:username]} --password #{credentials[:password]}]]
183
268
  end
184
269
  end
185
270
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcjobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - kishikawa katsumi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-17 00:00:00.000000000 Z
11
+ date: 2015-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -118,7 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
118
  version: '0'
119
119
  requirements: []
120
120
  rubyforge_project:
121
- rubygems_version: 2.2.2
121
+ rubygems_version: 2.4.5
122
122
  signing_key:
123
123
  specification_version: 4
124
124
  summary: Support the automation of release process of iOS/OSX apps with CI