solo-rails 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +4 -4
- data/lib/solo-rails/version.rb +1 -1
- data/lib/solo-rails.rb +2 -0
- metadata +7 -7
data/README.md
CHANGED
@@ -12,7 +12,7 @@ The gem provides two methods `show` and `search`.
|
|
12
12
|
|
13
13
|
This takes a Solo CID parameter and returns the corresponding complete record e.g.
|
14
14
|
|
15
|
-
````{:id=>"491542", :request_url=>"http://
|
15
|
+
````{:id=>"491542", :request_url=>"http://example.com/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
16
|
|
17
17
|
### search method
|
18
18
|
|
@@ -32,13 +32,13 @@ This method accepts the same arguments as the API provides, see the Soutron docu
|
|
32
32
|
Use in a Rails app
|
33
33
|
------------------
|
34
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
|
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 SoloRails e.g. You must supply this class with the base uri of your Solo API.
|
36
36
|
|
37
37
|
````ruby
|
38
38
|
# app/models/library.rb
|
39
39
|
|
40
|
-
class Library
|
41
|
-
|
40
|
+
class Library < SoloRails
|
41
|
+
self.site = "http://example.com/Library/WebServices/SoutronApi.svc/"
|
42
42
|
end
|
43
43
|
````
|
44
44
|
|
data/lib/solo-rails/version.rb
CHANGED
data/lib/solo-rails.rb
CHANGED
@@ -23,6 +23,7 @@ class SoloRails
|
|
23
23
|
response[:id] = soutron_data.xpath("/soutron/catalogs_view/ct/cat").attribute("id").text
|
24
24
|
# response[:request_url] = url - removed for security/speed purposes - PG 2011-02-17
|
25
25
|
response[:content_type] = soutron_data.xpath("/soutron/catalogs_view/ct").attribute("name").text
|
26
|
+
response[:content_type_display] = soutron_data.xpath("/soutron/catalogs_view/ct").attribute("caption").text
|
26
27
|
response[:record_type] = soutron_data.xpath("/soutron/catalogs_view/ct/cat/rt").attribute("name").text
|
27
28
|
soutron_data.xpath("/soutron/catalogs_view/ct/cat/fs/f").each do |f|
|
28
29
|
if f.xpath("count(./vs/v)") > 0
|
@@ -104,6 +105,7 @@ class SoloRails
|
|
104
105
|
|
105
106
|
content_type = SoloHash.new
|
106
107
|
content_type.merge!( { "content_type".to_sym => ct.attribute("name").text } )
|
108
|
+
content_type.merge!( { "content_type_display".to_sym => ct.attribute("caption").text } )
|
107
109
|
content_type.merge!( { "size".to_sym => ct.attribute("count").text } )
|
108
110
|
|
109
111
|
@records = []
|
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.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-01-16 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &70119535693840 !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: *
|
24
|
+
version_requirements: *70119535693840
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: nokogiri
|
27
|
-
requirement: &
|
27
|
+
requirement: &70119535693020 !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: *
|
35
|
+
version_requirements: *70119535693020
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: chronic
|
38
|
-
requirement: &
|
38
|
+
requirement: &70119535692060 !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: *
|
46
|
+
version_requirements: *70119535692060
|
47
47
|
description: Provides methods to query Soutron Solo catalog from Ruby
|
48
48
|
email:
|
49
49
|
- github@modagoo.co.uk
|