codes 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -13
- data/bin/codes +2 -1
- data/lib/codes/itunes_connect.rb +4 -3
- data/lib/codes/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 344a3981e1ce1283a03aff8765eee7bdd693d9c9
|
4
|
+
data.tar.gz: e2a579552a9263931bffecd487d84c20306a8c81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b6877cc4bd78af8094c5e72c66f299c711e275f6f0e6fb476d1d2c7c81d660dcbe749374a4b824261a1a0a4359c00e7d122893e339252d4e4157fef3c66dd29
|
7
|
+
data.tar.gz: fd65d6ff3df01fc1db381c417b1554605bda178c96be77025470131f02875dc3fc94630108e6895a9e46ff2f9fd0fba32817c5ebb2f55f8db501308a7b45800b
|
data/README.md
CHANGED
@@ -16,7 +16,8 @@
|
|
16
16
|
<b>codes</b> •
|
17
17
|
<a href="https://github.com/fastlane/spaceship">spaceship</a> •
|
18
18
|
<a href="https://github.com/fastlane/pilot">pilot</a> •
|
19
|
-
<a href="https://github.com/fastlane/boarding">boarding</a>
|
19
|
+
<a href="https://github.com/fastlane/boarding">boarding</a> •
|
20
|
+
<a href="https://github.com/fastlane/gym">gym</a>
|
20
21
|
</p>
|
21
22
|
-------
|
22
23
|
|
@@ -114,7 +115,8 @@ In case you prefer environment variables:
|
|
114
115
|
- [`cert`](https://github.com/KrauseFx/cert): Create new iOS signing certificates
|
115
116
|
- [`spaceship`](https://github.com/fastlane/spaceship): Ruby library to access the Apple Dev Center and iTunes Connect
|
116
117
|
- [`pilot`](https://github.com/fastlane/pilot): The best way to manage your TestFlight testers and builds from your terminal
|
117
|
-
- [`boarding`](https://github.com/fastlane/boarding): The easiest way to invite your TestFlight beta testers
|
118
|
+
- [`boarding`](https://github.com/fastlane/boarding): The easiest way to invite your TestFlight beta testers
|
119
|
+
- [`gym`](https://github.com/fastlane/gym): Building your iOS apps has never been easier
|
118
120
|
|
119
121
|
##### [Like this tool? Be the first to know about updates and new fastlane tools](https://tinyletter.com/krausefx)
|
120
122
|
|
@@ -122,19 +124,9 @@ In case you prefer environment variables:
|
|
122
124
|
As part of the process of downloading promo codes from iTunes Connect, the user would normally have to accept a contract every single time. Since there is no way to check with iTunes if this contract was accepted manually before, `codes` agrees to this contract automatically. Before using `codes` for the first time, we advise you to go to iTunes Connect and go through the process of creating promo codes manually at least once and to read the contract when it comes up.
|
123
125
|
|
124
126
|
# Need help?
|
125
|
-
|
126
|
-
- I'm available for contract work - drop me an email: codes@krausefx.com
|
127
|
+
Please submit an issue on GitHub and provide information about your setup
|
127
128
|
|
128
129
|
# License
|
129
130
|
This project is licensed under the terms of the MIT license. See the LICENSE file.
|
130
131
|
|
131
132
|
> This project and all fastlane tools are in no way affiliated with Apple Inc. This project is open source under the MIT license, which means you have full access to the source code and can modify it to fit your own needs. All fastlane tools run on your own computer or server, so your credentials or other sensitive information will never leave your own computer. You are responsible for how you use fastlane tools.
|
132
|
-
|
133
|
-
# Contributing
|
134
|
-
|
135
|
-
1. Create an issue to discuss about your idea
|
136
|
-
2. Fork it (https://github.com/KrauseFx/codes/fork)
|
137
|
-
3. Create your feature branch (`git checkout -b my-new-feature`)
|
138
|
-
4. Commit your changes (`git commit -am 'Add some feature'`)
|
139
|
-
5. Push to the branch (`git push origin my-new-feature`)
|
140
|
-
6. Create a new Pull Request
|
data/bin/codes
CHANGED
@@ -23,6 +23,7 @@ class CodesApplication
|
|
23
23
|
always_trace!
|
24
24
|
|
25
25
|
global_option '-u', '--username STRING', 'Your iTunes Connect username'
|
26
|
+
global_option '-c', '--country STRING', 'The country the app can be found in'
|
26
27
|
global_option '-a', '--app_identifier STRING', 'The bundle ID to download promo codes for'
|
27
28
|
global_option '-i', '--apple_id STRING', 'The App ID to download promo codes for'
|
28
29
|
global_option '-o', '--output_file STRING', 'The name of the file that should be written to disk. If the file exists, the new codes will be appended.'
|
@@ -40,7 +41,7 @@ class CodesApplication
|
|
40
41
|
app_identifier = bundle_id(options, apple_id)
|
41
42
|
urls = options.x || options.urls
|
42
43
|
|
43
|
-
Codes::CodesRunner.run(number_of_codes: number_of_codes, app_identifier: app_identifier, apple_id: apple_id, output_file_path: options.output_file, urls: urls)
|
44
|
+
Codes::CodesRunner.run(number_of_codes: number_of_codes, app_identifier: app_identifier, apple_id: apple_id, output_file_path: options.output_file, urls: urls, country: options.country)
|
44
45
|
end
|
45
46
|
end
|
46
47
|
|
data/lib/codes/itunes_connect.rb
CHANGED
@@ -8,13 +8,14 @@ module Codes
|
|
8
8
|
|
9
9
|
def run(args)
|
10
10
|
number_of_codes = args[:number_of_codes]
|
11
|
+
country = args[:country]
|
11
12
|
|
12
13
|
code_or_codes = number_of_codes == 1 ? "code" : "codes"
|
13
14
|
Helper.log.info "Downloading #{number_of_codes} promo #{code_or_codes}..."
|
14
15
|
|
15
16
|
|
16
17
|
app_id = args[:apple_id]
|
17
|
-
app_id ||= (FastlaneCore::ItunesSearchApi.fetch_by_identifier(args[:app_identifier])['trackId'] rescue nil)
|
18
|
+
app_id ||= (FastlaneCore::ItunesSearchApi.fetch_by_identifier(args[:app_identifier], country)['trackId'] rescue nil)
|
18
19
|
|
19
20
|
app_identifier = args[:app_identifier]
|
20
21
|
|
@@ -22,7 +23,7 @@ module Codes
|
|
22
23
|
raise "Could not find app using the following information: #{args}. Maybe the app is not in the store. Pass the Apple ID of the app as well!".red
|
23
24
|
end
|
24
25
|
|
25
|
-
app = FastlaneCore::ItunesSearchApi.fetch(app_id)
|
26
|
+
app = FastlaneCore::ItunesSearchApi.fetch(app_id, country)
|
26
27
|
platform = (app['kind'] == "mac-software" ? "osx" : "ios")
|
27
28
|
|
28
29
|
# Use Pathname because it correctly handles the distinction between relative paths vs. absolute paths
|
@@ -45,7 +46,7 @@ module Codes
|
|
45
46
|
click_next
|
46
47
|
|
47
48
|
# the find(:xpath, "..") gets the parent element of the previous expression
|
48
|
-
download_url = wait_for_elements("
|
49
|
+
download_url = wait_for_elements("div[class='large-blue-rect-button']").first.find(:xpath, '..')['href']
|
49
50
|
|
50
51
|
codes = download_codes download_url
|
51
52
|
|
data/lib/codes/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
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-
|
11
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fastlane_core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.15.2
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.15.2
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
158
158
|
version: '0'
|
159
159
|
requirements: []
|
160
160
|
rubyforge_project:
|
161
|
-
rubygems_version: 2.4.
|
161
|
+
rubygems_version: 2.4.5
|
162
162
|
signing_key:
|
163
163
|
specification_version: 4
|
164
164
|
summary: Create promo codes for iOS Apps using the command line
|