blueline_services 0.1.6 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZTEwYmQ0ZjQzOTBiZDlmOTM4NThjY2QyNjc5NzMwNjk1MDE3ODcyZg==
5
+ data.tar.gz: !binary |-
6
+ MzYzZTE4ZGY0MmJhZTE0YzI2MWVhOTE0OTY5MjBmMzI2MTk0YjlmYw==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MzM4M2ExYjA0Yzk4YmFhODQ5MzJjNWNhZGYzZDM5ZTcxZTUzODllMWI2MGFk
10
+ ZTgxYmNmMmMzN2ZkNWI1MTI2NjY0YTFkN2E3YTVlNWFlYzY5OTE5MzUxZTRl
11
+ ZjU3ZmVmYTdlOTJhMzAzMmFlYjg2NDQxZDBhZDBlNGY4NzIzMzI=
12
+ data.tar.gz: !binary |-
13
+ NmQzNjgzODM4MTlmYjg5ZTMwNWYyYmU2ODE5ZTY2OWYzYzBhNDJkNmU3ZmZi
14
+ MjAzN2RkMmI0MTRkNWE1NTcwY2VhZjQ4YTk4NDc5NjkxYTEwM2VkODY1N2Jk
15
+ ZmYyZDNkYTk0MzljZmM5YmJkZDYwNjJiYjdhNGY4NDU1N2UzNDA=
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blueline_services (0.1.6)
4
+ blueline_services (0.2.0)
5
5
  activesupport
6
6
  httparty
7
7
  i18n
@@ -20,9 +20,9 @@ GEM
20
20
  method_source (0.7.1)
21
21
  mocha (0.10.4)
22
22
  metaclass (~> 0.0.1)
23
- multi_json (1.2.0)
23
+ multi_json (1.7.2)
24
24
  multi_xml (0.4.2)
25
- nokogiri (1.5.0)
25
+ nokogiri (1.5.9)
26
26
  pry (0.9.8.4)
27
27
  coderay (~> 1.0.5)
28
28
  method_source (~> 0.7.1)
@@ -1,12 +1,17 @@
1
1
  module BluelineServices
2
2
  class Configuration
3
3
 
4
- attr_accessor :user_name,
4
+ attr_accessor :base_uri,
5
+ :user_name,
5
6
  :password,
6
7
  :postback_url,
7
8
  :postback_username,
8
9
  :postback_password
9
10
 
11
+ def base_uri
12
+ @base_uri ||= 'https://www.bluelinebackgrounds.com/send/interchange'
13
+ end
14
+
10
15
  end
11
16
 
12
17
  class << self
@@ -21,6 +26,7 @@ module BluelineServices
21
26
  #
22
27
  # Examples
23
28
  # BluelineServices.configure do |config|
29
+ # config.base_uri = 'https://www.bluelinebackgrounds.com/send/interchange'
24
30
  # config.user_name = "***"
25
31
  # config.password = "***"
26
32
  # config.postback_url = "http://127.0.0.1/listen.php"
@@ -1,15 +1,15 @@
1
1
  module BluelineServices
2
2
  class Request
3
3
  include DSL
4
- include HTTParty
5
- base_uri "https://www.bluelinebackgrounds.com/send/interchange"
6
4
 
7
5
  ADDITIONAL_ITEMS = [:postback_url, :postback_username,
8
6
  :postback_password, :embed_credentials, :ordernotes,
9
7
  :interface, :monthly_income, :monthly_rent]
10
8
 
11
9
  # BackgroundCheck
12
- attr_accessor :user_name,
10
+ attr_accessor :config,
11
+ :base_uri,
12
+ :user_name,
13
13
  :password
14
14
 
15
15
  # BackgroundSearchPackage
@@ -132,19 +132,42 @@ module BluelineServices
132
132
  end
133
133
 
134
134
  def submit
135
- response = self.class.post("", :body => {:request => to_xml})
135
+ response = HTTParty.post(base_uri, :body => {:request => to_xml})
136
136
  data = response.parsed_response
137
137
  BluelineServices::Response.new(data)
138
138
  end
139
139
 
