wordpress-xmlrpc 0.0.10 → 0.0.11

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.10
1
+ 0.0.11
data/lib/blog.rb CHANGED
@@ -37,12 +37,13 @@ module Wordpress
37
37
  case item
38
38
  when Wordpress::Post
39
39
  item.id = blog_api_call("metaWeblog.newPost", item.to_struct(:metaWeblog), true).to_i
40
- item.published = true
41
40
  when Wordpress::Page
42
41
  item.id = blog_api_call("wp.newPage", item.to_struct(:wp), true).to_i
43
42
  else
44
43
  raise "Unknown item type: #{item}"
45
44
  end
45
+ item.published = true
46
+ return item
46
47
  end #publish
47
48
 
48
49
  def update(item)
@@ -69,7 +70,7 @@ module Wordpress
69
70
  end
70
71
 
71
72
  def get_page_list
72
- page_list = blog_api_call("wp.getPageList").collect do |struct|
73
+ page_list = blog_api_call("wp.getPages").collect do |struct|
73
74
  Wordpress::Page.from_struct(:wp, struct)
74
75
  end
75
76
  # link pages list with each other
data/spec/blog_spec.rb CHANGED
@@ -94,7 +94,7 @@ describe Wordpress::Blog do
94
94
  "dateCreated" => Date.parse("01.08.2010")
95
95
  }
96
96
  ]
97
- @client_mock.should_receive(:call).with("wp.getPageList", 0, "admin", "wordpress-xmlrpc").and_return(page_structs)
97
+ @client_mock.should_receive(:call).with("wp.getPages", 0, "admin", "wordpress-xmlrpc").and_return(page_structs)
98
98
 
99
99
  page_two = Wordpress::Page.new(
100
100
  :id => 2,
@@ -167,7 +167,8 @@ describe Wordpress::Blog do
167
167
  XMLRPC::Base64.should_receive(:new).and_return("encoded file content")
168
168
 
169
169
 
170
- @blog.publish(page).should be_true
170
+ @blog.publish(page).should == page
171
+ page.published.should be_true
171
172
  page.id.should == 123
172
173
  end
173
174
  end
@@ -213,7 +214,7 @@ describe Wordpress::Blog do
213
214
 
214
215
  XMLRPC::Base64.should_receive(:new).and_return("encoded file content")
215
216
 
216
- @blog.publish(post).should be_true
217
+ @blog.publish(post).should == post
217
218
  post.id.should == 123
218
219
  post.published.should be_true
219
220
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wordpress-xmlrpc}
8
- s.version = "0.0.10"
8
+ s.version = "0.0.11"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Alexander Naumenko"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wordpress-xmlrpc
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 10
10
- version: 0.0.10
9
+ - 11
10
+ version: 0.0.11
11
11
  platform: ruby
12
12
  authors:
13
13
  - Alexander Naumenko