fir-cli 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG +1 -1
- data/Gemfile +1 -1
- data/README.md +1 -3
- data/fir-cli.gemspec +3 -5
- data/lib/fir/patches/default_headers.rb +9 -0
- data/lib/fir/patches.rb +1 -0
- data/lib/fir/util/http.rb +20 -52
- data/lib/fir/util/publish.rb +10 -18
- data/lib/fir/version.rb +1 -1
- data/test/test_helper.rb +25 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 983c34c1ff6964b4cff980a06a83900468aa5d56
|
4
|
+
data.tar.gz: 16e5217fd7d08a5aed2dd4451a0e46d19cd9ab63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da2875e4eea8e5f5b9263462ef7ed27afbe81831fa2614b10a3ef244074e68d79ba65938a28f710a568275e5bc5354d377894d1bf9f74cc287df3861982309f6
|
7
|
+
data.tar.gz: f174fb83ee008253cdb62689c30ca5c0e566de20af1375b13aa41b40cc41dc993ccb45ac99e848120cc4c8cfd15e991b13c7709dc74087ed64d0ee879d80a12f
|
data/.travis.yml
CHANGED
data/CHANGELOG
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
✈ fir.im-cli
|
2
|
-
|
2
|
+
----
|
3
3
|
|
4
4
|
![Build Status Images](https://travis-ci.org/FIRHQ/fir-cli.svg)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/FIRHQ/fir-cli/badges/gpa.svg)](https://codeclimate.com/github/FIRHQ/fir-cli)
|
@@ -33,5 +33,3 @@ fir.im-cli 可以通过指令查看, 上传, 编译 iOS/Android 应用.
|
|
33
33
|
如果你觉得 fir-cli 对你有所帮助, 欢迎微信打赏支持作者:smile:
|
34
34
|
|
35
35
|
![](http://7rf35s.com1.z0.glb.clouddn.com/coffee.png)
|
36
|
-
|
37
|
-
|
data/fir-cli.gemspec
CHANGED
@@ -27,10 +27,8 @@ Gem::Specification.new do |spec|
|
|
27
27
|
/_/ /___/_/ |_| \____/_____/___/
|
28
28
|
|
29
29
|
## 更新记录
|
30
|
-
### fir-cli 1.5.
|
31
|
-
-
|
32
|
-
- 增加上传时候设置密码及公开访问权限
|
33
|
-
- 增加 build_ipa 中的 destination 参数
|
30
|
+
### fir-cli 1.5.1
|
31
|
+
- 修复了在 ruby 2.4.0 中登录出错的bug
|
34
32
|
- 详细更新记录, 请查看: https://github.com/FIRHQ/fir-cli/blob/master/CHANGELOG
|
35
33
|
- [fir-cli](https://github.com/FIRHQ/fir-cli) 已经开源
|
36
34
|
- 欢迎 fork, issue 和 pull request
|
@@ -43,7 +41,7 @@ Gem::Specification.new do |spec|
|
|
43
41
|
|
44
42
|
spec.add_dependency 'thor', '~> 0.19'
|
45
43
|
spec.add_dependency 'CFPropertyList', '~> 2.3'
|
46
|
-
spec.add_dependency 'rest-client', '~>
|
44
|
+
spec.add_dependency 'rest-client', '~> 2.0'
|
47
45
|
spec.add_dependency 'ruby_android', '~> 0.7'
|
48
46
|
spec.add_dependency 'rqrcode', '~> 0.7'
|
49
47
|
end
|
data/lib/fir/patches.rb
CHANGED
data/lib/fir/util/http.rb
CHANGED
@@ -2,61 +2,29 @@
|
|
2
2
|
|
3
3
|
module FIR
|
4
4
|
module Http
|
5
|
-
|
5
|
+
MAX_RETRIES = 5
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
JSON.parse(res.body.force_encoding('UTF-8'), symbolize_names: true)
|
28
|
-
end
|
29
|
-
|
30
|
-
%w(post patch put).each do |method|
|
31
|
-
define_method method do |url, query|
|
32
|
-
tries = 5
|
33
|
-
begin
|
34
|
-
res = ::RestClient::Request.execute(
|
35
|
-
method: method.to_sym,
|
36
|
-
url: url,
|
37
|
-
payload: query,
|
38
|
-
timeout: DEFAULT_TIMEOUT,
|
39
|
-
headers: default_headers
|
40
|
-
)
|
41
|
-
rescue => e
|
42
|
-
logger.error e.message.to_s
|
43
|
-
if tries > 0
|
44
|
-
logger.info "Retry in #{tries} times......"
|
45
|
-
tries -= 1
|
46
|
-
retry
|
47
|
-
else
|
48
|
-
exit 1
|
7
|
+
%w(get post patch put).each do |_m|
|
8
|
+
class_eval <<-METHOD, __FILE__, __LINE__ + 1
|
9
|
+
def #{_m}(url, params = {})
|
10
|
+
query = :#{_m} == :get ? { params: params } : params
|
11
|
+
begin
|
12
|
+
res = ::RestClient.#{_m}(url, query)
|
13
|
+
rescue => e
|
14
|
+
@retries ||= 0
|
15
|
+
logger.error(e.message.to_s)
|
16
|
+
if @retries < MAX_RETRIES
|
17
|
+
@retries += 1
|
18
|
+
logger.info("Retry \#{@retries} times......")
|
19
|
+
sleep 2
|
20
|
+
retry
|
21
|
+
else
|
22
|
+
exit 1
|
23
|
+
end
|
49
24
|
end
|
25
|
+
JSON.parse(res.body.force_encoding('UTF-8'), symbolize_names: true)
|
50
26
|
end
|
51
|
-
|
52
|
-
JSON.parse(res.body.force_encoding('UTF-8'), symbolize_names: true)
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
private
|
57
|
-
|
58
|
-
def default_headers
|
59
|
-
{ content_type: :json, source: 'fir-cli', version: FIR::VERSION }
|
27
|
+
METHOD
|
60
28
|
end
|
61
29
|
end
|
62
30
|
end
|
data/lib/fir/util/publish.rb
CHANGED
@@ -43,15 +43,18 @@ module FIR
|
|
43
43
|
fetch_app_info
|
44
44
|
end
|
45
45
|
|
46
|
-
|
47
|
-
|
46
|
+
%w(icon binary).each do |postfix|
|
47
|
+
class_eval <<-METHOD, __FILE__, __LINE__ + 1
|
48
|
+
def upload_app_#{postfix}
|
49
|
+
logger.info "Uploading app #{postfix}......"
|
50
|
+
uploaded_info = post(@#{postfix}_cert[:upload_url], uploading_#{postfix}_info)
|
48
51
|
|
49
|
-
|
52
|
+
return if uploaded_info[:is_completed]
|
50
53
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
54
|
+
logger.error "Uploading app #{postfix} failed"
|
55
|
+
exit 1
|
56
|
+
end
|
57
|
+
METHOD
|
55
58
|
end
|
56
59
|
|
57
60
|
def uploading_icon_info
|
@@ -66,17 +69,6 @@ module FIR
|
|
66
69
|
}
|
67
70
|
end
|
68
71
|
|
69
|
-
def upload_app_binary
|
70
|
-
logger.info 'Uploading app binary......'
|
71
|
-
|
72
|
-
uploaded_info = post(@binary_cert[:upload_url], uploading_binary_info)
|
73
|
-
|
74
|
-
return if uploaded_info[:is_completed]
|
75
|
-
|
76
|
-
logger.error 'Upload app binary failed'
|
77
|
-
exit 1
|
78
|
-
end
|
79
|
-
|
80
72
|
def uploading_binary_info
|
81
73
|
{
|
82
74
|
key: @binary_cert[:key],
|
data/lib/fir/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
|
3
|
+
# CodeClimate::TestReporter.start
|
3
4
|
require 'codeclimate-test-reporter'
|
4
|
-
|
5
|
+
require 'simplecov'
|
6
|
+
SimpleCov.start
|
7
|
+
|
5
8
|
|
6
9
|
require 'minitest/autorun'
|
7
10
|
require 'ostruct'
|
@@ -71,4 +74,25 @@ class Minitest::Test
|
|
71
74
|
def default_distribution_name
|
72
75
|
'iOSTeam Provisioning Profile: im.fir.* - Fly It Remotely LLC.'
|
73
76
|
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
|
81
|
+
# 跑完测试之后再发结果到Codelimate
|
82
|
+
# 测试CODECLIMATE_REPO_TOKEN: c454b9a54151b3ed3e18949279aec49d6a25bf507706815f99a919f1c01679ed
|
83
|
+
Minitest.after_run do
|
84
|
+
COVERAGE_FILE = "coverage/.resultset.json".freeze
|
85
|
+
if (repo_token = ENV["CODECLIMATE_REPO_TOKEN"]) && !repo_token.empty?
|
86
|
+
if File.exist?(COVERAGE_FILE)
|
87
|
+
begin
|
88
|
+
results = JSON.parse(File.read(COVERAGE_FILE))
|
89
|
+
rescue JSON::ParserError => e
|
90
|
+
$stderr.puts "Error encountered while parsing #{COVERAGE_FILE}: #{e}"
|
91
|
+
end
|
92
|
+
|
93
|
+
CodeClimate::TestReporter.run(results)
|
94
|
+
else
|
95
|
+
$stderr.puts "Coverage results not found"
|
96
|
+
end
|
97
|
+
end
|
74
98
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fir-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NaixSpirit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '2.0'
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '2.0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: ruby_android
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -174,6 +174,7 @@ files:
|
|
174
174
|
- lib/fir/patches.rb
|
175
175
|
- lib/fir/patches/blank.rb
|
176
176
|
- lib/fir/patches/concern.rb
|
177
|
+
- lib/fir/patches/default_headers.rb
|
177
178
|
- lib/fir/patches/hash.rb
|
178
179
|
- lib/fir/patches/instance_variables.rb
|
179
180
|
- lib/fir/patches/native_patch.rb
|
@@ -215,10 +216,9 @@ metadata: {}
|
|
215
216
|
post_install_message: "\n ______________ ________ ____\n /
|
216
217
|
____/ _/ __ \\ / ____/ / / _/\n / /_ / // /_/ /_____/ / / / /
|
217
218
|
/\n / __/ _/ // _, _/_____/ /___/ /____/ /\n /_/ /___/_/ |_| \\____/_____/___/\n\n
|
218
|
-
\ ## 更新记录\n ### fir-cli 1.5.
|
219
|
-
|
220
|
-
|
221
|
-
request\n "
|
219
|
+
\ ## 更新记录\n ### fir-cli 1.5.1\n - 修复了在 ruby 2.4.0 中登录出错的bug\n - 详细更新记录, 请查看:
|
220
|
+
https://github.com/FIRHQ/fir-cli/blob/master/CHANGELOG\n - [fir-cli](https://github.com/FIRHQ/fir-cli)
|
221
|
+
已经开源\n - 欢迎 fork, issue 和 pull request\n "
|
222
222
|
rdoc_options: []
|
223
223
|
require_paths:
|
224
224
|
- lib
|
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
234
|
version: '0'
|
235
235
|
requirements: []
|
236
236
|
rubyforge_project:
|
237
|
-
rubygems_version: 2.
|
237
|
+
rubygems_version: 2.6.10
|
238
238
|
signing_key:
|
239
239
|
specification_version: 4
|
240
240
|
summary: fir.im command tool
|