blast_off 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5a6e9251f16129eb15def3ec26795df792984bec
4
- data.tar.gz: 188ebf9f63c74820302fdfeed8aa6ee678ea559f
3
+ metadata.gz: feae66a594b3e6f3eb76901e643710dbdd5b4416
4
+ data.tar.gz: bfa3be21c8a40e7547008cc3c5f170e79f99741c
5
5
  SHA512:
6
- metadata.gz: 063fef30610b2bb1ec3002a57cd122a3a3da1fd3c75bd81669c5e3a4558642ab90c05f7da5120d4855a37aef7043f37b80d7e11a1259dfc2fb979817eb3b4772
7
- data.tar.gz: 1f58707ce398a963e7d41217a0ff24b66f0d9a200d0d88d0e664d9cfd155e1456c24682bf3787cb5c7081a3c06f13d6e6e2293c10031bad09b0117f363500efa
6
+ metadata.gz: 08259f43dcc167f72abe9b1a8ed39dfbec29fa473bbd7666f8a536f26d8526da9d3e64bcee254e13ad7ef216a10d2ec7a7ae0de1ea223408a857137e19e77362
7
+ data.tar.gz: cb8876dd26b18931c16942ae8c73d8cf4ed512a2c6a1fd021d4d9ec65152a33218e0348c096161d706095f77786dbd38d31355ea0fea81928ad13e0b00719d0d
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## [v0.4.0](https://github.com/linjunpop/blast_off/tree/v0.4.0)
6
+
7
+ * Generate upload token based on bucket and key.
8
+ * Set `block_size` larger than IPA file size, prevent Qiniu SDK to split files.
9
+
5
10
  ## [v0.3.0](https://github.com/linjunpop/blast_off/tree/v0.3.0)
6
11
 
7
12
  * Set correct file mime-types.
data/README.md CHANGED
@@ -72,6 +72,7 @@ Example:
72
72
  ## Similar projects:
73
73
 
74
74
  * https://github.com/lexrus/ios-makefile
75
+ * https://github.com/qdvictory/EasyToMore
75
76
 
76
77
  ## Contributing
77
78
 
@@ -13,10 +13,10 @@ module BlastOff
13
13
 
14
14
  ::Qiniu::RS.establish_connection!(
15
15
  enable_debug: false,
16
+ block_size: File.size(@ipa_file_path) + 100,
16
17
  access_key: access_key,
17
18
  secret_key: secret_key
18
19
  )
19
- @upload_token = ::Qiniu::RS.generate_upload_token(scope: @bucket)
20
20
  end
21
21
 
22
22
  def distribute
@@ -49,25 +49,29 @@ module BlastOff
49
49
  "http://#{@bucket}.qiniudn.com/#{base_path}"
50
50
  end
51
51
 
52
- def upload_string(string, key, mime_type)
53
- file = Tempfile.new(key)
52
+ def upload_string(string, name, mime_type)
53
+ file = Tempfile.new(name)
54
54
  begin
55
55
  file.write(string)
56
56
  file.rewind
57
- upload_file(file.path, key, mime_type)
57
+ upload_file(file.path, name, mime_type)
58
58
  ensure
59
59
  file.close
60
60
  file.unlink
61
61
  end
62
62
  end
63
63
 
64
- def upload_file(filepath, key, mime_type)
64
+ def upload_file(filepath, name, mime_type)
65
+ key = "#{base_path}/#{name}"
66
+ upload_token = ::Qiniu::RS.generate_upload_token(
67
+ scope: "#{@bucket}:#{key}"
68
+ )
65
69
  ::Qiniu::RS.upload_file(
66
- uptoken: @upload_token,
70
+ uptoken: upload_token,
67
71
  file: filepath,
68
72
  mime_type: mime_type,
69
73
  bucket: @bucket,
70
- key: "#{base_path}/#{key}"
74
+ key: key
71
75
  )
72
76
  end
73
77
 
@@ -1,3 +1,3 @@
1
1
  module BlastOff
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blast_off
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jun Lin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-15 00:00:00.000000000 Z
11
+ date: 2013-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -183,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
183
183
  version: '0'
184
184
  requirements: []
185
185
  rubyforge_project:
186
- rubygems_version: 2.1.10
186
+ rubygems_version: 2.0.14
187
187
  signing_key:
188
188
  specification_version: 4
189
189
  summary: An iOS beta distribution tool.