blockscore 4.0.0 → 4.1.0

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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +58 -0
  3. data/.hound.yml +217 -0
  4. data/Gemfile +19 -7
  5. data/LICENSE +21 -0
  6. data/README.md +37 -33
  7. data/Rakefile +1 -15
  8. data/blockscore.gemspec +30 -81
  9. data/circle.yml +13 -0
  10. data/lib/blockscore.rb +43 -4
  11. data/lib/blockscore/actions/all.rb +27 -0
  12. data/lib/blockscore/actions/create.rb +34 -0
  13. data/lib/blockscore/actions/delete.rb +31 -0
  14. data/lib/blockscore/actions/retrieve.rb +24 -0
  15. data/lib/blockscore/actions/update.rb +46 -0
  16. data/lib/blockscore/base.rb +117 -0
  17. data/lib/blockscore/candidate.rb +32 -0
  18. data/lib/blockscore/collection.rb +12 -0
  19. data/lib/blockscore/company.rb +7 -0
  20. data/lib/blockscore/connection.rb +65 -0
  21. data/lib/blockscore/dispatch.rb +26 -0
  22. data/lib/blockscore/errors/api_connection_error.rb +6 -0
  23. data/lib/blockscore/errors/api_error.rb +33 -0
  24. data/lib/blockscore/errors/authentication_error.rb +4 -0
  25. data/lib/blockscore/errors/error.rb +4 -0
  26. data/lib/blockscore/errors/invalid_request_error.rb +29 -0
  27. data/lib/blockscore/errors/no_api_key_error.rb +4 -0
  28. data/lib/blockscore/errors/not_found_error.rb +4 -0
  29. data/lib/blockscore/fingerprint.rb +46 -0
  30. data/lib/blockscore/person.rb +14 -0
  31. data/lib/blockscore/question_set.rb +26 -0
  32. data/lib/blockscore/response.rb +29 -0
  33. data/lib/blockscore/util.rb +80 -0
  34. data/lib/blockscore/version.rb +3 -0
  35. data/lib/blockscore/watchlist_hit.rb +4 -0
  36. metadata +82 -48
  37. data/LICENSE.txt +0 -20
  38. data/VERSION +0 -1
  39. data/blockscore-ruby.sublime-project +0 -21
  40. data/lib/blockscore/candidates.rb +0 -49
  41. data/lib/blockscore/client.rb +0 -81
  42. data/lib/blockscore/companies.rb +0 -36
  43. data/lib/blockscore/error/authorization_error.rb +0 -13
  44. data/lib/blockscore/error/blockscore_error.rb +0 -26
  45. data/lib/blockscore/error/error_handler.rb +0 -141
  46. data/lib/blockscore/error/internal_server_error.rb +0 -19
  47. data/lib/blockscore/error/not_found_error.rb +0 -12
  48. data/lib/blockscore/error/parameter_error.rb +0 -12
  49. data/lib/blockscore/error/validation_error.rb +0 -28
  50. data/lib/blockscore/errors.rb +0 -3
  51. data/lib/blockscore/people.rb +0 -37
  52. data/lib/blockscore/question_sets.rb +0 -49
  53. data/lib/blockscore/watchlists.rb +0 -18
  54. data/test/helper.rb +0 -37
  55. data/test/test_blockscore.rb +0 -226
@@ -0,0 +1,3 @@
1
+ module BlockScore
2
+ VERSION = '4.1.0'.freeze
3
+ end
@@ -0,0 +1,4 @@
1
+ module BlockScore
2
+ class WatchlistHit < Base
3
+ end
4
+ end
metadata CHANGED
@@ -1,14 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blockscore
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alain Meier
8
+ - John Backus
9
+ - Connor Jacobsen
8
10
  autorequire:
9
- bindir: bin
11
+ bindir: exe
10
12
  cert_chain: []
11
- date: 2014-11-17 00:00:00.000000000 Z
13
+ date: 2015-07-01 00:00:00.000000000 Z
12
14
  dependencies:
13
15
  - !ruby/object:Gem::Dependency
14
16
  name: httparty
@@ -29,6 +31,9 @@ dependencies:
29
31
  requirement: !ruby/object:Gem::Requirement
30
32
  requirements:
31
33
  - - "~>"
34
+ - !ruby/object:Gem::Version
35
+ version: '3.5'
36
+ - - ">="
32
37
  - !ruby/object:Gem::Version
