solo-rails 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/README.md ADDED
@@ -0,0 +1,49 @@
1
+ solo-rails
2
+ ==========
3
+
4
+ *solo-rails provides a wrapper around the API for [Soutron Solo](http://www.soutron.com/soutronsolo.html)*
5
+
6
+ Methods
7
+ -------
8
+
9
+ The gem provides two methods `show` and `search`.
10
+
11
+ ### show method
12
+
13
+ This takes a Solo CID parameter and returns the corresponding complete record e.g.
14
+
15
+ ````{:id=>"491542", :request_url=>"http://library.iser.essex.ac.uk/Library/WebServices/SoutronApi.svc/getcatalogue?id=491542", :content_type=>"Monograph", :record_type=>"Report", :cid=>491542, :created_by=>"Soutron Administrator", :created_by_office=>"Colchester", :created_date=>Thu, 15 Jan 1998, :last_edited_by=>"Soutron Administrator", :last_edited_date=>Wed, 06 Oct 2010, :locations=>"Hilary Doughty Research Library", :offices=>"Colchester", :title=>"Absolute and overall poverty in Britain in 1997: what the population themselves say: Bristol Poverty Line Survey: report of the second MORI Survey", :authors=>["Townsend, Peter", "Gordon, David", "Bradshaw, Jonathan", "Gosschalk, Brian"], :isbn=>"086292457X", :publication_date=>"01-11-1997 ", :publisher=>"Bristol Statistical Monitoring Unit", :shelf_reference=>"316.344.233", :keywords=>["Social policy", "Poverty"], :subjects=>["HOUSEHOLDS", "INCOME DYNAMICS", "SOCIAL STRATIFICATION", "SOCIAL STRUCTURE", "WELFARE BENEFITS"], :record_type_detail=>"report", :id_textworks=>"155805", :place=>"Bristol"}````
16
+
17
+ ### search method
18
+
19
+ This accepts parameters from the Solo API and returns the corresponding record set e.g.
20
+
21
+ ````ruby
22
+ @records = Libary.search :q => 'Series:"ISER Working Paper Series"',
23
+ :select => 'Title;Authors;Series Number;Series;Publication Date',
24
+ :sort => 'Publication Date:d',
25
+ :per_page => 30,
26
+ :search_id => params[:search_id],
27
+ :page => params[:page]
28
+ ````
29
+
30
+ This method accepts the same arguments as the API provides, see the Soutron documentation for further detail.
31
+
32
+ Use in a Rails app
33
+ ------------------
34
+
35
+ The simplest way to use the methods in a Rails app is to add the gem requirement to your Gemfile then create a class which extends from it e.g.
36
+
37
+ ````ruby
38
+ # app/models/library.rb
39
+
40
+ class Library
41
+ extend solo-rails
42
+ end
43
+ ````
44
+
45
+ This will allow you to call the methods from controllers with
46
+
47
+ Library.show("123456")
48
+
49
+ and the search method as above.
@@ -1,5 +1,5 @@
1
1
  module Solo
2
2
  module Rails
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
- end
5
+ end
data/lib/solo-rails.rb CHANGED
@@ -4,267 +4,254 @@ require 'open-uri'
4
4
  require 'chronic'
5
5
  require 'nokogiri'
6
6
 
7
- module SoloRails
7
+ class SoloRails
8
8
 
9
- def show(id)
10
- Catalogue.new.show(id)
11
- end
12
-
13
- def search(*args)
14
- Catalogue.new.search(*args)
15
- end
9
+ class << self
16
10
 
17
- class Catalogue
18
-
19
- def initialize
20
- # @site = "http://iser-training.soutron.net/Library/WebServices/SoutronApi.svc/"
21
- @site = "http://library.iser.essex.ac.uk/Library/WebServices/SoutronApi.svc/"
11
+ def site=(site)
12
+ @site = site
22
13
  end
23
14
 
24
- # returns SoloHash of values for individual catalogue record
25
- def show(id)
26
- response = SoloHash.new
27
- url = "#{@site}getcatalogue?id=#{CGI.escape(id)}"
28
- begin
29
- soutron_data = Nokogiri::XML(open(url))
30
- response[:id] = soutron_data.xpath("/soutron/catalogs_view/ct/cat").attribute("id").text
31
- # response[:request_url] = url - removed for security/speed purposes - PG 2011-02-17
32
- response[:content_type] = soutron_data.xpath("/soutron/catalogs_view/ct").attribute("name").text
33
- response[:record_type] = soutron_data.xpath("/soutron/catalogs_view/ct/cat/rt").attribute("name").text
34
- soutron_data.xpath("/soutron/catalogs_view/ct/cat/fs/f").each do |f|
35
- if f.xpath("count(./vs/v)") > 0
36
- response[uscore(f.attribute("name").text).to_sym] = parse_values(f.attribute("ft").text, f.xpath("./vs/v"))
37
- end
38
- end
15
+ end
39
16
 
40
- # related records - PG 2011-03-01
41
- if soutron_data.xpath("count(/soutron/catalogs_view/ct/cat/related_catalogs)") > 0
42
- @related_records = []
43
- soutron_data.xpath("/soutron/catalogs_view/ct/cat/related_catalogs/ct").each do |related_ct|
44
- related_record = SoloHash.new
45
- related_record.merge!( { "content_type".to_sym => related_ct.attribute("name").text } )
46
- related_ct.xpath('ctlgs/cat').each do |r|
47
- related_record.merge!( {"cid".to_sym => r.attribute("id").text } )
48
- end
49
- @related_records << related_record
50
- end
51
- response[:related_records] = @related_records
17
+ # returns SoloHash of values for individual catalogue record
18
+ def self.show(id)
19
+ response = SoloHash.new
20
+ url = "#{@site}getcatalogue?id=#{CGI.escape(id)}"
21
+ begin
22
+ soutron_data = Nokogiri::XML(open(url, :read_timeout => 180))
23
+ response[:id] = soutron_data.xpath("/soutron/catalogs_view/ct/cat").attribute("id").text
24
+ # response[:request_url] = url - removed for security/speed purposes - PG 2011-02-17
25
+ response[:content_type] = soutron_data.xpath("/soutron/catalogs_view/ct").attribute("name").text
26
+ response[:record_type] = soutron_data.xpath("/soutron/catalogs_view/ct/cat/rt").attribute("name").text
27
+ soutron_data.xpath("/soutron/catalogs_view/ct/cat/fs/f").each do |f|
28
+ if f.xpath("count(./vs/v)") > 0
29
+ response[uscore(f.attribute("name").text).to_sym] = parse_values(f.attribute("ft").text, f.xpath("./vs/v"))
52
30
  end
31
+ end
53
32
 
54
- rescue
55
- response = "Record #{id} not found"
33
+ # find related records - PG 2011-03-01
34
+ if soutron_data.xpath("count(/soutron/catalogs_view/ct/cat/related_catalogs)") > 0
35
+ @related_records = []
36
+ soutron_data.xpath("/soutron/catalogs_view/ct/cat/related_catalogs/ct").each do |related_ct|
37
+ related_record = SoloHash.new
38
+ related_record.merge!( { "content_type".to_sym => related_ct.attribute("name").text } )
39
+ related_ct.xpath('ctlgs/cat').each do |r|
40
+ related_record.merge!( {"cid".to_sym => r.attribute("id").text } )
41
+ end
42
+ @related_records << related_record
43
+ end
44
+ response[:related_records] = @related_records
56
45
  end
57
- return response
46
+
47
+ rescue
48
+ response = "Record #{id} not found"
58
49
  end
50
+ return response
51
+ end
59
52
 
60
- # returns nested hash record for given search - PG 2011-01-21
61
- def search(*args)
62
- options = args.pop
63
- q, ctrt, select, sort, page, material, search_id, per_page, ignore_is_website_feature = iser_solo_parse_options(options)
53
+ # returns nested hash record for given search - PG 2011-01-21
54
+ def self.search(*args)
55
+ options = args.pop
56
+ q, ctrt, select, sort, page, material, search_id, per_page, ignore_is_website_feature = iser_solo_parse_options(options)
64
57
 
65
- # If we have a value of search_id, then should only also pass: search_id, select, sort, page, per_page & material
66
- url = "#{@site}searchcatalogues?"
67
- query_string = []
58
+ # If we have a value of search_id, then should only also pass: search_id, select, sort, page, per_page & material
59
+ url = "#{@site}searchcatalogues?"
60
+ query_string = []
68
61
 
69
- if search_id.present?
70
- query_string << "searchid=#{search_id}"
71
- else
72
- query_string << "q=#{q}"
73
- query_string << "ctrt=#{ctrt}" if ctrt.present?
74
- end
62
+ if search_id.present?
63
+ query_string << "searchid=#{search_id}"
64
+ else
65
+ query_string << "q=#{q}"
66
+ query_string << "ctrt=#{ctrt}" if ctrt.present?
67
+ end
75
68
 
76
- query_string << "page=#{page}" if page.present?
77
- query_string << "pageSize=#{per_page}" if per_page.present?
78
- query_string << "sort=#{sort}" if sort.present?
79
- query_string << "fields=#{select}" if select.present?
80
- query_string << "material=#{material}" if material.present?
69
+ query_string << "page=#{page}" if page.present?
70
+ query_string << "pageSize=#{per_page}" if per_page.present?
71
+ query_string << "sort=#{sort}" if sort.present?
72
+ query_string << "fields=#{select}" if select.present?
73
+ query_string << "material=#{material}" if material.present?
81
74
 
82
- url += query_string.join("&")
75
+ url += query_string.join("&")
83
76
 
84
- p "Fetching SOLO data from: #{url}"
77
+ p "Fetching SOLO data from: #{url}"
85
78
 
86
- begin
87
- soutron_data = Nokogiri::XML(open(url, :read_timeout => 180))
88
- rescue Exception => e
89
- Rails.logger.info("SOLO Error in URL: " + url)
90
- end
79
+ begin
80
+ soutron_data = Nokogiri::XML(open(url, :read_timeout => 180))
81
+ rescue Exception => e
82
+ # Rails.logger.info("SOLO Error in URL: " + url)
83
+ end
91
84
 
92
- response = SoloHash.new
93
- Rails.logger.info("#{soutron_data.xpath("/soutron/search_info").attribute("id").text}")
94
- meta = {:id => soutron_data.xpath("/soutron/search_info").attribute("id").text}
95
- meta["total_items".to_sym] = soutron_data.xpath("/soutron/search_info").attribute("totalItems").text
96
- meta["page".to_sym] = page
97
- meta["per_page".to_sym] = per_page
98
- meta["select".to_sym] = select
99
-
100
- if soutron_data.xpath("count(//ct)") > 0
101
- unless soutron_data.xpath("/soutron/search_info/catalogs_view/ct[*]").first.nil?
102
- meta["active_content_type".to_sym] = soutron_data.xpath("/soutron/search_info/catalogs_view/ct[*]").first.attribute("name").text
103
- meta["active_content_type_count".to_sym] = soutron_data.xpath("/soutron/search_info/catalogs_view/ct[*]").first.attribute("count").text
104
- end
85
+ response = SoloHash.new
86
+ Rails.logger.info("#{soutron_data.xpath("/soutron/search_info").attribute("id").text}")
87
+ meta = {:id => soutron_data.xpath("/soutron/search_info").attribute("id").text}
88
+ meta["total_items".to_sym] = soutron_data.xpath("/soutron/search_info").attribute("totalItems").text
89
+ meta["page".to_sym] = page
90
+ meta["per_page".to_sym] = per_page
91
+ meta["select".to_sym] = select
92
+
93
+ if soutron_data.xpath("count(//ct)") > 0
94
+ unless soutron_data.xpath("/soutron/search_info/catalogs_view/ct[*]").first.nil?
95
+ meta["active_content_type".to_sym] = soutron_data.xpath("/soutron/search_info/catalogs_view/ct[*]").first.attribute("name").text
96
+ meta["active_content_type_count".to_sym] = soutron_data.xpath("/soutron/search_info/catalogs_view/ct[*]").first.attribute("count").text
105
97
  end
98
+ end
106
99
 
107
- # meta["request_url".to_sym] = url
108
- response.merge!("search_info".to_sym => meta)
100
+ response.merge!("search_info".to_sym => meta)
109
101
 
110
- @content_types = []
111
- soutron_data.xpath("/soutron/search_info/catalogs_view/ct").each do |ct|
102
+ @content_types = []
103
+ soutron_data.xpath("/soutron/search_info/catalogs_view/ct").each do |ct|
112
104
 
113
- content_type = SoloHash.new
114
- content_type.merge!( { "content_type".to_sym => ct.attribute("name").text } )
115
- content_type.merge!( { "size".to_sym => ct.attribute("count").text } )
105
+ content_type = SoloHash.new
106
+ content_type.merge!( { "content_type".to_sym => ct.attribute("name").text } )
107
+ content_type.merge!( { "size".to_sym => ct.attribute("count").text } )
116
108
 
117
- @records = []
118
- ct.xpath("./ctlgs/cat").each do |cat|
109
+ @records = []
110
+ ct.xpath("./ctlgs/cat").each do |cat|
119
111
 
120
- record = SoloHash.new
121
- record.merge!( {:id => cat.attribute("id").text, :record_type => cat.xpath("./rt").attribute("name").text} )
112
+ record = SoloHash.new
113
+ record.merge!( {:id => cat.attribute("id").text, :record_type => cat.xpath("./rt").attribute("name").text} )
122
114
 
123
- cat.xpath("./fs/f").each do |f|
124
- if f.xpath("count(./vs/v)") > 0 # only include field if it has a value
125
- record[uscore(f.attribute("name").text).to_sym] = parse_values(f.attribute("ft").text, f.xpath("./vs/v"))
126
- end # / if has value
127
- end # /f
115
+ cat.xpath("./fs/f").each do |f|
116
+ if f.xpath("count(./vs/v)") > 0 # only include field if it has a value
117
+ record[uscore(f.attribute("name").text).to_sym] = parse_values(f.attribute("ft").text, f.xpath("./vs/v"))
118
+ end # / if has value
119
+ end # /f
128
120
 
129
- @records << record
121
+ @records << record
130
122
 
131
- end # /cat
123
+ end # /cat
132
124
 
133
- content_type.merge!({"records".to_sym => @records })
134
- @content_types << content_type
125
+ content_type.merge!({"records".to_sym => @records })
126
+ @content_types << content_type
135
127
 
136
- end # /ct
128
+ end # /ct
137
129
 
138
- response.merge!(:content_types => @content_types)
130
+ response.merge!(:content_types => @content_types)
139
131
 
140
- return response
141
- end
132
+ return response
133
+ end
142
134
 
143
- def self.published_years(record_type, limit=nil, q=nil)
144
- q.nil? ? q = "Is Website Feature:Y" : q << ";Is Website Feature:Y"
145
- newest_record = IserSolo.new.search :q => q,
146
- :per_page => 1,
147
- :sort => "Publication Date:d",
148
- :select => "Publication Date",
149
- :ctrt => ":#{record_type}"
150
- d = newest_record.content_types.first.records.first.publication_date
151
- if (d.to_s =~ /(20|19)\d{2}/) != 0
152
- newest_year = Chronic.parse("#{d}").year
153
- else
154
- newest_year = Chronic.parse("01 Jan #{d}").year
155
- end
135
+ def self.published_years(record_type, limit=nil, q=nil)
136
+ q.nil? ? q = "Is Website Feature:Y" : q << ";Is Website Feature:Y"
137
+ newest_record = IserSolo.new.search :q => q,
138
+ :per_page => 1,
139
+ :sort => "Publication Date:d",
140
+ :select => "Publication Date",
141
+ :ctrt => ":#{record_type}"
142
+ d = newest_record.content_types.first.records.first.publication_date
143
+ if (d.to_s =~ /(20|19)\d{2}/) != 0
144
+ newest_year = Chronic.parse("#{d}").year
145
+ else
146
+ newest_year = Chronic.parse("01 Jan #{d}").year
147
+ end
156
148
 
157
- oldest_record = IserSolo.new.search :q => q,
158
- :per_page => 1,
159
- :sort => "Publication Date:a",
160
- :select => "Publication Date",
161
- :ctrt => ":#{record_type}"
162
- d = oldest_record.content_types.first.records.first.publication_date
163
- if (d.to_s =~ /(20|19)\d{2}/) != 0
164
- oldest_year = Chronic.parse("#{d}").year
165
- else
166
- oldest_year = Chronic.parse("01 Jan #{d}").year
167
- end
168
- if limit.nil?
169
- newest_year.downto(oldest_year)
170
- else
171
- Range.new(oldest_year, newest_year).to_a.reverse[0..limit]
172
- end
149
+ oldest_record = IserSolo.new.search :q => q,
150
+ :per_page => 1,
151
+ :sort => "Publication Date:a",
152
+ :select => "Publication Date",
153
+ :ctrt => ":#{record_type}"
154
+ d = oldest_record.content_types.first.records.first.publication_date
155
+ if (d.to_s =~ /(20|19)\d{2}/) != 0
156
+ oldest_year = Chronic.parse("#{d}").year
157
+ else
158
+ oldest_year = Chronic.parse("01 Jan #{d}").year
159
+ end
160
+ if limit.nil?
161
+ newest_year.downto(oldest_year)
162
+ else
163
+ Range.new(oldest_year, newest_year).to_a.reverse[0..limit]
173
164
  end
165
+ end
174
166
 
175
- private
167
+ private
176
168
 
177
- # returns array of URL safe variables from options
178
- def iser_solo_parse_options(options)
179
- q = options[:q]
180
- unless options[:ignore_is_website_feature] == true
181
- q.nil? ? nil : q << ";Is ISER Staff Publication:Y"
182
- end
183
- # unless options[:ignore_is_website_feature] == true
184
- # q.nil? ? nil : q << ";Is Website Feature:Y"
185
- # end
186
- ctrt = options[:ctrt]
187
- select = options[:select]
188
- sort = options[:sort]
189
- page = options[:page]
190
- material = options[:material]
191
- search_id = options[:search_id]
192
- per_page = options[:per_page].blank? ? 20 : options[:per_page]
193
- url_safe([q, ctrt, select, sort, page, material, search_id, per_page])
169
+ # returns array of URL safe variables from options
170
+ def self.iser_solo_parse_options(options)
171
+ q = options[:q]
172
+ unless options[:ignore_is_website_feature] == true
173
+ q.nil? ? nil : q << ";Is ISER Staff Publication:Y"
194
174
  end
175
+ ctrt = options[:ctrt]
176
+ select = options[:select]
177
+ sort = options[:sort]
178
+ page = options[:page]
179
+ material = options[:material]
180
+ search_id = options[:search_id]
181
+ per_page = options[:per_page].blank? ? 20 : options[:per_page]
182
+ url_safe([q, ctrt, select, sort, page, material, search_id, per_page])
183
+ end
195
184
 
196
- # CGI escapes 'options' array to make safe URLs
197
- def url_safe(options)
198
- options.collect! { |option| CGI.escape(option.to_s) }
199
- end
185
+ # CGI escapes 'options' array to make safe URLs
186
+ def self.url_safe(options)
187
+ options.collect! { |option| CGI.escape(option.to_s) }
188
+ end
200
189
 
201
- # Returns values for a field based on field type, either individual value or array
202
- def parse_values(field_type, elements)
203
- if elements.size > 1
204
- value = elements.collect{|v| parse_value(field_type, v)}
205
- else
206
- value = parse_value(field_type, elements.first)
207
- end
190
+ # Returns values for a field based on field type, either individual value or array
191
+ def self.parse_values(field_type, elements)
192
+ if elements.size > 1
193
+ value = elements.collect{|v| parse_value(field_type, v)}
194
+ else
195
+ value = parse_value(field_type, elements.first)
208
196
  end
197
+ end
209
198
 
210
- # returns value based on field type
211
- # @field_types = {
212
- # 1 => "Text",
213
- # 2 => "Integer",
214
- # 3 => "Date",
215
- # 4 => "File",
216
- # 5 => "Thesaurus",
217
- # 6 => "Validation List",
218
- # 7 => "URL",
219
- # 8 => "Complex Date",
220
- # 9 => "Decimal",
221
- # 10 => "Image",
222
- # 11 => "Rich Text",
223
- # 12 => "User"
224
- # }
225
- def parse_value(field_type, element)
226
- field_type = field_type.to_i
227
- case field_type
228
- when 1, 4, 5, 6, 11, 12 then element.text.to_s
229
- when 2 then element.text.to_i
230
- when 3 then Date.parse(element.text.to_s)
231
- # when 3 then element.text.to_s
232
- when 7 then element.text.to_s
233
- # if element.attribute("desc").value.size > 0 && !element.attribute("desc").value.eql?(element.text.to_s)
234
- # "#{element.attribute("desc")} - #{ActionController::Base.helpers.auto_link(element.text.to_s)}"
235
- # else
236
- # ActionController::Base.helpers.auto_link(element.text.to_s)
237
- # end
238
- when 8 then parse_complex_date(element)
239
- else field_type
240
- end
199
+ # returns value based on field type
200
+ # @field_types = {
201
+ # 1 => "Text",
202
+ # 2 => "Integer",
203
+ # 3 => "Date",
204
+ # 4 => "File",
205
+ # 5 => "Thesaurus",
206
+ # 6 => "Validation List",
207
+ # 7 => "URL",
208
+ # 8 => "Complex Date",
209
+ # 9 => "Decimal",
210
+ # 10 => "Image",
211
+ # 11 => "Rich Text",
212
+ # 12 => "User"
213
+ # }
214
+ def self.parse_value(field_type, element)
215
+ field_type = field_type.to_i
216
+ case field_type
217
+ when 1, 4, 5, 6, 11, 12 then element.text.to_s
218
+ when 2 then element.text.to_i
219
+ when 3 then Date.parse(element.text.to_s)
220
+ # when 3 then element.text.to_s
221
+ when 7 then element.text.to_s
222
+ # if element.attribute("desc").value.size > 0 && !element.attribute("desc").value.eql?(element.text.to_s)
223
+ # "#{element.attribute("desc")} - #{ActionController::Base.helpers.auto_link(element.text.to_s)}"
224
+ # else
225
+ # ActionController::Base.helpers.auto_link(element.text.to_s)
226
+ # end
227
+ when 8 then parse_complex_date(element)
228
+ else field_type
241
229
  end
230
+ end
242
231
 
243
- # attempts to make ruby Date or failsover to string from SOLO complex date field - PG 2011-04-08
244
- def parse_complex_date(element)
245
- d = element.text.split("-")
246
- date = []
247
- date << "%02d" % d[2] unless d[2].nil?
248
- date << "%02d" % d[1] unless d[1].nil?
249
- date << d[0] unless d[0].nil?
250
- circa = "circa " if element.attribute("circa").to_s == "1"
251
- nodate = "forthcoming " if element.attribute("nodate").to_s == "1"
252
- ongoing = "ongoing" if element.attribute("ongoing").to_s == "1"
253
- begin
254
- ret = Date.parse("#{date[0]}-#{date[1]}-#{date[2]}")
255
- rescue
256
- ret = "#{circa}#{nodate}#{date.join("-")} #{ongoing}".capitalize
257
- end
258
- ret
232
+ # attempts to make ruby Date or failsover to string from SOLO complex date field - PG 2011-04-08
233
+ def self.parse_complex_date(element)
234
+ d = element.text.split("-")
235
+ date = []
236
+ date << "%02d" % d[2] unless d[2].nil?
237
+ date << "%02d" % d[1] unless d[1].nil?
238
+ date << d[0] unless d[0].nil?
239
+ circa = "circa " if element.attribute("circa").to_s == "1"
240
+ nodate = "forthcoming " if element.attribute("nodate").to_s == "1"
241
+ ongoing = "ongoing" if element.attribute("ongoing").to_s == "1"
242
+ begin
243
+ ret = Date.parse("#{date[0]}-#{date[1]}-#{date[2]}")
244
+ rescue
245
+ ret = "#{circa}#{nodate}#{date.join("-")} #{ongoing}".capitalize
259
246
  end
247
+ ret
248
+ end
260
249
 
261
- # removes spaces from 'str' and then applies rails underscore method
262
- # converts strings like "Publication Date" into "publication_date"
263
- def uscore(str)
264
- str.gsub(/\s*/,"").underscore
265
- end
266
-
267
- end
250
+ # removes spaces from 'str' and then applies rails underscore method
251
+ # converts strings like "Publication Date" into "publication_date"
252
+ def self.uscore(str)
253
+ str.gsub(/\s*/,"").underscore
254
+ end
268
255
 
269
256
  end
270
257
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solo-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-13 00:00:00.000000000 Z
12
+ date: 2012-01-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70095837742940 !ruby/object:Gem::Requirement
16
+ requirement: &70311651644080 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70095837742940
24
+ version_requirements: *70311651644080
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: nokogiri
27
- requirement: &70095837742140 !ruby/object:Gem::Requirement
27
+ requirement: &70311651643420 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70095837742140
35
+ version_requirements: *70311651643420
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: chronic
38
- requirement: &70095837741340 !ruby/object:Gem::Requirement
38
+ requirement: &70311651642360 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70095837741340
46
+ version_requirements: *70311651642360
47
47
  description: Provides methods to query Soutron Solo catalog from Ruby
48
48
  email:
49
49
  - github@modagoo.co.uk
@@ -53,10 +53,9 @@ extra_rdoc_files: []
53
53
  files:
54
54
  - .gitignore
55
55
  - Gemfile
56
- - README
56
+ - README.md
57
57
  - Rakefile
58
58
  - lib/solo-rails.rb
59
- - lib/solo-rails/helpers.rb
60
59
  - lib/solo-rails/version.rb
61
60
  - solo-rails.gemspec
62
61
  homepage: ''
data/README DELETED
@@ -1,20 +0,0 @@
1
- SoloRails
2
-
3
- This gem provides a Ruby wrapper for the Soutron Solo API.
4
-
5
- It provides two methods, one to search the catalogue and one to fetch a specific record.
6
-
7
- Search method
8
-
9
- @records = Library.search :q => '',
10
- :select => 'Title;Authors;Created Date',
11
- :search_id => @records[:search_info].fetch(:id),
12
- :ctrt => ct,
13
- :sort => 'Created Date:d',
14
- :material => ct[:content_type],
15
- :per_page => 30,
16
- :page => 0
17
-
18
- Show
19
-
20
- @record = Librar.search("1234556")
@@ -1,5 +0,0 @@
1
- module Helpers
2
- # def sh(cid)
3
- # SoloRails::Catalogue.new.show("520276")
4
- # end
5
- end