oai 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 08fffc6365464c94b303662af07b8bbb2e5c9be2
4
+ data.tar.gz: 359f168eb97821a941f24d6e43cec41e1b3fb517
5
+ SHA512:
6
+ metadata.gz: 8905ea28cd2e3975cb8563a8d4201dd1c7f03fa703185261b7c01d278c9b90dd804c3ab38ca77cddccd3bd0e3c01ec52af40ed7e9db52cebc3f71c3c4eed20e6
7
+ data.tar.gz: a9996d70f6ee00a698b79c0bbb8ebf1ce5c7917ca6327e55151d5d0c03750ea9c4dada39c429444e223b17209889196d378ec0bad030fa84ecb8cc54af94f2ef
@@ -1,3 +1,5 @@
1
+ # encoding: us-ascii
2
+
1
3
  # External dependencies
2
4
  require 'uri'
3
5
  require 'faraday'
@@ -87,7 +89,7 @@ module OAI
87
89
  @parser = options.fetch(:parser, 'rexml')
88
90
 
89
91
  @http_client = options.fetch(:http) do
90
- Faraday.new(:url => @base) do |builder|
92
+ Faraday.new(:url => @base.clone) do |builder|
91
93
  follow_redirects = options.fetch(:redirects, true)
92
94
  if follow_redirects
93
95
  count = follow_redirects.is_a?(Fixnum) ? follow_redirects : 5
@@ -219,7 +221,7 @@ module OAI
219
221
 
220
222
  def build_uri(verb, opts)
221
223
  opts = validate_options(verb, opts)
222
- uri = @base.clone
224
+ uri = @base
223
225
  uri.query = "verb=" << verb
224
226
  opts.each_pair { |k,v| uri.query << '&' << externalize(k) << '=' << encode(v) }
225
227
  uri
@@ -314,7 +316,7 @@ module OAI
314
316
  Date.parse(value) # This will raise an exception for badly formatted dates
315
317
  Time.parse(value).utc # Sadly, this will not
316
318
  rescue
317
- raise OAI::ArgumentError.new
319
+ raise OAI::ArgumentException.new, "unparsable date: '#{value}'"
318
320
  end
319
321
 
320
322
  # Strip out invalid UTF-8 characters. Regex from the W3C, inverted.
@@ -94,7 +94,7 @@ module OAI
94
94
  Date.parse(value) # This will raise an exception for badly formatted dates
95
95
  Time.parse(value).utc # -- UTC Bug fix hack 8/08 not in core
96
96
  rescue
97
- raise OAI::ArgumentError.new
97
+ raise OAI::ArgumentException.new, "unparsable date: '#{value}'"
98
98
  end
99
99
 
100
100
  def internalize(hash = {})
metadata CHANGED
@@ -1,62 +1,55 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
5
- prerelease:
4
+ version: 0.3.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Ed Summers
9
8
  autorequire: oai
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-10 00:00:00.000000000 Z
11
+ date: 2013-10-16 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: builder
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 2.0.0
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: 2.0.0
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: faraday
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: faraday_middleware
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  description:
@@ -152,33 +145,26 @@ files:
152
145
  - examples/providers/dublin_core.rb
153
146
  homepage: http://github.com/code4lib/ruby-oai
154
147
  licenses: []
148
+ metadata: {}
155
149
  post_install_message:
156
150
  rdoc_options: []
157
151
  require_paths:
158
152
  - lib
159
153
  required_ruby_version: !ruby/object:Gem::Requirement
160
- none: false
161
154
  requirements:
162
- - - ! '>='
155
+ - - '>='
163
156
  - !ruby/object:Gem::Version
164
157
  version: '0'
165
- segments:
166
- - 0
167
- hash: -2108195439113391200
168
158
  required_rubygems_version: !ruby/object:Gem::Requirement
169
- none: false
170
159
  requirements:
171
- - - ! '>='
160
+ - - '>='
172
161
  - !ruby/object:Gem::Version
173
162
  version: '0'
174
- segments:
175
- - 0
176
- hash: -2108195439113391200
177
163
  requirements: []
178
164
  rubyforge_project:
179
- rubygems_version: 1.8.23
165
+ rubygems_version: 2.0.3
180
166
  signing_key:
181
- specification_version: 3
167
+ specification_version: 4
182
168
  summary: A ruby library for working with the Open Archive Initiative Protocol for
183
169
  Metadata Harvesting (OAI-PMH)
184
170
  test_files: []