HoustonLibrarySearch 0.0.1 → 0.1.0

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.
@@ -0,0 +1,27 @@
1
+ require 'spec/spec_helper'
2
+
3
+ describe HCPL do
4
+ it "should have a url" do
5
+ HCPL.url(1).should == "http://catalog.hcpl.net/ipac20/ipac.jsp?index=ISBNEXH&term=1"
6
+ end
7
+
8
+ it "should parse a listing" do
9
+ listing = HCPL.parse(load_fixture("HCPL"))[0]
10
+ listing.location.should == "Cy-Fair Library"
11
+ listing.call_number.should == "005.1 Sei"
12
+ listing.status.should == "Checked out"
13
+ listing.due_date.should == "03/06/2010"
14
+ end
15
+
16
+ it "should have a name" do
17
+ HCPL.name.should == "Harris County Public Library"
18
+ end
19
+
20
+ it "should parse a book with status 'On Order'" do
21
+ listing = HCPL.parse(load_fixture("HCPL-order"))[0]
22
+ listing.location.should == "HCPL Aldine"
23
+ listing.call_number.should == "On Order"
24
+ listing.status.should == ""
25
+ listing.due_date.should == ""
26
+ end
27
+ end
@@ -0,0 +1,19 @@
1
+ require 'spec/spec_helper'
2
+
3
+ describe HPL do
4
+ it "should have a url" do
5
+ HPL.url(1).should == "http://catalog.houstonlibrary.org/search~S0/?searchtype=i&searcharg=1"
6
+ end
7
+
8
+ it "should parse a listing" do
9
+ listing = HPL.parse(load_fixture("HPL"))[0]
10
+ listing.location.should == "Central Nonfiction CIRC - 2nd 3rd fls"
11
+ listing.call_number.should == "542 K16"
12
+ listing.status.should == "Check shelf"
13
+ listing.due_date.should == ""
14
+ end
15
+
16
+ it "should have a name" do
17
+ HPL.name.should == "Houston Public Library"
18
+ end
19
+ end
@@ -0,0 +1,5 @@
1
+ require 'HoustonLibrarySearch'
2
+
3
+ def load_fixture(filename)
4
+ File.read("#{File.dirname(__FILE__)}/fixtures/#{filename}.html")
5
+ end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: HoustonLibrarySearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - Nelson Morris
@@ -9,29 +14,52 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-02-20 00:00:00 -06:00
17
+ date: 2010-03-07 00:00:00 -06:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: curb
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
23
- version: "0"
24
- version:
27
+ segments:
28
+ - 0
29
+ - 6
30
+ - 6
31
+ - 0
32
+ version: 0.6.6.0
33
+ type: :runtime
34
+ version_requirements: *id001
25
35
  - !ruby/object:Gem::Dependency
26
36
  name: nokogiri
37
+ prerelease: false
38
+ requirement: &id002 !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 1
44
+ - 4
45
+ - 1
46
+ version: 1.4.1
27
47
  type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
48
+ version_requirements: *id002
49
+ - !ruby/object:Gem::Dependency
50
+ name: rspec
51
+ prerelease: false
52
+ requirement: &id003 !ruby/object:Gem::Requirement
30
53
  requirements:
31
54
  - - ">="
32
55
  - !ruby/object:Gem::Version
33
- version: "0"
34
- version:
56
+ segments:
57
+ - 1
58
+ - 3
59
+ - 0
60
+ version: 1.3.0
61
+ type: :development
62
+ version_requirements: *id003
35
63
  description: Search Houston area libraries for ISBNs
36
64
  email: nmorris@nelsonmorris.net
37
65
  executables: []
@@ -41,14 +69,22 @@ extensions: []
41
69
  extra_rdoc_files: []
42
70
 
43
71
  files:
44
- - Gemfile
45
- - HoustonLibrarySearch.gemspec
72
+ - .gitignore
46
73
  - Rakefile
47
74
  - VERSION
48
75
  - lib/HoustonLibrarySearch.rb
