onyphe 0.2.2 → 0.2.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
  SHA256:
3
- metadata.gz: d77aab933e1575b21cbec0ca03555a792a27b83cf0dfab5cc84e23f16c500d6c
4
- data.tar.gz: 18cd6a2511b5c5cb4c29c6f61c6304af4105c303f8bb453ff8a4e399d5c1a5eb
3
+ metadata.gz: 6c0c310743c68f3c1da0c267cc273e0ce541957da85d50d691b28872bb496783
4
+ data.tar.gz: fdad61c790b15127d29d32e0cfa5c1a0f6a0c6e68183029251f955a7619cfc56
5
5
  SHA512:
6
- metadata.gz: ece03ebb6273519218505c4c6a598ce9fc99d92341e2a46595835f95c41249772f40859bc7ebf179f4655db464cb47e91f0e72ae6e595a543e17794af9b220c2
7
- data.tar.gz: 12de2ffb3f55da4092c6a6d3d752f12dbaa537bbc134215121466124681656417ea127db913d6449a7491bbfcbcc5f02c6e680323f82bd2387a3e313f8f1a8ef
6
+ metadata.gz: 94e29972d127337203a38bea5dbc8d6beaed0db9acf7d7cb005161b4a86884239b4e8a667be3fc5c4c85e873cbd37c71152894b216137645741e3fde511043d9
7
+ data.tar.gz: ded4b90c9a5b3363c3f2d19c1a74ed6a1725bc9709bf73b6139e990b383bdc77f51f13f74896de298f2af9ad33f48566ed2240c52a9d61de229d9c5396052499
@@ -3,5 +3,5 @@ sudo: false
3
3
  language: ruby
4
4
  cache: bundler
5
5
  rvm:
6
- - 2.5.2
7
- before_install: gem install bundler -v 1.17.1
6
+ - 2.6
7
+ before_install: gem install bundler -v 2.0
@@ -36,11 +36,12 @@ module Onyphe
36
36
  def request(req)
37
37
  Net::HTTP.start(HOST, 443, https_options) do |http|
38
38
  http_response = http.request(req)
39
- if http_response.code == '200'
40
- yield JSON.parse(http_response.body, object_class: Response)
41
- else
42
- raise(Error, "unsupported response code returned: #{http_response.code}")
43
- end
39
+ raise(Error, "Unsupported response code returned: #{http_response.code}") unless http_response.code.start_with?("20")
40
+
41
+ response = JSON.parse(http_response.body, object_class: Response)
42
+ raise(Error, response.message) if response.error.to_i.positive?
43
+
44
+ yield response
44
45
  end
45
46
  end
46
47
 
@@ -8,21 +8,21 @@ module Onyphe
8
8
  def self.valid_ip?(ip)
9
9
  IPAddr.new ip
10
10
  true
11
- rescue IPAddr::InvalidAddressError => _
11
+ rescue IPAddr::InvalidAddressError => _e
12
12
  false
13
13
  end
14
14
 
15
15
  def self.valid_domain?(domain)
16
16
  uri = URI("https://#{domain}")
17
17
  uri.hostname == domain && domain.include?(".") && !valid_ip?(domain)
18
- rescue ArgumentError => _
18
+ rescue ArgumentError => _e
19
19
  false
20
20
  end
21
21
 
22
22
  def self.valid_onion_domain?(domain)
23
23
  uri = URI("https://#{domain}")
24
24
  uri.hostname == domain && domain.end_with?(".onion")
25
- rescue ArgumentError => _
25
+ rescue ArgumentError => _e
26
26
  false
27
27
  end
28
28
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Onyphe
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
@@ -24,14 +24,13 @@ Gem::Specification.new do |spec|
24
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
25
  spec.require_paths = ["lib"]
26
26
 
27
- spec.add_dependency "addressable", "~> 2.6"
28
- spec.add_dependency "thor", "~> 0.19"
27
+ spec.add_dependency "addressable", "~> 2.7"
28
+ spec.add_dependency "thor", "~> 0.20"
29
29
 