140
+ def config
141
+ @config || BluelineServices.configuration
142
+ end
143
+
144
+ def base_uri
145
+ @base_uri || config.base_uri
146
+ end
147
+
148
+ def user_name
149
+ @user_name || config.user_name
150
+ end
151
+
152
+ def password
153
+ @password || config.password
154
+ end
155
+
156
+ def postback_url
157
+ @postback_url || config.postback_url
158
+ end
159
+
160
+ def postback_username
161
+ @postback_username || config.postback_username
162
+ end
163
+
164
+ def postback_password
165
+ @postback_password || config.postback_password
166
+ end
167
+
140
168
  private
169
+
141
170
  def init_defaults
142
- config = BluelineServices.configuration
143
- @user_name = config.user_name
144
- @password = config.password
145
- @postback_url = config.postback_url
146
- @postback_username = config.postback_username
147
- @postback_password = config.postback_password
148
171
  @action = "submit"
149
172
  @screenings = []
150
173
  @aliases = []
@@ -1,3 +1,3 @@
1
1
  module BluelineServices
2
- VERSION = "0.1.6"
2
+ VERSION = '0.2.0'
3
3
  end
@@ -72,15 +72,13 @@ module BluelineServices
72
72
  http_response = mock(:parsed_response => response_xml)
73
73
  body = {:body => {:request => request_xml}}
74
74
  subject.expects(:to_xml).returns(request_xml)
75
- subject.class.expects(:post).
76
- with("", body).
77
- returns(http_response)
75
+ HTTParty.expects(:post).with(subject.base_uri, body).returns(http_response)
78
76
  Response.expects(:new).with(response_xml).returns(response)
79
77
  assert_equal response, subject.submit
80
78
  end
81
79
  end
82
80
 
83
- should_have_attr_accessor :user_name, :password
81
+ should_have_attr_accessor :config, :base_uri, :user_name, :password
84
82
  should_have_attr_accessor :action, :type, :reference_id
85
83
  should_have_attr_accessor :email_address, :telephone
86
84
  should_have_attr_accessor :given_name, :middle_name, :family_name
metadata CHANGED
@@ -1,148 +1,137 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: blueline_services
3
- version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 6
10
- version: 0.1.6
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
11
5
  platform: ruby
12
- authors:
6
+ authors:
13
7
  - Jon Karna
14
8
  - Ed Lebert
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2012-05-08 00:00:00 Z
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- prerelease: false
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 0
31
- version: "0"
32
- requirement: *id001
12
+ date: 2013-08-01 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
33
15
  name: httparty
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ! '>='
19
+ - !ruby/object:Gem::Version
20
+ version: '0'
34
21
  type: :runtime
35
- - !ruby/object:Gem::Dependency
36
22
  prerelease: false
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
38
- none: false
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- hash: 3
43
- segments:
44
- - 0
45
- version: "0"
46
- requirement: *id002
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '0'
28
+ - !ruby/object:Gem::Dependency
47
29
  name: nokogiri
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ! '>='
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
48
35
  type: :runtime
49
- - !ruby/object:Gem::Dependency
50
36
  prerelease: false
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
52
- none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- hash: 3
57
- segments:
58
- - 0
59
- version: "0"
60
- requirement: *id003
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ! '>='
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
42
+ - !ruby/object:Gem::Dependency
61
43
  name: activesupport
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '0'
62
49
  type: :runtime
63
- - !ruby/object:Gem::Dependency
64
50
  prerelease: false
65
- version_requirements: &id004 !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- hash: 3
71
- segments:
72
- - 0
73
- version: "0"
74
- requirement: *id004
51
+ version_requirements: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ! '>='
54
+ - !ruby/object:Gem::Version
55
+ version: '0'
56
+ - !ruby/object:Gem::Dependency
75
57
  name: i18n
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - ! '>='
61
+ - !ruby/object:Gem::Version
62
+ version: '0'
76
63
  type: :runtime
77
- - !ruby/object:Gem::Dependency
78
64
  prerelease: false
79
- version_requirements: &id005 !ruby/object:Gem::Requirement
80
- none: false
81
- requirements:
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- hash: 3
85
- segments:
86
- - 0
87
- version: "0"
88
- requirement: *id005
65
+ version_requirements: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ - !ruby/object:Gem::Dependency
89
71
  name: pry
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
90
77
  type: :development
91
- - !ruby/object:Gem::Dependency
92
78
  prerelease: false