49
- - lib/listing.rb
76
+ - lib/HoustonLibrarySearch/isbn.rb
77
+ - lib/HoustonLibrarySearch/listing.rb
50
78
  - lib/plugins/HCPL.rb
51
79
  - lib/plugins/HPL.rb
80
+ - spec/HoustonLibrarySearch/isbn_spec.rb
81
+ - spec/HoustonLibrarySearch/listing_spec.rb
82
+ - spec/fixtures/HCPL-order.html
83
+ - spec/fixtures/HCPL.html
84
+ - spec/fixtures/HPL.html
85
+ - spec/plugins/HPCL_spec.rb
86
+ - spec/plugins/HPL_spec.rb
87
+ - spec/spec_helper.rb
52
88
  has_rdoc: true
53
89
  homepage: http://github.com/xeqi/HoustonLibrarySearch
54
90
  licenses: []
@@ -62,20 +98,26 @@ required_ruby_version: !ruby/object:Gem::Requirement
62
98
  requirements:
63
99
  - - ">="
64
100
  - !ruby/object:Gem::Version
101
+ segments:
102
+ - 0
65
103
  version: "0"
66
- version:
67
104
  required_rubygems_version: !ruby/object:Gem::Requirement
68
105
  requirements:
69
106
  - - ">="
70
107
  - !ruby/object:Gem::Version
108
+ segments:
109
+ - 0
71
110
  version: "0"
72
- version:
73
111
  requirements: []
74
112
 
75
113
  rubyforge_project:
76
- rubygems_version: 1.3.5
114
+ rubygems_version: 1.3.6
77
115
  signing_key:
78
116
  specification_version: 3
79
117
  summary: Search Houston area libraries for ISBNs
80
- test_files: []
81
-
118
+ test_files:
119
+ - spec/plugins/HPCL_spec.rb
120
+ - spec/plugins/HPL_spec.rb
121
+ - spec/spec_helper.rb
122
+ - spec/HoustonLibrarySearch/listing_spec.rb
123
+ - spec/HoustonLibrarySearch/isbn_spec.rb
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source :gemcutter
2
- gem "nokogiri"
3
- gem "curb"
@@ -1,47 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = %q{HoustonLibrarySearch}
8
- s.version = "0.0.1"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Nelson Morris"]
12
- s.date = %q{2010-02-20}
13
- s.description = %q{Search Houston area libraries for ISBNs}
14
- s.email = %q{nmorris@nelsonmorris.net}
15
- s.files = [
16
- "Gemfile",
17
- "HoustonLibrarySearch.gemspec",
18
- "Rakefile",
19
- "VERSION",
20
- "lib/HoustonLibrarySearch.rb",
21
- "lib/listing.rb",
22
- "lib/plugins/HCPL.rb",
23
- "lib/plugins/HPL.rb"
24
- ]
25
- s.homepage = %q{http://github.com/xeqi/HoustonLibrarySearch}
26
- s.rdoc_options = ["--charset=UTF-8"]
27
- s.require_paths = ["lib"]
28
- s.rubygems_version = %q{1.3.5}
29
- s.summary = %q{Search Houston area libraries for ISBNs}
30
-
31
- if s.respond_to? :specification_version then
32
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
33
- s.specification_version = 3
34
-
35
- if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
36
- s.add_runtime_dependency(%q<curb>, [">= 0"])
37
- s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
38
- else
39
- s.add_dependency(%q<curb>, [">= 0"])
40
- s.add_dependency(%q<nokogiri>, [">= 0"])
41
- end
42
- else
43
- s.add_dependency(%q<curb>, [">= 0"])
44
- s.add_dependency(%q<nokogiri>, [">= 0"])
45
- end
46
- end
47
-
data/lib/listing.rb DELETED
@@ -1,12 +0,0 @@
1
-
2
- class Listing
3
-
4
- attr_reader :location, :call_number, :status, :due_date
5
-
6
- def initialize(location, call_number, status, due_date)
7
- @location = location
8
- @call_number = call_number
9
- @status = status
10
- @due_date = due_date
11
- end
12
- end