wordpress-xmlrpc 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/blog.rb +3 -6
- data/spec/blog_spec.rb +1 -1
- data/wordpress-xmlrpc.gemspec +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/lib/blog.rb
CHANGED
@@ -60,14 +60,11 @@ module Wordpress
|
|
60
60
|
|
61
61
|
raise ArgumentError, "Image not found (path: #{image[:file_path]})" unless File.exist?(image[:file_path])
|
62
62
|
|
63
|
-
|
64
|
-
file_name = File.basename(image_file.path)
|
65
|
-
|
63
|
+
basename = File.basename(image[:file_path])
|
66
64
|
uploaded_image = upload_file(File.open(image[:file_path], "rb"))
|
67
65
|
raise "Image upload failed" if uploaded_image.nil?
|
68
|
-
|
69
|
-
|
70
|
-
img['src'] = uploaded_image['url']
|
66
|
+
doc.css("img").each do |img|
|
67
|
+
img['src'] = uploaded_image['url'] if img['src'].include?(basename)
|
71
68
|
end
|
72
69
|
end
|
73
70
|
post.content = doc.to_html
|
data/spec/blog_spec.rb
CHANGED
@@ -61,7 +61,7 @@ describe Wordpress::Blog do
|
|
61
61
|
images = [{:file_path => File.expand_path("./spec/support/files/post_picture.jpg")}]
|
62
62
|
post = Wordpress::Post.new(
|
63
63
|
:title => "Hey ho",
|
64
|
-
:content => "Content <img src=\"http://otherhost/post_picture.jpg\">",
|
64
|
+
:content => "Content <img src=\"http://otherhost/post_picture.jpg?1231231123\">",
|
65
65
|
:excerpt => "Excerpt",
|
66
66
|
:images => images,
|
67
67
|
:publish_date => Date.parse("01.08.2010"))
|
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: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alexander Naumenko
|