rubypress 1.0.9 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rubypress/client.rb +14 -9
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36cabfe8257db270de3415114ecf0ef22261d300
|
4
|
+
data.tar.gz: 0a5c21ef875c319cd442db651fc01a68246c318c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85b925186635f5807956fd86c3bf297cf8a34c65c8310a05017ca35613ac5ddd25d0b36c947e0f15e9375daa15685011448cfa4a4bd839c8cd6742fa7faa358b
|
7
|
+
data.tar.gz: 11e43a35590ceba576b94c89014fe19470997f973dc6a005b52eb1430314c1817179472e4e25b840463749c93c09039cdbbc7f44295519d756f41dadebac66cb
|
data/lib/rubypress/client.rb
CHANGED
@@ -16,7 +16,7 @@ module Rubypress
|
|
16
16
|
|
17
17
|
attr_reader :connection
|
18
18
|
attr_accessor :port, :ssl_port, :host, :path, :username, :password, :use_ssl, :default_post_fields,
|
19
|
-
:debug, :http_user, :http_password, :retry_timeouts
|
19
|
+
:debug, :http_user, :http_password, :retry_timeouts, :cookie
|
20
20
|
|
21
21
|
def initialize(options = {})
|
22
22
|
{
|
@@ -31,17 +31,21 @@ module Rubypress
|
|
31
31
|
:debug => false,
|
32
32
|
:http_user => nil,
|
33
33
|
:http_password => nil,
|
34
|
-
:retry_timeouts => false
|
34
|
+
:retry_timeouts => false,
|
35
|
+
:cookie => nil
|
35
36
|
}.merge(options).each{ |opt| self.send("#{opt[0]}=", opt[1]) }
|
36
37
|
self
|
37
38
|
end
|
38
39
|
|
39
40
|
def connection
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
if @connection.nil?
|
42
|
+
@connection = XMLRPC::Client.new(self.host, self.path, (self.use_ssl ? self.ssl_port : self.port),nil,nil,self.http_user,self.http_password,self.use_ssl,nil)
|
43
|
+
@connection.http_header_extra = {'accept-encoding' => 'identity'}
|
44
|
+
@connection.extend(XMLRPCRetryable) if retry_timeouts
|
45
|
+
@connection.cookie = self.cookie unless self.cookie.nil?
|
46
|
+
end
|
47
|
+
|
48
|
+
@connection
|
45
49
|
end
|
46
50
|
|
47
51
|
def self.default
|
@@ -56,12 +60,13 @@ module Rubypress
|
|
56
60
|
:password => self.password
|
57
61
|
}
|
58
62
|
options_final.deep_merge!(options).each{|option| args.push(option[1]) if !option[1].nil?}
|
63
|
+
method = "wp.#{method}" unless method.include?('.')
|
59
64
|
if self.debug
|
60
65
|
connection.set_debug
|
61
|
-
server = self.connection.call(
|
66
|
+
server = self.connection.call(method, args)
|
62
67
|
pp server
|
63
68
|
else
|
64
|
-
self.connection.call(
|
69
|
+
self.connection.call(method, args)
|
65
70
|
end
|
66
71
|
end
|
67
72
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubypress
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zach Feldman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-02-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: retryable-rb
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
162
|
rubyforge_project:
|
163
|
-
rubygems_version: 2.
|
163
|
+
rubygems_version: 2.4.5
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: Easily access WordPress installations through the WordPress XML-RPC API.
|