rubypress 1.0.7 → 1.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4bf758cacd16eef5a137f0494aea1661a996fd22
4
- data.tar.gz: 22ef8be888ea779a6245fb3ee82f1069532763a6
3
+ metadata.gz: 92d9dcd05d676fdb8d0eeb73a3b3454fb63f38bd
4
+ data.tar.gz: 83f41f7848dc19580f53a2e21409154e16e61467
5
5
  SHA512:
6
- metadata.gz: 3f08a797c2e8235e226110c3461f9d0e82ec237a850590400facc52319ee4633265433cc6ce6b5bca7e851f51d131cf6c500b1d8f7bf95c17715405ae9610c29
7
- data.tar.gz: 6deac01ed748d3daaa6e014e5d4889e6634810b88b50e403b3e4e7b45823798196f91f641353e9389e23e68fca9b8dd05f83d155b127b5642f1d911be9dad1e1
6
+ metadata.gz: 799edfe3bb44c9d5a136d857cee6fcead0406c7298a471da035e2a6715c5a80db2233e1895581ee756f1cf25441e3b1c75171f7551758e929b61f4dace37d000
7
+ data.tar.gz: c50c44b1eb88360c40a41786c53b3c7ee5ed4d695e8ef6e7df6fb176bfab873b07da245609451900b8084f578e6d955bbc8c8bff7218b27fed4e309ba7fea7b9
@@ -1,51 +1,55 @@
1
- module Comments
2
-
3
- def getCommentCount(options = {})
4
- default_options = {
5
- :post_id => nil
6
- }.deep_merge!(options)
7
- execute('getCommentCount', default_options)
8
- end
1
+ module Rubypress
9
2
 
10
- def getComment(options = {})
11
- default_options = {
12
- :comment_id => nil
13
- }.deep_merge!(options)
14
- execute('getComment', default_options)
15
- end
3
+ module Comments
16
4
 
17
- def getComments(options = {})
18
- default_options = {
19
- :filter => {}
20
- }.deep_merge!(options)
21
- execute('getComments', default_options)
22
- end
5
+ def getCommentCount(options = {})
6
+ default_options = {
7
+ :post_id => nil
8
+ }.deep_merge!(options)
9
+ execute('getCommentCount', default_options)
10
+ end
23
11
 
24
- def newComment(options = {})
25
- default_options = {
26
- :post_id => nil,
27
- :comment => {}
28
- }.deep_merge!(options)
29
- execute('newComment', default_options)
30
- end
12
+ def getComment(options = {})
13
+ default_options = {
14
+ :comment_id => nil
15
+ }.deep_merge!(options)
16
+ execute('getComment', default_options)
17
+ end
31
18
 
32
- def editComment(options = {})
33
- default_options = {
34
- :comment_id => nil,
35
- :comment => {}
36
- }.deep_merge!(options)
37
- execute('editComment', default_options)
38
- end
19
+ def getComments(options = {})
20
+ default_options = {
21
+ :filter => {}
22
+ }.deep_merge!(options)
23
+ execute('getComments', default_options)
24
+ end
39
25
 
40
- def deleteComment(options = {})
41
- default_options = {
42
- :comment_id => nil
43
- }.deep_merge!(options)
44
- execute('deleteComment', default_options)
45
- end
26
+ def newComment(options = {})
27
+ default_options = {
28
+ :post_id => nil,
29
+ :comment => {}
30
+ }.deep_merge!(options)
31
+ execute('newComment', default_options)
32
+ end
33
+
34
+ def editComment(options = {})
35
+ default_options = {
36
+ :comment_id => nil,
37
+ :comment => {}
38
+ }.deep_merge!(options)
39
+ execute('editComment', default_options)
40
+ end
41
+
42
+ def deleteComment(options = {})
43
+ default_options = {
44
+ :comment_id => nil
45
+ }.deep_merge!(options)
46
+ execute('deleteComment', default_options)
47
+ end
48
+
49
+ def getCommentStatusList(options = {})
50
+ execute('getCommentStatusList', options)
51
+ end
46
52
 
47
- def getCommentStatusList(options = {})
48
- execute('getCommentStatusList', options)
49
53
  end
50
54
 
51
- end
55
+ end
@@ -1,25 +1,29 @@
1
- module Media
1
+ module Rubypress
2
2
 
3
- def getMediaItem(options = {})
4
- default_options = {
5
- :attachment_id => nil
6
- }.deep_merge!(options)
7
- execute('getMediaItem', default_options)
8
- end
3
+ module Media
9
4
 
