embulk-filter-azure_computer_vision_api 0.1.2 → 0.1.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37a37816972d18dd3c2885350665c052432778de
|
4
|
+
data.tar.gz: 93c04d5fc28af36e05d3e7a5d6ff81fabec7a9b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a77561035fb4b020bafd2a936b8a00a06d9fb273d6d95afce78e33ac32f0f3ad8bff8725ce30b4e2277401b61755dcd7b92041c3fe49bbd1f5de69da12c8fde6
|
7
|
+
data.tar.gz: 022b8a0d65891e7f95978a04ff23b5c3a7968ddb7cfa3351d55d4364b3040b0053f6be6ef5075625d0663f6b5305cb862b6458bfbffda4a97b4194d3051efe22
|
@@ -1,7 +1,7 @@
|
|
1
1
|
|
2
2
|
Gem::Specification.new do |spec|
|
3
3
|
spec.name = "embulk-filter-azure_computer_vision_api"
|
4
|
-
spec.version = "0.1.
|
4
|
+
spec.version = "0.1.3"
|
5
5
|
spec.authors = ["toyama0919"]
|
6
6
|
spec.summary = "Azure Computer Vision Api filter plugin for Embulk"
|
7
7
|
spec.description = "Azure Computer Vision Api"
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.test_files = spec.files.grep(%r{^(test|spec)/})
|
14
14
|
spec.require_paths = ["lib"]
|
15
15
|
|
16
|
-
spec.add_dependency '
|
16
|
+
spec.add_dependency 'addressable'
|
17
17
|
spec.add_development_dependency 'embulk', ['>= 0.8.16']
|
18
18
|
spec.add_development_dependency 'bundler', ['>= 1.10.6']
|
19
19
|
spec.add_development_dependency 'rake', ['>= 10.0']
|
@@ -1,8 +1,7 @@
|
|
1
1
|
require "json"
|
2
2
|
require "net/http"
|
3
|
-
require "uri"
|
4
3
|
require "pp"
|
5
|
-
require
|
4
|
+
require 'addressable/uri'
|
6
5
|
|
7
6
|
module Embulk
|
8
7
|
module Filter
|
@@ -22,7 +21,6 @@ module Embulk
|
|
22
21
|
@http = Net::HTTP.new(uri.host, uri.port)
|
23
22
|
@http.read_timeout = read_timeout
|
24
23
|
@http.use_ssl = true
|
25
|
-
@http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
26
24
|
@retry_wait = retry_wait
|
27
25
|
end
|
28
26
|
|
@@ -58,12 +56,14 @@ module Embulk
|
|
58
56
|
private
|
59
57
|
def get_content_type_and_body(image_path)
|
60
58
|
if image_path =~ /https?\:\/\//
|
61
|
-
|
62
|
-
return 'application/octet-stream',
|
59
|
+
response = Net::HTTP.get_response(Addressable::URI.parse(image_path))
|
60
|
+
return 'application/octet-stream', response.body
|
63
61
|
else
|
64
|
-
content = File.read(image_path)
|
62
|
+
content = File.read(image_path)
|
65
63
|
return 'application/octet-stream', content
|
66
64
|
end
|
65
|
+
rescue
|
66
|
+
''
|
67
67
|
end
|
68
68
|
end
|
69
69
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-filter-azure_computer_vision_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toyama0919
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
- - ">="
|
17
17
|
- !ruby/object:Gem::Version
|
18
18
|
version: '0'
|
19
|
-
name:
|
19
|
+
name: addressable
|
20
20
|
prerelease: false
|
21
21
|
type: :runtime
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|