summon 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,15 @@
1
+ === 1.1.0 2009-11-10
2
+ * 2 major enhancements:
3
+ * add support for Thumbnails in the thumbnail_small, thumbnail_medium, and thumbnail_large fields
4
+ * add availability service for querying physical catalogue records.
5
+ * 2 minor enhancements:
6
+ * add support to handle multiple call numbers.
7
+ * add support for corporate author.
8
+ * add range? to see whether a facet is a range or not
9
+ * 1 bug fixes:
10
+ * empty parameter was causing a NameError on the return trip
11
+ * added range? predicate to range facets so that they can be identified as ranges
12
+
1
13
  === 1.0.0 2009-09-28
2
14
 
3
15
  * 1 major enhancement:
data/Manifest.txt CHANGED
@@ -1,4 +1,3 @@
1
- .specification
2
1
  History.txt
3
2
  Manifest.txt
4
3
  PostInstall.txt
data/PostInstall.txt CHANGED
@@ -2,3 +2,4 @@
2
2
  For comprehensive documentation on Summon API options and usage visit:
3
3
 
4
4
  http://api.summon.serialssolutions.com
5
+
@@ -8,6 +8,7 @@ class Summon::Document < Summon::Schema
8
8
  attr :content_type
9
9
 
10
10
  attr :authors, :json_name => "Author"
11
+ attr :corporate_authors, :json_name => "CorporateAuthor"
11
12
  attr :publishers, :json_name => "Publisher"
12
13
  attr :volume
13
14
  attr :issue
@@ -26,7 +27,7 @@ class Summon::Document < Summon::Schema
26
27
  attr :dissertation_school
27
28
 
28
29
  attr :library
29
- attr :call_number, :json_name => "LCCallNum"
30
+ attr :call_numbers, :json_name => "LCCallNum"
30
31
  attr :doi, :json_name => "DOI"
31
32
  attr :isbns, :json_name => "ISBN"
32
33
  attr :issns, :json_name => "ISSN"
@@ -44,15 +45,19 @@ class Summon::Document < Summon::Schema
44
45
  attr :open_url
45
46
  attr :subject_terms
46
47
 
47
- attr :thumbnail_small, :json_name => "Thumbnail-s"
48
- attr :thumbnail_medium, :json_name => "Thumbnail-m"
49
- attr :thumbnail_large, :json_name => "Thumbnail-l"
50
- attr :availability_token
48
+ attr :thumbnail_small, :json_name => "thumbnail_s"
49
+ attr :thumbnail_medium, :json_name => "thumbnail_m"
50
+ attr :thumbnail_large, :json_name => "thumbnail_l"
51
+ attr :availability_id
51
52
 
52
53
 
53
54
  def isbn
54
55
  @isbns.first
55
56
  end
57
+
58
+ def call_number
59
+ @call_numbers.first
60
+ end
56
61
 
57
62
  def pages?
58
63
  @start_page || @page_count
@@ -70,6 +75,10 @@ class Summon::Document < Summon::Schema
70
75
  @authors.map {|n| Summon::Author.new(n)}
71
76
  end
72
77
 
78
+ def corporate_authors
79
+ @corporate_authors.map {|n| Summon::Author.new(n)}
80
+ end
81
+
73
82
  def to_s(options = {})
74
83
  "Title: #{title}"
75
84
  end
@@ -38,10 +38,19 @@ class Summon::Query < Summon::Schema
38
38
  end
39
39
  end
40
40
 
41
- def to_hash
41
+ def to_hash
42
+ # {}.tap do |params|
43
+ # for param in query_string.split("&") do
44
+ # name, value = param.split("=")
45
+ # next if value.nil?
46
+ # name = CGI.une
47
+ # end
48
+ # end
49
+
42
50
  return {} if query_string.nil? || query_string == ""
43
51
  params = query_string.split("&").inject({}) do |params, param|
44
52
  name, value = param.split("=")
53
+ next params if value.nil?
45
54
  name = CGI.unescape(name)
46
55
  value = CGI.unescape(value)
47
56
  params.tap do
@@ -8,7 +8,11 @@ class Summon::RangeFacet < Summon::Schema
8
8
  def clear_filters_command
9
9
  "removeRangeFilter(#{field_name})"
10
10
  end
11
-
11
+
12
+ def range?
13
+ true
14
+ end
15
+
12
16
  def empty?
13
17
  false
14
18
  end
data/lib/summon.rb CHANGED
@@ -6,7 +6,7 @@ require 'cgi'
6
6
  require 'json'
7
7
 
8
8
  module Summon
9
- VERSION = "1.0.0"
9
+ VERSION = "1.1.0"
10
10
  require 'summon/log'
11
11
  require 'summon/service'
12
12
  require 'summon/transport'
@@ -54,6 +54,10 @@ describe Summon::Document do
54
54
  "Author": [
55
55
  "Hunter, Lisa"
56
56
  ],
57
+ "CorporateAuthor": [
58
+ "Hunter, Rick",
59
+ "Crusher, Beverly"
60
+ ],
57
61
  "PublicationDate": [
58
62
  "c2000."
59
63
  ],
@@ -67,7 +71,8 @@ describe Summon::Document do
67
71
  "gvsu_catalog_b16644323"
68
72
  ],
69
73
  "LCCallNum": [
70
- "M1630.18 .H95 2000"
74
+ "M1630.18 .H95 2000",
75
+ "M1630.20 .H95 2000"
71
76
  ],