10
- def getMediaLibrary(options = {})
11
- default_options = {
12
- :filter => {}
13
- }.deep_merge!(options)
14
- execute('getMediaLibrary', default_options)
15
- end
5
+ def getMediaItem(options = {})
6
+ default_options = {
7
+ :attachment_id => nil
8
+ }.deep_merge!(options)
9
+ execute('getMediaItem', default_options)
10
+ end
11
+
12
+ def getMediaLibrary(options = {})
13
+ default_options = {
14
+ :filter => {}
15
+ }.deep_merge!(options)
16
+ execute('getMediaLibrary', default_options)
17
+ end
18
+
19
+ def uploadFile(options = {})
20
+ default_options = {
21
+ :data => {}
22
+ }.deep_merge!(options)
23
+ default_options[:data][:bits] = XMLRPC::Base64.new(File.read(default_options.delete(:filename))) if options.include?(:filename) and File.readable?(options[:filename])
24
+ execute('uploadFile', default_options)
25
+ end
16
26
 
17
- def uploadFile(options = {})
18
- default_options = {
19
- :data => {}
20
- }.deep_merge!(options)
21
- default_options[:data][:bits] = XMLRPC::Base64.new(File.read(default_options.delete(:filename))) if options.include?(:filename) and File.readable?(options[:filename])
22
- execute('uploadFile', default_options)
23
27
  end
24
28
 
25
- end
29
+ end
@@ -1,17 +1,21 @@
1
- module Options
1
+ module Rubypress
2
2
 
3
- def getOptions(options = {})
4
- default_options = {
5
- :options => []
6
- }.deep_merge!(options)
7
- execute('getOptions', default_options)
8
- end
3
+ module Options
4
+
5
+ def getOptions(options = {})
6
+ default_options = {
7
+ :options => []
8
+ }.deep_merge!(options)
9
+ execute('getOptions', default_options)
10
+ end
11
+
12
+ def setOptions(options = {})
13
+ default_options = {
14
+ :options => []
15
+ }.deep_merge!(options)
16
+ execute('setOptions', default_options)
17
+ end
9
18
 
10
- def setOptions(options = {})
11
- default_options = {
12
- :options => []
13
- }.deep_merge!(options)
14
- execute('setOptions', default_options)
15
19
  end
16
20
 
17
- end
21
+ end
@@ -1,72 +1,76 @@
1
- module Posts
1
+ module Rubypress
2
2
 
3
- def getPost(options = {})
4
- default_options = {
5
- :post_id => nil,
6
- :fields => self.default_post_fields
7
- }.deep_merge!(options)
8
- execute('getPost', default_options)
9
- end
3
+ module Posts
10
4
 
11
- def getPosts(options = {})
12
- default_options = {
13
- :filter => {
14
- :post_type => 'post',
15
- :orderby => 'post_date',
16
- :order => 'asc',
5
+ def getPost(options = {})
6
+ default_options = {
7
+ :post_id => nil,
17
8
  :fields => self.default_post_fields
18
- }
19
- }.deep_merge!(options)
20
- execute('getPosts', default_options)
21
- end
9
+ }.deep_merge!(options)
10
+ execute('getPost', default_options)
11
+ end
22
12
 
23
- def newPost(options = {})
24
- default_options = {
25
- :content => {}
26
- }.deep_merge!(options)
27
- execute('newPost', default_options)
28
- end
13
+ def getPosts(options = {})
14
+ default_options = {
15
+ :filter => {
16
+ :post_type => 'post',
17
+ :orderby => 'post_date',
18
+ :order => 'asc',
19
+ :fields => self.default_post_fields
20
+ }
21
+ }.deep_merge!(options)
22
+ execute('getPosts', default_options)
23
+ end
29
24
 
30
- def editPost(options = {})
31
- default_options = {
32
- :post_id => nil,
33
- :content => {}
34
- }.deep_merge!(options)
35
- execute('editPost', default_options)
36
- end
25
+ def newPost(options = {})
26
+ default_options = {
27
+ :content => {}
28
+ }.deep_merge!(options)
29
+ execute('newPost', default_options)
30
+ end
37
31
 
38
- def deletePost(options = {})
39
- default_options = {
40
- :post_id => nil
41
- }.deep_merge!(options)
42
- execute('deletePost', default_options)
43
- end
32
+ def editPost(options = {})
33
+ default_options = {
34
+ :post_id => nil,
35
+ :content => {}
36
+ }.deep_merge!(options)
37
+ execute('editPost', default_options)
38
+ end
44
39
 