30
- spec.add_development_dependency "bundler", "~> 1.17"
30
+ spec.add_development_dependency "bundler", "~> 2.0"
31
31
  spec.add_development_dependency "coveralls", "~> 0.8"
32
- spec.add_development_dependency "dotenv", "~> 2.5"
33
- spec.add_development_dependency "rake", "~> 10.0"
34
- spec.add_development_dependency "rspec", "~> 3.0"
35
- spec.add_development_dependency "vcr", "~> 4.0"
36
- spec.add_development_dependency "webmock", "~> 3.5"
32
+ spec.add_development_dependency "rake", "~> 12.3"
33
+ spec.add_development_dependency "rspec", "~> 3.8"
34
+ spec.add_development_dependency "vcr", "~> 5.0"
35
+ spec.add_development_dependency "webmock", "~> 3.7"
37
36
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: onyphe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Manabu Niseki
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-07 00:00:00.000000000 Z
11
+ date: 2019-09-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -16,42 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.6'
19
+ version: '2.7'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.6'
26
+ version: '2.7'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.19'
33
+ version: '0.20'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.19'
40
+ version: '0.20'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.17'
47
+ version: '2.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.17'
54
+ version: '2.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: coveralls
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,76 +66,62 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0.8'
69
- - !ruby/object:Gem::Dependency
70
- name: dotenv
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '2.5'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '2.5'
83
69
  - !ruby/object:Gem::Dependency
84
70
  name: rake
85
71
  requirement: !ruby/object:Gem::Requirement
86
72
  requirements:
87
73
  - - "~>"
88
74
  - !ruby/object:Gem::Version
89
- version: '10.0'
75
+ version: '12.3'
90
76
  type: :development
91
77
  prerelease: false
92
78
  version_requirements: !ruby/object:Gem::Requirement
93
79
  requirements:
94
80
  - - "~>"
95
81
  - !ruby/object:Gem::Version
96
- version: '10.0'
82
+ version: '12.3'
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: rspec
99
85
  requirement: !ruby/object:Gem::Requirement
100
86
  requirements:
101
87
  - - "~>"
102
88
  - !ruby/object:Gem::Version
103
- version: '3.0'
89
+ version: '3.8'
104
90
  type: :development
105
91
  prerelease: false
106
92
  version_requirements: !ruby/object:Gem::Requirement
107
93
  requirements:
108
94
  - - "~>"
109
95
  - !ruby/object:Gem::Version
110
- version: '3.0'
96
+ version: '3.8'
111
97
  - !ruby/object:Gem::Dependency
112
98
  name: vcr
113
99
  requirement: !ruby/object:Gem::Requirement
114
100
  requirements:
115
101
  - - "~>"
116
102
  - !ruby/object:Gem::Version
117
- version: '4.0'
103
+ version: '5.0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
107
  requirements:
122
108
  - - "~>"
123
109
  - !ruby/object:Gem::Version
124
- version: '4.0'
110
+ version: '5.0'
125
111
  - !ruby/object:Gem::Dependency
126
112
  name: webmock
127
113
  requirement: !ruby/object:Gem::Requirement
128
114
  requirements:
129
115
  - - "~>"
130
116
  - !ruby/object:Gem::Version
131
- version: '3.5'
117
+ version: '3.7'
132
118
  type: :development
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
122
  - - "~>"
137
123
  - !ruby/object:Gem::Version
138
- version: '3.5'
124
+ version: '3.7'
139
125
  description: ONYPHE API wrapper for Ruby
140
126
  email:
141
127
  - manabu.niseki@gmail.com
@@ -196,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
196
182
  - !ruby/object:Gem::Version
197
183
  version: '0'
198
184
  requirements: []
199
- rubygems_version: 3.0.2
185
+ rubygems_version: 3.0.4
200
186
  signing_key:
201
187
  specification_version: 4
202
188
  summary: ONYPHE API wrapper for Ruby