33
38
  version: 3.5.0
34
39
  type: :development
@@ -36,6 +41,9 @@ dependencies:
36
41
  version_requirements: !ruby/object:Gem::Requirement
37
42
  requirements:
38
43
  - - "~>"
44
+ - !ruby/object:Gem::Version
45
+ version: '3.5'
46
+ - - ">="
39
47
  - !ruby/object:Gem::Version
40
48
  version: 3.5.0
41
49
  - !ruby/object:Gem::Dependency
@@ -67,95 +75,120 @@ dependencies:
67
75
  - !ruby/object:Gem::Version
68
76
  version: '1.0'
69
77
  - !ruby/object:Gem::Dependency
70
- name: jeweler
78
+ name: simplecov
71
79
  requirement: !ruby/object:Gem::Requirement
72
80
  requirements:
73
81
  - - "~>"
74
82
  - !ruby/object:Gem::Version
75
- version: 2.0.1
83
+ version: '0'
76
84
  type: :development
77
85
  prerelease: false
78
86
  version_requirements: !ruby/object:Gem::Requirement
79
87
  requirements:
80
88
  - - "~>"
81
89
  - !ruby/object:Gem::Version
82
- version: 2.0.1
90
+ version: '0'
83
91
  - !ruby/object:Gem::Dependency
84
- name: simplecov
92
+ name: minitest
85
93
  requirement: !ruby/object:Gem::Requirement
86
94
  requirements:
87
- - - ">="
95
+ - - "~>"
88
96
  - !ruby/object:Gem::Version
89
- version: '0'
97
+ version: '5.5'
90
98
  type: :development
91
99
  prerelease: false
92
100
  version_requirements: !ruby/object:Gem::Requirement
93
101
  requirements:
94
- - - ">="
102
+ - - "~>"
95
103
  - !ruby/object:Gem::Version
96
- version: '0'
104
+ version: '5.5'
97
105
  - !ruby/object:Gem::Dependency
98
- name: minitest
106
+ name: webmock
99
107
  requirement: !ruby/object:Gem::Requirement
100
108
  requirements:
101
- - - "~>"
109
+ - - '='
102
110
  - !ruby/object:Gem::Version
103
- version: '4.0'
111
+ version: '1.21'
104
112
  type: :development
105
113
  prerelease: false
106
114
  version_requirements: !ruby/object:Gem::Requirement
107
115
  requirements:
108
- - - "~>"
116
+ - - '='
109
117
  - !ruby/object:Gem::Version
110
- version: '4.0'
118
+ version: '1.21'
111
119
  - !ruby/object:Gem::Dependency
112
- name: shoulda-context
120
+ name: faker
113
121
  requirement: !ruby/object:Gem::Requirement
114
122
  requirements:
115
- - - "~>"
123
+ - - '='
116
124
  - !ruby/object:Gem::Version
117
- version: '1.2'
125
+ version: 1.4.3
118
126
  type: :development
119
127
  prerelease: false
120
128
  version_requirements: !ruby/object:Gem::Requirement
121
129
  requirements:
122
- - - "~>"
130
+ - - '='
131
+ - !ruby/object:Gem::Version
132
+ version: 1.4.3
133
+ - !ruby/object:Gem::Dependency
134
+ name: factory_girl
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - '='
123
138
  - !ruby/object:Gem::Version
124
- version: '1.2'
125
- description: A ruby client library for the BlockScore API.
126
- email: alain@blockscore.com
139
+ version: 4.1.0
140
+ type: :development
141
+ prerelease: false
142
+ version_requirements: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - '='
145
+ - !ruby/object:Gem::Version
146
+ version: 4.1.0
147
+ description: BlockScore makes ID verification easier and faster. See https://blockscore.com
148
+ for more.
149
+ email:
150
+ - alain@blockscore.com
151
+ - john@blockscore.com
127
152
  executables: []
128
153
  extensions: []
129
- extra_rdoc_files:
130
- - LICENSE.txt
131
- - README.md
154
+ extra_rdoc_files: []
132
155
  files:
133
156
  - ".document"
157
+ - ".gitignore"
158
+ - ".hound.yml"
134
159
  - Gemfile
135
- - LICENSE.txt
160
+ - LICENSE
136
161
  - README.md
137
162
  - Rakefile
138
- - VERSION
139
- - blockscore-ruby.sublime-project
140
163
  - blockscore.gemspec
