wordpress-xmlrpc 0.0.10 → 0.0.11
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.
- data/VERSION +1 -1
- data/lib/blog.rb +3 -2
- data/spec/blog_spec.rb +4 -3
- data/wordpress-xmlrpc.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
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.
|
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.
|
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
|
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
|
217
|
+
@blog.publish(post).should == post
|
217
218
|
post.id.should == 123
|
218
219
|
post.published.should be_true
|
219
220
|
end
|
data/wordpress-xmlrpc.gemspec
CHANGED
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:
|
4
|
+
hash: 9
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 11
|
10
|
+
version: 0.0.11
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alexander Naumenko
|