rbook 0.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +4 -3
- data/lib/rbook/titlepage/client.rb +12 -0
- data/lib/rbook/www/base.rb +1 -1
- data/test/unit/titlepage_test.rb +13 -0
- metadata +2 -2
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ require 'rake/testtask'
|
|
5
5
|
require "rake/gempackagetask"
|
6
6
|
require "rubygems"
|
7
7
|
|
8
|
-
PKG_VERSION = "0.2"
|
8
|
+
PKG_VERSION = "0.2.1"
|
9
9
|
PKG_NAME = "rbook"
|
10
10
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
11
11
|
RUBYFORGE_PROJECT = 'rbook'
|
@@ -89,7 +89,7 @@ desc "Publish the release files to RubyForge."
|
|
89
89
|
|
90
90
|
task :publish => [:package] do
|
91
91
|
|
92
|
-
files = ['gem', 'tgz', 'zip'].map { |ext| "pkg/#{PKG_NAME}.#{ext}" }
|
92
|
+
files = ['gem', 'tgz', 'zip'].map { |ext| "pkg/#{PKG_NAME}-#{PKG_VERSION}.#{ext}" }
|
93
93
|
|
94
94
|
if RUBYFORGE_PROJECT then
|
95
95
|
require 'net/http'
|
@@ -154,7 +154,7 @@ task :publish => [:package] do
|
|
154
154
|
{
|
155
155
|
'group_id' => group_id,
|
156
156
|
'package_id' => package_id,
|
157
|
-
'release_name' =>
|
157
|
+
'release_name' => PKG_VERSION,
|
158
158
|
'release_date' => release_date,
|
159
159
|
'type_id' => type,
|
160
160
|
'processor_id' => '8000', # Any
|
@@ -196,6 +196,7 @@ task :publish => [:package] do
|
|
196
196
|
end
|
197
197
|
|
198
198
|
if first_file then
|
199
|
+
puts release_response.body
|
199
200
|
release_id = release_response.body[/release_id=(\d+)/, 1]
|
200
201
|
raise("Couldn't get release id") unless release_id
|
201
202
|
end
|
@@ -56,6 +56,18 @@ module RBook
|
|
56
56
|
|
57
57
|
end
|
58
58
|
|
59
|
+
# a convenience method to make single queries to title page a little cleaner.
|
60
|
+
#
|
61
|
+
# result = RBook::TitlePage.find("username","password","9780091835132")
|
62
|
+
# puts result.inspect
|
63
|
+
def self.find(username, password, isbn, driver = nil)
|
64
|
+
result = nil
|
65
|
+
RBook::TitlePage::Client.open(username, password, driver) do |tp|
|
66
|
+
result = tp.find(isbn)
|
67
|
+
end
|
68
|
+
return result
|
69
|
+
end
|
70
|
+
|
59
71
|
# a convenience method to make queries to title page a little cleaner. This function
|
60
72
|
# essentially calls the login and logout functions for you automatically.
|
61
73
|
#
|
data/lib/rbook/www/base.rb
CHANGED
data/test/unit/titlepage_test.rb
CHANGED
@@ -39,6 +39,19 @@ class TitlePageTest < Test::Unit::TestCase
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
42
|
+
# ensure searching for a title using the static method works
|
43
|
+
def test_search_using_static_method
|
44
|
+
unless RUBY_VERSION >= "1.8.3"
|
45
|
+
warn "Ruby version >= 1.8.3 required to use the titlepage library. Skipping unit test"
|
46
|
+
return
|
47
|
+
end
|
48
|
+
|
49
|
+
result = RBook::TitlePage::Client.find("test","apa", "9780091835132", RBook::TitlePage::MockTitlePageDriver.new)
|
50
|
+
|
51
|
+
assert_kind_of RBook::TitlePage::SearchResults, result
|
52
|
+
assert_not_equal nil, result.Product
|
53
|
+
end
|
54
|
+
|
42
55
|
# ensure searching for a title that is in stock returns a SearchResults object
|
43
56
|
def test_title_in_stock
|
44
57
|
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rbook
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version:
|
7
|
-
date: 2006-10-
|
6
|
+
version: 0.2.1
|
7
|
+
date: 2006-10-18 00:00:00 +10:00
|
8
8
|
summary: A collection of classes and modules for working with bibliographic data
|
9
9
|
require_paths:
|
10
10
|
- lib
|