164
+ - circle.yml
141
165
  - lib/blockscore.rb
142
- - lib/blockscore/candidates.rb
143
- - lib/blockscore/client.rb
144
- - lib/blockscore/companies.rb
145
- - lib/blockscore/error/authorization_error.rb
146
- - lib/blockscore/error/blockscore_error.rb
147
- - lib/blockscore/error/error_handler.rb
148
- - lib/blockscore/error/internal_server_error.rb
149
- - lib/blockscore/error/not_found_error.rb
150
- - lib/blockscore/error/parameter_error.rb
151
- - lib/blockscore/error/validation_error.rb
152
- - lib/blockscore/errors.rb
153
- - lib/blockscore/people.rb
154
- - lib/blockscore/question_sets.rb
155
- - lib/blockscore/watchlists.rb
156
- - test/helper.rb
157
- - test/test_blockscore.rb
158
- homepage: http://github.com/blockscore/blockscore-ruby
166
+ - lib/blockscore/actions/all.rb
167
+ - lib/blockscore/actions/create.rb
168
+ - lib/blockscore/actions/delete.rb
169
+ - lib/blockscore/actions/retrieve.rb
170
+ - lib/blockscore/actions/update.rb
171
+ - lib/blockscore/base.rb
172
+ - lib/blockscore/candidate.rb
173
+ - lib/blockscore/collection.rb
174
+ - lib/blockscore/company.rb
175
+ - lib/blockscore/connection.rb
176
+ - lib/blockscore/dispatch.rb
177
+ - lib/blockscore/errors/api_connection_error.rb
178
+ - lib/blockscore/errors/api_error.rb
179
+ - lib/blockscore/errors/authentication_error.rb
180
+ - lib/blockscore/errors/error.rb
181
+ - lib/blockscore/errors/invalid_request_error.rb
182
+ - lib/blockscore/errors/no_api_key_error.rb
183
+ - lib/blockscore/errors/not_found_error.rb
184
+ - lib/blockscore/fingerprint.rb
185
+ - lib/blockscore/person.rb
186
+ - lib/blockscore/question_set.rb
187
+ - lib/blockscore/response.rb
188
+ - lib/blockscore/util.rb
189
+ - lib/blockscore/version.rb
190
+ - lib/blockscore/watchlist_hit.rb
191
+ homepage: https://blockscore.com
159
192
  licenses:
160
193
  - MIT
161
194
  metadata: {}
@@ -167,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
167
200
  requirements:
168
201
  - - ">="
169
202
  - !ruby/object:Gem::Version
170
- version: '0'
203
+ version: 1.9.3
171
204
  required_rubygems_version: !ruby/object:Gem::Requirement
172
205
  requirements:
173
206
  - - ">="
@@ -175,8 +208,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
208
  version: '0'
176
209
  requirements: []
177
210
  rubyforge_project:
178
- rubygems_version: 2.2.2
211
+ rubygems_version: 2.4.6
179
212
  signing_key:
180
213
  specification_version: 4
181
214
  summary: A ruby client library for the BlockScore API.
182
215
  test_files: []