72
77
  "Language": [
73
78
  "English"
@@ -121,7 +126,7 @@ describe Summon::Document do
121
126
  "Snippet": [
122
127
  "This is the snippet"
123
128
  ],
124
- "availabilityToken": "b16644323",
129
+ "availabilityId": "b16644323",
125
130
  "ContentType": [
126
131
  "Audio Recording"
127
132
  ],
@@ -166,6 +171,15 @@ describe Summon::Document do
166
171
  ],
167
172
  "DissertationSchool": [
168
173
  "West Virginia University"
174
+ ],
175
+ "thumbnail_s": [
176
+ "http://api.test.summon.serialssolutions.com:8093/image/isbn/YX3FL6LB6P/9781864879094/small"
177
+ ],
178
+ "thumbnail_l": [
179
+ "http://api.test.summon.serialssolutions.com:8093/image/isbn/YX3FL6LB6P/9781864879094/large"
180
+ ],
181
+ "thumbnail_m": [
182
+ "http://api.test.summon.serialssolutions.com:8093/image/isbn/YX3FL6LB6P/9781864879094/medium"
169
183
  ]
170
184
  }
171
185
  JSON
@@ -175,9 +189,14 @@ describe Summon::Document do
175
189
  abstract: This is the most awesome document ever
176
190
  authors:
177
191
  - Hunter, Lisa
178
- availability_token: b16644323
179
- call_number: M1630.18 .H95 2000
192
+ availability_id: b16644323
193
+ call_numbers:
194
+ - M1630.18 .H95 2000
195
+ - M1630.20 .H95 2000
180
196
  content_type: Audio Recording
197
+ corporate_authors:
198
+ - Hunter, Rick
199
+ - Crusher, Beverly
181
200
  dissertation_advisor: Claudio Friedmann
182
201
  dissertation_category: Education
183
202
  dissertation_degree: M.S.J.
@@ -225,9 +244,9 @@ subject_terms:
225
244
  - Popular music
226
245
  - Rock music
227
246
  subtitle: the life and death of Joey Stefano
228
- thumbnail_large:
229
- thumbnail_medium:
230
- thumbnail_small:
247
+ thumbnail_large: http://api.test.summon.serialssolutions.com:8093/image/isbn/YX3FL6LB6P/9781864879094/large
248
+ thumbnail_medium: http://api.test.summon.serialssolutions.com:8093/image/isbn/YX3FL6LB6P/9781864879094/medium
249
+ thumbnail_small: http://api.test.summon.serialssolutions.com:8093/image/isbn/YX3FL6LB6P/9781864879094/small
231
250
  title: Lisa Hunter -- alive
232
251
  url:
233
252
  volume:
@@ -90,6 +90,7 @@ describe Summon::Query do
90
90
  query_hash("s.fq=Balthazar&s.fq=Author_t%3A%28Linster%2C+Richard+L%29").should == {"s.fq" => ["Balthazar", "Author_t:(Linster, Richard L)"]}
91
91
  query_hash("s.fq=Author_t%3A%28Linster%2C+Richard+L%29&s.q=Probability+models+of+recidivism%5C%3A+an+exploration").should ==
92
92
  {"s.fq" => "Author_t:(Linster, Richard L)", "s.q" => "Probability models of recidivism\\: an exploration"}
93
+ query_hash("s.tl=&s.q=foo").should == {"s.q" => "foo"}
93
94
  end
94
95
 
95
96
  it "has params" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: summon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Lowell
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-09-29 00:00:00 -05:00
12
+ date: 2009-11-10 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -55,7 +55,6 @@ extra_rdoc_files:
55
55
  - Manifest.txt
56
56
  - PostInstall.txt
57
57
  files:
58
- - .specification
59
58
  - History.txt
60
59
  - Manifest.txt
61
60
  - PostInstall.txt
@@ -111,12 +110,12 @@ has_rdoc: true
111
110
  homepage: http://summon.rubyforge.org
112
111
  licenses: []
113
112
 
114
- post_install_message: |
113
+ post_install_message: |+
115
114
 
116
115
  For comprehensive documentation on Summon API options and usage visit:
117
116
 
118
117
  http://api.summon.serialssolutions.com
119
-
118
+
120
119
  rdoc_options:
121
120
  - --main
122
121
  - README.rdoc
data/.specification DELETED
@@ -1,58 +0,0 @@
1
- --- !ruby/object:Gem::Specification
2
- name: summon
3
- version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- platform: ruby
6
- authors: []
7
-
8
- autorequire:
9
- bindir: bin
10
- cert_chain: []
11
-
12
- date: 2009-07-15 00:00:00 -05:00
13
- default_executable:
14
- dependencies: []
15
-
16
- description:
17
- email:
18
- executables: []
19
-
20
- extensions: []
21
-
22
- extra_rdoc_files: []
23
-
24
- files:
25
- - lib
26
- - lib/summon
27
- - lib/summon.rb
28
- has_rdoc: true
29
- homepage:
30
- licenses: []
31
-
32
- post_install_message:
33
- rdoc_options: []
34
-
35
- require_paths:
36
- - bin
37
- - lib
38
- required_ruby_version: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: "0"
43
- version:
44
- required_rubygems_version: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- version: "0"
49
- version:
50
- requirements: []
51
-
52
- rubyforge_project:
53
- rubygems_version: 1.3.4
54
- signing_key:
55
- specification_version: 3
56
- summary:
57
- test_files: []
58
-