shared_book 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +7 -0
- data/Manifest.txt +1 -0
- data/Rakefile +1 -1
- data/lib/shared_book.rb +2 -1
- data/spec/images/angry_squirrel.jpg +0 -0
- data/spec/lib/shared_book_spec.rb +2 -2
- metadata +7 -6
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/Rakefile
CHANGED
data/lib/shared_book.rb
CHANGED
@@ -95,7 +95,7 @@ class SharedBook
|
|
95
95
|
else
|
96
96
|
articles # expected to be hash with :chapterTitle and :chapterText
|
97
97
|
end
|
98
|
-
response = post_url("#{URL}/bmscreate/init", {:bookTitle => book_title}.merge(article_hash))
|
98
|
+
response = post_url("#{URL}/bmscreate/init", {:bookTitle => book_title, :theme => theme}.merge(article_hash))
|
99
99
|
@bms_id = parse_response(response, /\<bms id=\"(\d+)\"/)
|
100
100
|
end
|
101
101
|
|
@@ -241,6 +241,7 @@ private
|
|
241
241
|
def generate_signature(query)
|
242
242
|
str=""
|
243
243
|
query.keys.sort{|a,b| a.to_s <=> b.to_s}.each do |key|
|
244
|
+
next if key =='photo'
|
244
245
|
str << key.to_s+query[key] unless query[key].class == File
|
245
246
|
end
|
246
247
|
|
Binary file
|
@@ -95,7 +95,7 @@ describe SharedBook do
|
|
95
95
|
# expect
|
96
96
|
@sharedbook.should_receive(:post_url).with(
|
97
97
|
"#{SharedBook::URL}/bmscreate/init",
|
98
|
-
{:bookTitle=>"book title", :chapterTitle=>"chapter 1", :chapterText=>"text"}
|
98
|
+
{:bookTitle=>"book title", :chapterTitle=>"chapter 1", :chapterText=>"text", :theme => 'vanilla'}
|
99
99
|
).and_return(@return)
|
100
100
|
|
101
101
|
# given
|
@@ -108,7 +108,7 @@ describe SharedBook do
|
|
108
108
|
# expect
|
109
109
|
@sharedbook.should_receive(:post_url).with(
|
110
110
|
"#{SharedBook::URL}/bmscreate/init",
|
111
|
-
{:chapterText1=>"text", :bookTitle=>"book title", :chapterTitle2=>"chapter 2", :chapterText2=>"text", :chapterTitle1=>"chapter 1"}
|
111
|
+
{:chapterText1=>"text", :bookTitle=>"book title", :chapterTitle2=>"chapter 2", :chapterText2=>"text", :chapterTitle1=>"chapter 1", :theme=> 'vanilla'}
|
112
112
|
).and_return(@return)
|
113
113
|
|
114
114
|
# given
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shared_book
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 23
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 2
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Matthew Nielsen
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-02-16 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -70,6 +70,7 @@ files:
|
|
70
70
|
- Rakefile
|
71
71
|
- lib/shared_book.rb
|
72
72
|
- spec/lib/shared_book_spec.rb
|
73
|
+
- spec/images/angry_squirrel.jpg
|
73
74
|
- spec/spec.opts
|
74
75
|
- spec/spec_helper.rb
|
75
76
|
- tasks/rspec.rake
|
@@ -104,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
104
105
|
requirements: []
|
105
106
|
|
106
107
|
rubyforge_project: shared_book
|
107
|
-
rubygems_version: 1.
|
108
|
+
rubygems_version: 1.4.2
|
108
109
|
signing_key:
|
109
110
|
specification_version: 3
|
110
111
|
summary: A Ruby Gem to connect to the SharedBook.com publishing API
|