216
+ has_rdoc:
@@ -1,20 +0,0 @@
1
- Copyright (c) 2014 BlockScore
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 4.0.0
@@ -1,21 +0,0 @@
1
- {
2
- "settings":
3
- {
4
- "trim_automatic_white_space": true,
5
- "translate_tabs_to_spaces": true,
6
- "tab_size": 2
7
- },
8
-
9
- "folders":
10
- [
11
- {
12
- "path": "./"
13
- },
14
- {
15
- "path": "lib"
16
- },
17
- {
18
- "path": "test"
19
- }
20
- ]
21
- }
@@ -1,49 +0,0 @@
1
- module BlockScore
2
- class Candidates
3
- PATH = '/candidates'
4
-
5
- def initialize(client)
6
- @client = client
7
- end
8
-
9
- # POST https://api.blockscore.com/candidates
10
- def create(options = {})
11
- response = @client.post PATH, options
12
- end
13
-
14
- # PATCH https://api.blockscore.com/candidates/{CANDIDATE_ID}
15
- def edit(candidate_id, options = {})
16
- response = @client.put "#{PATH}/#{candidate_id}", options
17
- end
18
-
19
- # DELETE https://api.blockscore.com/candidates/{CANDIDATE_ID}
20
- def delete(candidate_id)
21
- response = @client.delete "#{PATH}/#{candidate_id}"
22
- end
23
-
24
- # GET https://api.blockscore.com/candidates/{CANDIDATE_ID}
25
- def retrieve(candidate_id)
26
- response = @client.get "#{PATH}/#{candidate_id}"
27
- end
28
-
29
- # GET https://api.blockscore.com/candidates
30
- def all(count = nil, offset = nil, options = {})
31
- body = (options.include? :body) ? options[:body] : {}
32
-
33
- body[:count] = count
34
- body[:offset] = offset
35
-
36
- @client.get PATH, body
37
- end
38
-
39
- # GET https://api.blockscore.com/candidates/:id/history
40
- def history(candidate_id)
41
- response = @client.get "#{PATH}/#{candidate_id}/history"
42
- end
43
-
44
- # GET https://api.blockscore.com/candidates/:id/hits
45
- def hits(candidate_id)
46
- response = @client.get "#{PATH}/#{candidate_id}/hits"
47
- end
48
- end
49
- end
@@ -1,81 +0,0 @@
1
- module BlockScore
2
- class Client
3
- include HTTParty
4
-
5
- attr_reader :people, :question_sets, :companies, :candidates, :watchlists
6
-
7
- def initialize(api_key, options = {})
8
- @api_key = api_key
9
- @auth = { :username => @api_key, :password => "" }
10
- @people = BlockScore::People.new(self)
11
- @question_sets = BlockScore::QuestionSets.new(self)
12
- @companies = BlockScore::Companies.new(self)
13
- @candidates = BlockScore::Candidates.new(self)
14
- @watchlists = BlockScore::Watchlists.new(self)
15
- @error_handler = BlockScore::ErrorHandler.new
16
-
17
- options[:base_uri] ||= "https://api.blockscore.com"
18
- options[:headers] = {
19
- 'Accept' => 'application/vnd.blockscore+json;version=4',
20
- 'User-Agent' => 'blockscore-ruby/4.0.0 (https://github.com/BlockScore/blockscore-ruby)'
21
- }
22
-
23
- options.each do |k,v|
24
- self.class.send k, v
25
- end
26
- end
27
-
28
- def get(path, options = {})
29
- options = { :body => options, :basic_auth => @auth }
30
-
31
- response = self.class.get(path, options)
32
-
33
- begin
34
- result = @error_handler.check_error(response)
35
- rescue BlockScore::BlockscoreError => e
36
- raise
37
- end
38
-
39
- end
40
-
41
- def post(path, options = {})
42
- options = { :body => options, :basic_auth => @auth }
43
-
44
- response = self.class.post(path, options)
45
-
46
- begin
47
- result = @error_handler.check_error(response)
48
- rescue BlockScore::BlockscoreError => e
49
- raise
50
- end
51
-
52
- end
53
-
54
- def put(path, options = {})
55
- options = { :body => options, :basic_auth => @auth }
56
-
57
- response = self.class.put(path, options)
58
-
59
- begin
60
- result = @error_handler.check_error(response)
61
- rescue BlockScore::BlockscoreError => e
62
- raise
63
- end
64
-
65
- end
66
-
67
- def delete(path, options = {})
68
- options = { :body => options, :basic_auth => @auth }
69
-
70
- response = self.class.delete(path, options)
71
-
72
- begin
73
- result = @error_handler.check_error(response)
74
- rescue BlockScore::BlockscoreError => e
75
- raise
76
- end
77
-
78
- end
79
-
80
- end
81
- end
@@ -1,36 +0,0 @@
1
- module BlockScore
2
- class Companies
3
- PATH = '/companies'
4
-
5
- def initialize(client)
6
- @client = client
7
- end
8
-
9
- #
10
- # /companies POST
11
- #
12
- def create(options = {})
13
- response = @client.post PATH, options
14
- end
15
-
16
- #
17
- # /companies/:id GET
18
- #
19
- def retrieve(id, options = {})
20
- body = (options.include? :query) ? options[:body] : {}
21
- response = @client.get "#{PATH}/#{id.to_s}", body
22
- end
23
-
24
- #
25
- # '/companies' GET
26
- #
27
- def all(count = nil, offset = nil, options = {})
28
- body = (options.include? :body) ? options[:body] : {}
29
-
30
- body[:count] = count
31
- body[:offset] = offset
32
-
33
- @client.get PATH, body
34
- end
35
- end
36
- end