balloon 1.0.1 → 1.0.2
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 +4 -4
- data/balloon.gemspec +37 -30
- data/lib/balloon/download.rb +8 -8
- data/lib/balloon/version.rb +1 -1
- metadata +10 -19
- data/spec/fixtures/UPCASE.JPG +0 -0
- data/spec/fixtures/egg +0 -0
- data/spec/fixtures/invalid.jpg +0 -1
- data/spec/fixtures/kid.gif +0 -0
- data/spec/fixtures/kids.gif +0 -0
- data/spec/fixtures/word.txt +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 45b480476e4a3b0960af2ee96c45574e058f7169fa2edfd18d0f1d3972122d91
|
|
4
|
+
data.tar.gz: d5f3cd96658c766738257b9c69101643059412bb01dcf45c518b24871192ad17
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 694689019e188d7994f986121d7ee2c6e87ab4102675d809235150eb2382e0b81501855d25c04018c00c10a71b73ed5d284ee786dbb98c4bbdac0b652ac54868
|
|
7
|
+
data.tar.gz: d01efb4244b3003e0255d68d45a9c11ddca489aedf86b35e4cabd3032257baad2973318f48a4a018683de14dd7432f502232ce52d38ae9cb5fa0ed5d642cf10a
|
data/balloon.gemspec
CHANGED
|
@@ -2,34 +2,41 @@
|
|
|
2
2
|
$:.push File.expand_path("../lib", __FILE__)
|
|
3
3
|
require "balloon/version"
|
|
4
4
|
|
|
5
|
-
Gem::Specification.new do |
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = "balloon"
|
|
7
|
+
spec.version = Balloon::VERSION
|
|
8
|
+
spec.authors = ["yeeli"]
|
|
9
|
+
spec.email = ["yeeli@outlook.com"]
|
|
10
|
+
|
|
11
|
+
spec.homepage = "https://github.com/yeeli/balloon"
|
|
12
|
+
spec.summary = %q{Ruby image upload libary}
|
|
13
|
+
spec.description = %q{Ruby image upload libary}
|
|
14
|
+
|
|
15
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
|
16
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
|
17
|
+
spec.metadata["changelog_uri"] = spec.homepage
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
|
21
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
22
|
+
end
|
|
23
|
+
spec.bindir = "exe"
|
|
24
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
25
|
+
spec.require_paths = ["lib"]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
spec.add_dependency "activesupport"
|
|
29
|
+
spec.add_dependency "mini_magick"
|
|
30
|
+
spec.add_dependency "faraday"
|
|
31
|
+
spec.add_dependency "mime-types"
|
|
32
|
+
|
|
33
|
+
# Development dependency
|
|
34
|
+
|
|
35
|
+
spec.add_development_dependency "rails"
|
|
36
|
+
spec.add_development_dependency "rspec"
|
|
37
|
+
spec.add_development_dependency "mysql2"
|
|
38
|
+
spec.add_development_dependency "mongo_mapper"
|
|
39
|
+
spec.add_development_dependency "mongoid"
|
|
40
|
+
spec.add_development_dependency "bson_ext"
|
|
41
|
+
spec.add_development_dependency "activerecord"
|
|
35
42
|
end
|
data/lib/balloon/download.rb
CHANGED
|
@@ -6,23 +6,23 @@ module Balloon
|
|
|
6
6
|
extend ActiveSupport::Concern
|
|
7
7
|
|
|
8
8
|
def down_url(uri)
|
|
9
|
-
connection = ::Faraday.new
|
|
9
|
+
connection = ::Faraday.new
|
|
10
10
|
response = connection.get(uri)
|
|
11
11
|
generate_down_cache_directory
|
|
12
12
|
path = File.join down_cache_path, generate_down_id
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
if response.status != 200
|
|
15
15
|
raise Balloon::DownloadError, I18n.translate(:"errors.messages.response_error")
|
|
16
16
|
end
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
if content_type = MIME::Types[response.headers["content-type"]][0]
|
|
19
19
|
mime_type = content_type.content_type
|
|
20
20
|
if self.respond_to?(:uploader_mimetype_white)
|
|
21
|
-
if !uploader_mimetype_white.include?(mime_type)
|
|
21
|
+
if !uploader_mimetype_white.include?(mime_type)
|
|
22
22
|
raise Balloon::DownloadError, I18n.translate(:"errors.messages.down_mime_error")
|
|
23
23
|
end
|
|
24
24
|
elsif self.respond_to?(:uploader_mimetype_black)
|
|
25
|
-
if !uploader_mimetype_black.include?(mime_type)
|
|
25
|
+
if !uploader_mimetype_black.include?(mime_type)
|
|
26
26
|
raise Balloon::DownloadError, I18n.translate(:"errors.messages.down_mime_error")
|
|
27
27
|
end
|
|
28
28
|
end
|
|
@@ -31,11 +31,11 @@ module Balloon
|
|
|
31
31
|
File.open(path, "wb") do |f|
|
|
32
32
|
f.write(response.body)
|
|
33
33
|
end
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
return path
|
|
36
|
-
rescue Faraday::
|
|
36
|
+
rescue Faraday::ConnectionFailed => e
|
|
37
37
|
raise Balloon::DownloadError, I18n.translate(:"errors.messages.connection_failed")
|
|
38
|
-
rescue Faraday::
|
|
38
|
+
rescue Faraday::TimeoutError => e
|
|
39
39
|
raise Ballloon::DownloadError, I18n.translate(:"errors.messages.timeout_error")
|
|
40
40
|
end
|
|
41
41
|
|
data/lib/balloon/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: balloon
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- yeeli
|
|
8
8
|
autorequire:
|
|
9
|
-
bindir:
|
|
9
|
+
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2020-06-26 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activesupport
|
|
@@ -199,15 +199,12 @@ files:
|
|
|
199
199
|
- lib/balloon/version.rb
|
|
200
200
|
- lib/rails/generators/balloon/config/config_generator.rb
|
|
201
201
|
- lib/rails/generators/balloon/config/templates/balloon.yml
|
|
202
|
-
|
|
203
|
-
- spec/fixtures/egg
|
|
204
|
-
- spec/fixtures/invalid.jpg
|
|
205
|
-
- spec/fixtures/kid.gif
|
|
206
|
-
- spec/fixtures/kids.gif
|
|
207
|
-
- spec/fixtures/word.txt
|
|
208
|
-
homepage: ''
|
|
202
|
+
homepage: https://github.com/yeeli/balloon
|
|
209
203
|
licenses: []
|
|
210
|
-
metadata:
|
|
204
|
+
metadata:
|
|
205
|
+
homepage_uri: https://github.com/yeeli/balloon
|
|
206
|
+
source_code_uri: https://github.com/yeeli/balloon
|
|
207
|
+
changelog_uri: https://github.com/yeeli/balloon
|
|
211
208
|
post_install_message:
|
|
212
209
|
rdoc_options: []
|
|
213
210
|
require_paths:
|
|
@@ -223,14 +220,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
223
220
|
- !ruby/object:Gem::Version
|
|
224
221
|
version: '0'
|
|
225
222
|
requirements: []
|
|
226
|
-
rubygems_version: 3.
|
|
223
|
+
rubygems_version: 3.1.3
|
|
227
224
|
signing_key:
|
|
228
225
|
specification_version: 4
|
|
229
226
|
summary: Ruby image upload libary
|
|
230
|
-
test_files:
|
|
231
|
-
- spec/fixtures/UPCASE.JPG
|
|
232
|
-
- spec/fixtures/egg
|
|
233
|
-
- spec/fixtures/invalid.jpg
|
|
234
|
-
- spec/fixtures/kid.gif
|
|
235
|
-
- spec/fixtures/kids.gif
|
|
236
|
-
- spec/fixtures/word.txt
|
|
227
|
+
test_files: []
|
data/spec/fixtures/UPCASE.JPG
DELETED
|
Binary file
|
data/spec/fixtures/egg
DELETED
|
Binary file
|
data/spec/fixtures/invalid.jpg
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
this is stuff
|
data/spec/fixtures/kid.gif
DELETED
|
Binary file
|
data/spec/fixtures/kids.gif
DELETED
|
Binary file
|
data/spec/fixtures/word.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
test html
|