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 +4 -4
- data/.travis.yml +2 -2
- data/lib/onyphe/client.rb +6 -5
- data/lib/onyphe/validator.rb +3 -3
- data/lib/onyphe/version.rb +1 -1
- data/onyphe.gemspec +7 -8
- metadata +17 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c0c310743c68f3c1da0c267cc273e0ce541957da85d50d691b28872bb496783
|
4
|
+
data.tar.gz: fdad61c790b15127d29d32e0cfa5c1a0f6a0c6e68183029251f955a7619cfc56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94e29972d127337203a38bea5dbc8d6beaed0db9acf7d7cb005161b4a86884239b4e8a667be3fc5c4c85e873cbd37c71152894b216137645741e3fde511043d9
|
7
|
+
data.tar.gz: ded4b90c9a5b3363c3f2d19c1a74ed6a1725bc9709bf73b6139e990b383bdc77f51f13f74896de298f2af9ad33f48566ed2240c52a9d61de229d9c5396052499
|
data/.travis.yml
CHANGED
data/lib/onyphe/client.rb
CHANGED
@@ -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
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
|
data/lib/onyphe/validator.rb
CHANGED
@@ -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
|
|
data/lib/onyphe/version.rb
CHANGED
data/onyphe.gemspec
CHANGED
@@ -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.
|
28
|
-
spec.add_dependency "thor", "~> 0.
|
27
|
+
spec.add_dependency "addressable", "~> 2.7"
|
28
|
+
spec.add_dependency "thor", "~> 0.20"
|
29
29
|
|
30
|
-
spec.add_development_dependency "bundler", "~>
|
30
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
31
31
|
spec.add_development_dependency "coveralls", "~> 0.8"
|
32
|
-
spec.add_development_dependency "
|
33
|
-
spec.add_development_dependency "
|
34
|
-
spec.add_development_dependency "
|
35
|
-
spec.add_development_dependency "
|
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.
|
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-
|
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.
|
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.
|
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.
|
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.
|
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: '
|
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: '
|
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: '
|
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: '
|
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.
|
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.
|
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: '
|
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: '
|
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.
|
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.
|
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.
|
185
|
+
rubygems_version: 3.0.4
|
200
186
|
signing_key:
|
201
187
|
specification_version: 4
|
202
188
|
summary: ONYPHE API wrapper for Ruby
|