93
- version_requirements: &id006 !ruby/object:Gem::Requirement
94
- none: false
95
- requirements:
96
- - - ">="
97
- - !ruby/object:Gem::Version
98
- hash: 3
99
- segments:
100
- - 0
101
- version: "0"
102
- requirement: *id006
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - ! '>='
82
+ - !ruby/object:Gem::Version
83
+ version: '0'
84
+ - !ruby/object:Gem::Dependency
103
85
  name: rake
86
+ requirement: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - ! '>='
89
+ - !ruby/object:Gem::Version
90
+ version: '0'
104
91
  type: :development
105
- - !ruby/object:Gem::Dependency
106
92
  prerelease: false
107
- version_requirements: &id007 !ruby/object:Gem::Requirement
108
- none: false
109
- requirements:
110
- - - ">="
111
- - !ruby/object:Gem::Version
112
- hash: 3
113
- segments:
114
- - 0
115
- version: "0"
116
- requirement: *id007
93
+ version_requirements: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ! '>='
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ - !ruby/object:Gem::Dependency
117
99
  name: shoulda
100
+ requirement: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ! '>='
103
+ - !ruby/object:Gem::Version
104
+ version: '0'
118
105
  type: :development
119
- - !ruby/object:Gem::Dependency
120
106
  prerelease: false
121
- version_requirements: &id008 !ruby/object:Gem::Requirement
122
- none: false
123
- requirements:
124
- - - ">="
125
- - !ruby/object:Gem::Version
126
- hash: 3
127
- segments:
128
- - 0
129
- version: "0"
130
- requirement: *id008
107
+ version_requirements: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ! '>='
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ - !ruby/object:Gem::Dependency
131
113
  name: mocha
114
+ requirement: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ! '>='
117
+ - !ruby/object:Gem::Version
118
+ version: '0'
132
119
  type: :development
133
- description: |-
134
- The blueline_services gem is a ruby gem used for
135
- submitting background check requests to Blueline Services
136
- email:
120
+ prerelease: false
121
+ version_requirements: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ description: ! "The blueline_services gem is a ruby gem used for\n submitting
127
+ background check requests to Blueline Services"
128
+ email:
137
129
  - jon.karna@tstmedia.com
138
130
  - ed.lebert@tstmedia.com
139
131
  executables: []
140
-
141
132
  extensions: []
142
-
143
133
  extra_rdoc_files: []
144
-
145
- files:
134
+ files:
146
135
  - .gitignore
147
136
  - Gemfile
148
137
  - Gemfile.lock
@@ -179,40 +168,30 @@ files:
179
168
  - test/unit/screening/eviction_test.rb
180
169
  - test/unit/screening/model_test.rb
181
170
  - test/unit/screening/person_search_test.rb
182
- homepage: ""
171
+ homepage: ''
183
172
  licenses: []
184
-
173
+ metadata: {}
185
174
  post_install_message:
186
175
  rdoc_options: []
187
-
188
- require_paths:
176
+ require_paths:
189
177
  - lib
190
- required_ruby_version: !ruby/object:Gem::Requirement
191
- none: false
192
- requirements:
193
- - - ">="
194
- - !ruby/object:Gem::Version
195
- hash: 3
196
- segments:
197
- - 0
198
- version: "0"
199
- required_rubygems_version: !ruby/object:Gem::Requirement
200
- none: false
201
- requirements:
202
- - - ">="
203
- - !ruby/object:Gem::Version
204
- hash: 3
205
- segments:
206
- - 0
207
- version: "0"
178
+ required_ruby_version: !ruby/object:Gem::Requirement
179
+ requirements:
180
+ - - ! '>='
181
+ - !ruby/object:Gem::Version
182
+ version: '0'
183
+ required_rubygems_version: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ! '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
208
188
  requirements: []
209
-
210
189
  rubyforge_project: blueline_services
211
- rubygems_version: 1.8.15
190
+ rubygems_version: 2.0.6
212
191
  signing_key:
213
- specification_version: 3
192
+ specification_version: 4
214
193
  summary: Submit background checks to Blueline Services
215
- test_files:
194
+ test_files:
216
195
  - test/integration/initial_request_test.rb
217
196
  - test/test-updated.xml
218
197
  - test/test_helper.rb