45
- def getPostType(options = {})
46
- default_options = {
47
- :post_type_name => nil,
48
- :fields => []
49
- }.deep_merge!(options)
50
- execute('getPostType', default_options)
51
- end
40
+ def deletePost(options = {})
41
+ default_options = {
42
+ :post_id => nil
43
+ }.deep_merge!(options)
44
+ execute('deletePost', default_options)
45
+ end
52
46
 
53
- def getPostTypes(options = {})
54
- default_options = {
55
- :filter => {},
56
- :fields => []
57
- }.deep_merge!(options)
58
- execute('getPostTypes', default_options)
59
- end
47
+ def getPostType(options = {})
48
+ default_options = {
49
+ :post_type_name => nil,
50
+ :fields => []
51
+ }.deep_merge!(options)
52
+ execute('getPostType', default_options)
53
+ end
60
54
 
61
- def getPostFormats(options = {})
62
- default_options = {
63
- :filter => {}
64
- }.deep_merge!(options)
65
- execute('getPostFormats', default_options)
66
- end
55
+ def getPostTypes(options = {})
56
+ default_options = {
57
+ :filter => {},
58
+ :fields => []
59
+ }.deep_merge!(options)
60
+ execute('getPostTypes', default_options)
61
+ end
62
+
63
+ def getPostFormats(options = {})
64
+ default_options = {
65
+ :filter => {}
66
+ }.deep_merge!(options)
67
+ execute('getPostFormats', default_options)
68
+ end
69
+
70
+ def getPostStatusList(options = {})
71
+ execute('getPostFormats', options)
72
+ end
67
73
 
68
- def getPostStatusList(options = {})
69
- execute('getPostFormats', options)
70
74
  end
71
75
 
72
- end
76
+ end
@@ -1,53 +1,57 @@
1
- module Taxonomies
1
+ module Rubypress
2
+
3
+ module Taxonomies
4
+
5
+ def getTaxonomy(options = {})
6
+ default_options = {
7
+ :taxonomy => 'category'
8
+ }.deep_merge!(options)
9
+ execute('getTaxonomy', default_options)
10
+ end
11
+
12
+ def getTaxonomies(options = {})
13
+ execute('getTaxonomies', options)
14
+ end
15
+
16
+ def getTerm(options = {})
17
+ default_options = {
18
+ :taxonomy => 'category',
19
+ :term_id => nil
20
+ }.deep_merge!(options)
21
+ execute('getTerm', default_options)
22
+ end
23
+
24
+ def getTerms(options = {})
25
+ default_options = {
26
+ :taxonomy => 'category',
27
+ :filter => {}
28
+ }.deep_merge!(options)
29
+ execute('getTerms', default_options)
30
+ end
31
+
32
+ def newTerm(options = {})
33
+ default_options = {
34
+ :content => {}
35
+ }.deep_merge!(options)
36
+ execute('newTerm', default_options)
37
+ end
38
+
39
+ def editTerm(options = {})
40
+ default_options = {
41
+ :term_id => nil,
42
+ :content => {}
43
+ }.deep_merge!(options)
44
+ execute('editTerm', default_options)
45
+ end
46
+
47
+ def deleteTerm(options = {})
48
+ default_options = {
49
+ :taxonomy => nil,
50
+ :term_id => nil
51
+ }.deep_merge!(options)
52
+ execute('deleteTerm', default_options)
53
+ end
2
54
 
3
- def getTaxonomy(options = {})
4
- default_options = {
5
- :taxonomy => 'category'
6
- }.deep_merge!(options)
7
- execute('getTaxonomy', default_options)
8
55
  end
9
56
 
10
- def getTaxonomies(options = {})
11
- execute('getTaxonomies', options)
12
- end
13
-
14
- def getTerm(options = {})
15
- default_options = {
16
- :taxonomy => 'category',
17
- :term_id => nil
18
- }.deep_merge!(options)
19
- execute('getTerm', default_options)
20
- end
21
-
22
- def getTerms(options = {})
23
- default_options = {
24
- :taxonomy => 'category',
25
- :filter => {}
26
- }.deep_merge!(options)
27
- execute('getTerms', default_options)
28
- end
29
-
30
- def newTerm(options = {})
31
- default_options = {
32
- :content => {}
33
- }.deep_merge!(options)
34
- execute('newTerm', default_options)
35
- end
36
-
37
- def editTerm(options = {})
38
- default_options = {
39
- :term_id => nil,
40
- :content => {}
41
- }.deep_merge!(options)
42
- execute('editTerm', default_options)
43
- end
44
-
45
- def deleteTerm(options = {})
46
- default_options = {
47
- :taxonomy => nil,
48
- :term_id => nil
49
- }.deep_merge!(options)
50
- execute('deleteTerm', default_options)
51
- end
52
-
53
- end
57
+ end
@@ -1,40 +1,44 @@
1
- module Users
1
+ module Rubypress
2
2
 
