summon 1.1.7 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+
2
+ === 1.1.8 2010-03-08
3
+ * 1 minor enhancements
4
+ * added from_library? to see if a document is from the library catalog
5
+
1
6
  === 1.1.7 2010-02-18
2
7
  * 1 minor enhancement
3
8
  * allow locale to be specified as either a string or a symbol
@@ -94,6 +94,11 @@ class Summon::Document < Summon::Schema
94
94
  def local_content_type
95
95
  translate(@content_type)
96
96
  end
97
+
98
+ def from_library?
99
+ @availability_id != nil
100
+ end
101
+
97
102
  end
98
103
 
99
104
 
data/lib/summon.rb CHANGED
@@ -6,7 +6,7 @@ require 'cgi'
6
6
  require 'json'
7
7
 
8
8
  module Summon
9
- VERSION = "1.1.7"
9
+ VERSION = "1.1.8"
10
10
  DEFAULT_LOCALE = 'en'
11
11
  require 'summon/locales/en'
12
12
  require 'summon/locales/fr'
@@ -8,6 +8,20 @@ describe Summon::Document do
8
8
  doc.authors.each {|a| a.remove_src }
9
9
  doc.to_yaml.should == EXPECTED_DOCUMENT_YAML
10
10
  end
11
+
12
+ describe "from_library?" do
13
+ it "should return true if the document has an availability_id" do
14
+ doc = Summon::Document.new(@service, JSON.parse(EXAMPLE_DOCUMENT_JSON))
15
+ doc.from_library?.should be(true)
16
+ end
17
+
18
+ it "should return false if the document doesn't have an availability_id" do
19
+ document_data = JSON.parse(EXAMPLE_DOCUMENT_JSON)
20
+ document_data.delete('availabilityId')
21
+ doc = Summon::Document.new(@service, document_data)
22
+ doc.from_library?.should be(false)
23
+ end
24
+ end
11
25
 
12
26
  EXAMPLE_DOCUMENT_JSON = <<-JSON
13
27
  {
data/summon.gemspec CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Charles Lowell"]
9
- s.date = %q{2010-02-18}
9
+ s.date = %q{2010-03-08}
10
10
  s.description = %q{Ruby language bindings for Serials Solutions Summon Unified Discovery Service}
11
11
  s.email = ["cowboyd@thefrontside.net"]
12
12
  s.executables = ["summon", "summonh"]
@@ -32,15 +32,15 @@ http://api.summon.serialssolutions.com
32
32
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
33
33
  s.add_runtime_dependency(%q<json>, [">= 1.2.0"])
34
34
  s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
35
- s.add_development_dependency(%q<hoe>, [">= 2.3.3"])
35
+ s.add_development_dependency(%q<hoe>, [">= 2.5.0"])
36
36
  else
37
37
  s.add_dependency(%q<json>, [">= 1.2.0"])
38
38
  s.add_dependency(%q<rspec>, [">= 1.2.9"])
39
- s.add_dependency(%q<hoe>, [">= 2.3.3"])
39
+ s.add_dependency(%q<hoe>, [">= 2.5.0"])
40
40
  end
41
41
  else
42
42
  s.add_dependency(%q<json>, [">= 1.2.0"])
43
43
  s.add_dependency(%q<rspec>, [">= 1.2.9"])
44
- s.add_dependency(%q<hoe>, [">= 2.3.3"])
44
+ s.add_dependency(%q<hoe>, [">= 2.5.0"])
45
45
  end
46
46
  end
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.1.7
4
+ version: 1.1.8
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: 2010-02-18 00:00:00 -06:00
12
+ date: 2010-03-08 00:00:00 -06:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: 2.3.3
43
+ version: 2.5.0
44
44
  version:
45
45
  description: Ruby language bindings for Serials Solutions Summon Unified Discovery Service
46
46
  email: