pure_iterator 0.1.0 → 0.2.0

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: 40c5cd37848eac435da6f66979b843eeaba59551fe1a83a97431b6c28846770e
4
- data.tar.gz: 947ba58ff5eeda3fd87ad0b33b08bded49bcaacb21ac1ad9c027bd76a48b5c1d
3
+ metadata.gz: 8fe2f2e2fb6cad002a0a49106f7bac79793c91a1de46e4c098469855f4f108c6
4
+ data.tar.gz: 1700c47e1e5eed9ee8e75b75f2ddc21f9b5d5956890364015018c7fdfd687287
5
5
  SHA512:
6
- metadata.gz: 1d22bfb7e46602d1ed7de1d078476171eca7a3ac087048afb099c643eeb8cd8a05028d8440c479c2cb3ad6be7060c63b71c1455d16da735a82fdfd42d2b0013b
7
- data.tar.gz: 8e4713b6e68e97ad343e5aed8027c60be383bea467ad752e64023458cb6714b21e2866ce1b7418a989933c6c4881fbc1272b052e6280965e858eedae1bd50854
6
+ metadata.gz: 6d31c5c1106ed20b5200b0fd573c114eade7028653886eee966aa0eb7d6acc5415e2a47e1933191c79636747b5791eb0b8c4529267157f07be90066b69fb7fa8
7
+ data.tar.gz: 13beb8b6b2a9852836d12603c88f7ac8f96d25ec5a7548ba6ca5147fde261d1643ab2feb524a331448a0bb9bbad6f28a572a063d4cdf555ebd6d5efe9939fe51
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
  All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
 
5
+ ## 0.2.0 - 2019-12-18
6
+ ### Added
7
+ - Handle missing values in config.
8
+
5
9
  ## 0.1.0 - 2019-10-25
6
10
  ### Added
7
11
  - Initial product.
data/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  A flexible way to process records in the Pure Research Information System.
4
4
 
5
+ ## Status
6
+ [![Gem Version](https://badge.fury.io/rb/pure_iterator.svg)](https://badge.fury.io/rb/pure_iterator)
7
+ [![Maintainability](https://api.codeclimate.com/v1/badges/3dc9b9bd06dd42350843/maintainability)](https://codeclimate.com/github/lulibrary/pure_iterator/maintainability)
8
+
5
9
  ## Installation
6
10
 
7
11
  Add this line to your application's Gemfile:
@@ -10,12 +10,16 @@ module PureIterator
10
10
  # @option config [String] :api_key API key of the Pure host account
11
11
  # @option config [Integer] :api_version Pure API version
12
12
  def initialize(config)
13
+ required = [:host, :username, :password, :api_key, :api_version]
14
+ required.each do |r|
15
+ raise ArgumentError, "Pure #{r} not set" unless config[r] && !config[r].to_s.empty?
16
+ end
13
17
  http_client = HTTP::Client.new
14
18
  http_client = http_client.headers({ 'api-key' => config[:api_key] })
15
19
  http_client = http_client.basic_auth({user: config[:username], pass: config[:password]})
16
20
  @http_client = http_client
17
21
  @host = config[:host]
18
- @api_version = config[:api_version]
22
+ @api_version = config[:api_version].to_s
19
23
  accept :xml
20
24
  end
21
25
 
@@ -64,7 +68,7 @@ module PureIterator
64
68
  private
65
69
 
66
70
  def url
67
- File.join 'https://', @host, 'ws', 'api', @api_version.to_s, post_endpoint
71
+ File.join 'https://', @host, 'ws', 'api', @api_version, post_endpoint
68
72
  end
69
73
 
70
74
  def count_from_xml(xml)
@@ -1,3 +1,3 @@
1
1
  module PureIterator
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -21,6 +21,6 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_development_dependency 'minitest-reporters', '~> 1.1'
23
23
 
24
- spec.add_dependency 'http', '~> 3.0'
24
+ spec.add_dependency 'http', '~> 4.0'
25
25
  spec.add_dependency 'nokogiri', '~> 1.6'
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pure_iterator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Albin-Clark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-25 00:00:00.000000000 Z
11
+ date: 2019-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest-reporters
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '3.0'
33
+ version: '4.0'
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: '3.0'
40
+ version: '4.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -73,7 +73,7 @@ licenses:
73
73
  - MIT
74
74
  metadata:
75
75
  source_code_uri: https://github.com/lulibrary/pure_iterator
76
- documentation_uri: https://www.rubydoc.info/gems/pure_iterator/0.1.0
76
+ documentation_uri: https://www.rubydoc.info/gems/pure_iterator/0.2.0
77
77
  post_install_message:
78
78
  rdoc_options: []
79
79
  require_paths: