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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +1 -0
- data/lib/blast_off/services/qiniu.rb +11 -7
- data/lib/blast_off/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: feae66a594b3e6f3eb76901e643710dbdd5b4416
|
4
|
+
data.tar.gz: bfa3be21c8a40e7547008cc3c5f170e79f99741c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08259f43dcc167f72abe9b1a8ed39dfbec29fa473bbd7666f8a536f26d8526da9d3e64bcee254e13ad7ef216a10d2ec7a7ae0de1ea223408a857137e19e77362
|
7
|
+
data.tar.gz: cb8876dd26b18931c16942ae8c73d8cf4ed512a2c6a1fd021d4d9ec65152a33218e0348c096161d706095f77786dbd38d31355ea0fea81928ad13e0b00719d0d
|
data/CHANGELOG.md
CHANGED
@@ -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
@@ -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,
|
53
|
-
file = Tempfile.new(
|
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,
|
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,
|
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:
|
70
|
+
uptoken: upload_token,
|
67
71
|
file: filepath,
|
68
72
|
mime_type: mime_type,
|
69
73
|
bucket: @bucket,
|
70
|
-
key:
|
74
|
+
key: key
|
71
75
|
)
|
72
76
|
end
|
73
77
|
|
data/lib/blast_off/version.rb
CHANGED
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.
|
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-
|
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.
|
186
|
+
rubygems_version: 2.0.14
|
187
187
|
signing_key:
|
188
188
|
specification_version: 4
|
189
189
|
summary: An iOS beta distribution tool.
|