3
- def getUsersBlogs
4
- self.connection.call('wp.getUsersBlogs', self.username, self.password)
5
- end
3
+ module Users
6
4
 
7
- def getUser(options = {})
8
- default_options = {
9
- :user_id => nil,
10
- :fields => []
11
- }.deep_merge!(options)
12
- execute('getUser', default_options)
13
- end
5
+ def getUsersBlogs
6
+ self.connection.call('wp.getUsersBlogs', self.username, self.password)
7
+ end
14
8
 
15
- def getUsers(options = {})
16
- default_options = {
17
- :filter => {}
18
- }.deep_merge!(options)
19
- execute('getUsers', default_options)
20
- end
9
+ def getUser(options = {})
10
+ default_options = {
11
+ :user_id => nil,
12
+ :fields => []
13
+ }.deep_merge!(options)
14
+ execute('getUser', default_options)
15
+ end
21
16
 
22
- def getProfile(options = {})
23
- default_options = {
24
- :fields => []
25
- }.deep_merge!(options)
26
- execute('getProfile', default_options)
27
- end
17
+ def getUsers(options = {})
18
+ default_options = {
19
+ :filter => {}
20
+ }.deep_merge!(options)
21
+ execute('getUsers', default_options)
22
+ end
28
23
 
29
- def editProfile(options = {})
30
- default_options = {
31
- :content => {}
32
- }.deep_merge!(options)
33
- execute('editProfile', default_options)
34
- end
24
+ def getProfile(options = {})
25
+ default_options = {
26
+ :fields => []
27
+ }.deep_merge!(options)
28
+ execute('getProfile', default_options)
29
+ end
30
+
31
+ def editProfile(options = {})
32
+ default_options = {
33
+ :content => {}
34
+ }.deep_merge!(options)
35
+ execute('editProfile', default_options)
36
+ end
37
+
38
+ def getAuthors(options = {})
39
+ execute('getAuthors', options)
40
+ end
35
41
 
36
- def getAuthors(options = {})
37
- execute('getAuthors', options)
38
42
  end
39
43
 
40
- end
44
+ end
@@ -2,18 +2,19 @@ module Rubypress
2
2
  module XMLRPCRetryable
3
3
  include Retryable
4
4
 
5
- RETRY_EXCEPTIONS = [
6
- Timeout::Error,
7
- Net::ReadTimeout
5
+ RUBY_EXCEPTIONS = [
6
+ Timeout::Error
8
7
  ]
9
8
 
9
+ RUBY_EXCEPTIONS << Net::ReadTimeout if Net.const_defined?(:ReadTimeout)
10
+
10
11
  def self.extended(instance)
11
12
  instance.singleton_class.send(:alias_method, :call_without_retry, :call)
12
13
  instance.singleton_class.send(:alias_method, :call, :call_with_retry)
13
14
  end
14
15
 
15
16
  def call_with_retry(method, *args)
16
- retryable on: RETRY_EXCEPTIONS do
17
+ retryable on: RUBY_EXCEPTIONS do
17
18
  call_without_retry(method, *args)
18
19
  end
19
20
  end
metadata CHANGED
@@ -1,125 +1,125 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubypress
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zach Feldman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-16 00:00:00.000000000 Z
11
+ date: 2014-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: retryable-rb
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rspec
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rdoc
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: jeweler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: simplecov
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: webmock
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: vcr
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - '>='
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
117
  version: '0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  description: Easily access WordPress installations through the WordPress XML-RPC API.
@@ -150,17 +150,17 @@ require_paths:
150
150
  - lib
151
151
  required_ruby_version: !ruby/object:Gem::Requirement
152
152
  requirements:
153
- - - '>='
153
+ - - ">="
154
154
  - !ruby/object:Gem::Version
155
- version: 1.9.2
155
+ version: 1.9.3
156
156
  required_rubygems_version: !ruby/object:Gem::Requirement
157
157
  requirements:
158
- - - '>='
158
+ - - ">="
159
159
  - !ruby/object:Gem::Version
160
160
  version: '0'
161
161
  requirements: []
162
162
  rubyforge_project:
163
- rubygems_version: 2.0.3
163
+ rubygems_version: 2.1.0
164
164
  signing_key:
165
165
  specification_version: 4
166
166
  summary: Easily access WordPress installations through the WordPress XML-RPC API.