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 CHANGED
@@ -1,3 +1,10 @@
1
+ === 0.2.0 2011-02-15
2
+
3
+ * added theme support
4
+ * do not attempt to add binary photo data to the signature hash
5
+
6
+ === 0.1.0
7
+
1
8
  === 0.0.1 2010-11-08
2
9
 
3
10
  * Initial release
data/Manifest.txt CHANGED
@@ -4,6 +4,7 @@ README.rdoc
4
4
  Rakefile
5
5
  lib/shared_book.rb
6
6
  spec/lib/shared_book_spec.rb
7
+ spec/images/angry_squirrel.jpg
7
8
  spec/spec.opts
8
9
  spec/spec_helper.rb
9
10
  tasks/rspec.rake
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ require 'hoe'
5
5
  require 'fileutils'
6
6
  require './lib/shared_book'
7
7
 
8
- VERSION = "0.1.0"
8
+ VERSION = "0.2.0"
9
9
 
10
10
  Hoe.plugin :newgem
11
11
 
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: 27
5
- prerelease: false
4
+ hash: 23
5
+ prerelease:
6
6
  segments:
7
7
  - 0
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 0.1.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: 2010-11-08 00:00:00 -07:00
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.3.7
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