archivist-client 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -11,6 +11,7 @@ an *archive.org* Ruby client
11
11
  | version | [![Gem Version](https://badge.fury.io/rb/archivist-client.png)](http://badge.fury.io/rb/archivist-client) |
12
12
  | dependencies | [![Dependency Status](https://gemnasium.com/wordtreefoundation/archivist-client.png)](https://gemnasium.com/wordtreefoundation/archivist-client) |
13
13
  | code quality | [![Code Climate](https://codeclimate.com/github/wordtreefoundation/archivist-client.png)](https://codeclimate.com/github/wordtreefoundation/archivist-client) |
14
+ | inline documenation | [![Inline docs](http://inch-pages.github.io/github/wordtreefoundation/archivist-client.png)](http://inch-pages.github.io/github/wordtreefoundation/archivist-client) |
14
15
  | continuous integration | [![Build Status](https://secure.travis-ci.org/wordtreefoundation/archivist-client.png?branch=master)](https://travis-ci.org/wordtreefoundation/archivist-client) |
15
16
  | test coverage | [![Coverage Status](https://coveralls.io/repos/wordtreefoundation/archivist-client/badge.png)](https://coveralls.io/r/wordtreefoundation/archivist-client) |
16
17
  | homepage | [https://github.com/wordtreefoundation/archivist-client][homepage] |
@@ -12,7 +12,8 @@ module Archivist
12
12
  STANDARD_OPTIONS = [
13
13
  :filters,
14
14
  :language,
15
- :start_year, :end_year
15
+ :start_year, :end_year,
16
+ :identifier
16
17
  ]
17
18
  DEFAULT_FILTERS = [
18
19
  'mediatype:texts',
@@ -33,6 +34,7 @@ module Archivist
33
34
  self.prune_options(opts)
34
35
  self.set_language
35
36
  self.set_years
37
+ self.set_identifier
36
38
  self.set_filters
37
39
  end
38
40
 
@@ -68,6 +70,10 @@ module Archivist
68
70
  self.validate_years
69
71
  end
70
72
 
73
+ def set_identifier
74
+ @identifier = @options[:identifier] if @options.has_key?(:identifier)
75
+ end
76
+
71
77
  # If one is provided, they must *both* be provided
72
78
  def validate_years
73
79
  unless @start_year && @end_year
@@ -91,12 +97,21 @@ module Archivist
91
97
  end
92
98
 
93
99
  def add_date_filter
94
- @filters << "date:[#{@start_year} TO #{@end_year}]"
100
+ if @start_year or @end_year
101
+ start_year = @start_year || "1400-01-01"
102
+ end_year = @end_year || "2100-12-31"
103
+ @filters << "date:[#{start_year} TO #{end_year}]"
104
+ end
105
+ end
106
+
107
+ def add_identifier
108
+ @filters << "identifier:#{@identifier}" if @identifier
95
109
  end
96
110
 
97
111
  def finalize_filters
98
- self.add_language_filter
99
- self.add_date_filter
112
+ add_language_filter
113
+ add_date_filter
114
+ add_identifier
100
115
  self
101
116
  end
102
117
  end
@@ -1,5 +1,5 @@
1
1
  module Archivist
2
2
  module Client
3
- VERSION = '0.1.6'
3
+ VERSION = '0.1.7'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: archivist-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Duane Johnson
@@ -9,11 +10,12 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2014-02-26 00:00:00.000000000 Z
13
+ date: 2014-07-17 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: rake
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
20
  - - ! '>='
19
21
  - !ruby/object:Gem::Version
@@ -21,6 +23,7 @@ dependencies:
21
23
  type: :development
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
28
  - - ! '>='
26
29
  - !ruby/object:Gem::Version
@@ -28,6 +31,7 @@ dependencies:
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: bundler
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
36
  - - ! '>='
33
37
  - !ruby/object:Gem::Version
@@ -35,6 +39,7 @@ dependencies:
35
39
  type: :development
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
44
  - - ! '>='
40
45
  - !ruby/object:Gem::Version
@@ -42,6 +47,7 @@ dependencies:
42
47
  - !ruby/object:Gem::Dependency
43
48
  name: rspec
44
49
  requirement: !ruby/object:Gem::Requirement
50
+ none: false
45
51
  requirements:
46
52
  - - ~>
47
53
  - !ruby/object:Gem::Version
@@ -49,6 +55,7 @@ dependencies:
49
55
  type: :development
50
56
  prerelease: false
51
57
  version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
52
59
  requirements:
53
60
  - - ~>
54
61
  - !ruby/object:Gem::Version
@@ -56,6 +63,7 @@ dependencies:
56
63
  - !ruby/object:Gem::Dependency
57
64
  name: debugger
58
65
  requirement: !ruby/object:Gem::Requirement
66
+ none: false
59
67
  requirements:
60
68
  - - ! '>='
61
69
  - !ruby/object:Gem::Version
@@ -63,6 +71,7 @@ dependencies:
63
71
  type: :development
64
72
  prerelease: false
65
73
  version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
66
75
  requirements:
67
76
  - - ! '>='
68
77
  - !ruby/object:Gem::Version
@@ -70,6 +79,7 @@ dependencies:
70
79
  - !ruby/object:Gem::Dependency
71
80
  name: webmock
72
81
  requirement: !ruby/object:Gem::Requirement
82
+ none: false
73
83
  requirements:
74
84
  - - ! '>='
75
85
  - !ruby/object:Gem::Version
@@ -80,6 +90,7 @@ dependencies:
80
90
  type: :development
81
91
  prerelease: false
82
92
  version_requirements: !ruby/object:Gem::Requirement
93
+ none: false
83
94
  requirements:
84
95
  - - ! '>='
85
96
  - !ruby/object:Gem::Version
@@ -90,6 +101,7 @@ dependencies:
90
101
  - !ruby/object:Gem::Dependency
91
102
  name: vcr
92
103
  requirement: !ruby/object:Gem::Requirement
104
+ none: false
93
105
  requirements:
94
106
  - - ! '>='
95
107
  - !ruby/object:Gem::Version
@@ -97,6 +109,7 @@ dependencies:
97
109
  type: :development
98
110
  prerelease: false
99
111
  version_requirements: !ruby/object:Gem::Requirement
112
+ none: false
100
113
  requirements:
101
114
  - - ! '>='
102
115
  - !ruby/object:Gem::Version
@@ -104,6 +117,7 @@ dependencies:
104
117
  - !ruby/object:Gem::Dependency
105
118
  name: reek
106
119
  requirement: !ruby/object:Gem::Requirement
120
+ none: false
107
121
  requirements:
108
122
  - - ! '>='
109
123
  - !ruby/object:Gem::Version
@@ -111,6 +125,7 @@ dependencies:
111
125
  type: :development
112
126
  prerelease: false
113
127
  version_requirements: !ruby/object:Gem::Requirement
128
+ none: false
114
129
  requirements:
115
130
  - - ! '>='
116
131
  - !ruby/object:Gem::Version
@@ -118,6 +133,7 @@ dependencies:
118
133
  - !ruby/object:Gem::Dependency
119
134
  name: roodi
120
135
  requirement: !ruby/object:Gem::Requirement
136
+ none: false
121
137
  requirements:
122
138
  - - ! '>='
123
139
  - !ruby/object:Gem::Version
@@ -125,6 +141,7 @@ dependencies:
125
141
  type: :development
126
142
  prerelease: false
127
143
  version_requirements: !ruby/object:Gem::Requirement
144
+ none: false
128
145
  requirements:
129
146
  - - ! '>='
130
147
  - !ruby/object:Gem::Version
@@ -132,6 +149,7 @@ dependencies:
132
149
  - !ruby/object:Gem::Dependency
133
150
  name: gem-release
134
151
  requirement: !ruby/object:Gem::Requirement
152
+ none: false
135
153
  requirements:
136
154
  - - ! '>='
137
155
  - !ruby/object:Gem::Version
@@ -139,6 +157,7 @@ dependencies:
139
157
  type: :development
140
158
  prerelease: false
141
159
  version_requirements: !ruby/object:Gem::Requirement
160
+ none: false
142
161
  requirements:
143
162
  - - ! '>='
144
163
  - !ruby/object:Gem::Version
@@ -146,6 +165,7 @@ dependencies:
146
165
  - !ruby/object:Gem::Dependency
147
166
  name: coveralls
148
167
  requirement: !ruby/object:Gem::Requirement
168
+ none: false
149
169
  requirements:
150
170
  - - ! '>='
151
171
  - !ruby/object:Gem::Version
@@ -153,6 +173,7 @@ dependencies:
153
173
  type: :development
154
174
  prerelease: false
155
175
  version_requirements: !ruby/object:Gem::Requirement
176
+ none: false
156
177
  requirements:
157
178
  - - ! '>='
158
179
  - !ruby/object:Gem::Version
@@ -160,6 +181,7 @@ dependencies:
160
181
  - !ruby/object:Gem::Dependency
161
182
  name: rdoc
162
183
  requirement: !ruby/object:Gem::Requirement
184
+ none: false
163
185
  requirements:
164
186
  - - ! '>='
165
187
  - !ruby/object:Gem::Version
@@ -167,6 +189,7 @@ dependencies:
167
189
  type: :development
168
190
  prerelease: false
169
191
  version_requirements: !ruby/object:Gem::Requirement
192
+ none: false
170
193
  requirements:
171
194
  - - ! '>='
172
195
  - !ruby/object:Gem::Version
@@ -174,6 +197,7 @@ dependencies:
174
197
  - !ruby/object:Gem::Dependency
175
198
  name: virtus
176
199
  requirement: !ruby/object:Gem::Requirement
200
+ none: false
177
201
  requirements:
178
202
  - - ~>
179
203
  - !ruby/object:Gem::Version
@@ -181,6 +205,7 @@ dependencies:
181
205
  type: :runtime
182
206
  prerelease: false
183
207
  version_requirements: !ruby/object:Gem::Requirement
208
+ none: false
184
209
  requirements:
185
210
  - - ~>
186
211
  - !ruby/object:Gem::Version
@@ -188,6 +213,7 @@ dependencies:
188
213
  - !ruby/object:Gem::Dependency
189
214
  name: representable
190
215
  requirement: !ruby/object:Gem::Requirement
216
+ none: false
191
217
  requirements:
192
218
  - - ! '>='
193
219
  - !ruby/object:Gem::Version
@@ -195,6 +221,7 @@ dependencies:
195
221
  type: :runtime
196
222
  prerelease: false
197
223
  version_requirements: !ruby/object:Gem::Requirement
224
+ none: false
198
225
  requirements:
199
226
  - - ! '>='
200
227
  - !ruby/object:Gem::Version
@@ -202,6 +229,7 @@ dependencies:
202
229
  - !ruby/object:Gem::Dependency
203
230
  name: faraday
204
231
  requirement: !ruby/object:Gem::Requirement
232
+ none: false
205
233
  requirements:
206
234
  - - ! '>='
207
235
  - !ruby/object:Gem::Version
@@ -209,6 +237,7 @@ dependencies:
209
237
  type: :runtime
210
238
  prerelease: false
211
239
  version_requirements: !ruby/object:Gem::Requirement
240
+ none: false
212
241
  requirements:
213
242
  - - ! '>='
214
243
  - !ruby/object:Gem::Version
@@ -216,6 +245,7 @@ dependencies:
216
245
  - !ruby/object:Gem::Dependency
217
246
  name: faraday_middleware
218
247
  requirement: !ruby/object:Gem::Requirement
248
+ none: false
219
249
  requirements:
220
250
  - - ! '>='
221
251
  - !ruby/object:Gem::Version
@@ -223,6 +253,7 @@ dependencies:
223
253
  type: :runtime
224
254
  prerelease: false
225
255
  version_requirements: !ruby/object:Gem::Requirement
256
+ none: false
226
257
  requirements:
227
258
  - - ! '>='
228
259
  - !ruby/object:Gem::Version
@@ -281,26 +312,27 @@ files:
281
312
  homepage: http://github.com/wordtreefoundation/archivist-client
282
313
  licenses:
283
314
  - MIT
284
- metadata: {}
285
315
  post_install_message:
286
316
  rdoc_options: []
287
317
  require_paths:
288
318
  - lib
289
319
  required_ruby_version: !ruby/object:Gem::Requirement
320
+ none: false
290
321
  requirements:
291
322
  - - ! '>='
292
323
  - !ruby/object:Gem::Version
293
324
  version: 1.9.0
294
325
  required_rubygems_version: !ruby/object:Gem::Requirement
326
+ none: false
295
327
  requirements:
296
328
  - - ! '>='
297
329
  - !ruby/object:Gem::Version
298
330
  version: '0'
299
331
  requirements: []
300
332
  rubyforge_project:
301
- rubygems_version: 2.1.11
333
+ rubygems_version: 1.8.23
302
334
  signing_key:
303
- specification_version: 4
335
+ specification_version: 3
304
336
  summary: archivist-client is an archive.org client library
305
337
  test_files:
306
338
  - spec/client_spec.rb
@@ -321,3 +353,4 @@ test_files:
321
353
  - spec/representations/format_index_spec.rb
322
354
  - spec/representations/query_response_spec.rb
323
355
  - spec/spec_helper.rb
356
+ has_rdoc:
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: e7704b95e3bc73ba04777f7c7be9b5b6930f3843
4
- data.tar.gz: c3c3dca6cc795170838e5d944fdc1814b125703c
5
- SHA512:
6
- metadata.gz: 0de6ce9accf8abacbbafc168ca37938c0f91b8dd963e90528d4e965973b16ca6d513979c08800ef40f63b898e111db2d41740db3ceb198b926d0b6fcb70f4daf
7
- data.tar.gz: 05011890ed16175915b2091a691f0f9ae937d80bde858e37cedcb81a40f45be076270efa33a3a0af4891c1b509e30abe623a89232bf6d253c7d5965785d4d063