compostr 0.1.4 → 0.1.5
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.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/compostr/custom_post_type.rb +1 -0
- data/lib/compostr/entity_cache.rb +6 -0
- data/lib/compostr/syncer.rb +9 -4
- data/lib/compostr/version.rb +1 -1
- data/lib/compostr.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ebe394c131ac5e4b1a446fd0413783254ab7d907d978afcb32a012b072baaf3
|
4
|
+
data.tar.gz: d24824f7b8df8aeb9dbdfab420ad6d496779f8327978791d8726ac0cdbd46fa2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3134bd3be696c8662f6d69894cd3bdd68da46dda152cc35bc13e10cf0893a7054ddf9b20d63f2fbd20fec60976a85077b5250f25dd9ed99c72616e27d8be9e8
|
7
|
+
data.tar.gz: d1b7435b2e816dc05814a3f75a2bc4649c1772be1281e61415d6fba30fad2f9bf62227129f206c6ebcdba3faf12f27aab5eb154d22a38b563e2ad93af518d99f
|
data/README.md
CHANGED
@@ -71,7 +71,10 @@ Global configuration is given in `compostr.conf`, where connection information t
|
|
71
71
|
password: "buzzword"
|
72
72
|
language_term: "Deutsch"
|
73
73
|
author_id: 1
|
74
|
-
use_ssl:
|
74
|
+
use_ssl: true
|
75
|
+
path: "/blog/xmlrpc.php"
|
76
|
+
|
77
|
+
Most of the values directly relate to the [RubyPress configuration](https://github.com/zachfeldman/rubypress).
|
75
78
|
|
76
79
|
### Logging/Logger
|
77
80
|
|
data/lib/compostr/syncer.rb
CHANGED
@@ -16,17 +16,20 @@ module Compostr
|
|
16
16
|
@force = force
|
17
17
|
end
|
18
18
|
|
19
|
-
# Updates or creates Custom Post Types
|
19
|
+
# Updates or creates a Custom Post Types Post.
|
20
20
|
#
|
21
21
|
# The post will be identified by uuid (or not).
|
22
22
|
#
|
23
23
|
# new_post_content (a CustomPostType)
|
24
24
|
# The data that **should** be in wordpress (without knowing
|
25
|
-
# of wordpress post or custom field ids).
|
25
|
+
# of wordpress post or custom field ids).
|
26
|
+
# Usually descendant of Compostr::CustomPostType.
|
26
27
|
#
|
27
28
|
# old_post (a hash)
|
28
29
|
# The data currently available in wordpress (including
|
29
30
|
# wordpress post id, custom field ids).
|
31
|
+
#
|
32
|
+
# Returns post_id (of WordPress) or nil (if failure).
|
30
33
|
def merge_push new_post, old_post
|
31
34
|
if old_post && old_post.in_wordpress?
|
32
35
|
info "#{new_post.class.name} with UUID #{new_post.uuid} found, updating"
|
@@ -50,13 +53,14 @@ module Compostr
|
|
50
53
|
debug "Upload Post ##{new_post.post_id} with wp-content: #{content}"
|
51
54
|
|
52
55
|
post_id = Compostr::wp.editPost(blog_id: 0,
|
53
|
-
|
54
|
-
|
56
|
+
post_id: new_post.post_id,
|
57
|
+
content: content)
|
55
58
|
if post_id
|
56
59
|
info "#{new_post.class} ##{new_post.post_id} updated"
|
57
60
|
else
|
58
61
|
info "#{new_post.class} ##{new_post.post_id} not updated!"
|
59
62
|
end
|
63
|
+
return post_id
|
60
64
|
else
|
61
65
|
# Easy, create new one
|
62
66
|
info "#{new_post.class.name} with UUID #{new_post.uuid} not found, creating"
|
@@ -77,6 +81,7 @@ module Compostr
|
|
77
81
|
info "#{new_post.class} not created!"
|
78
82
|
end
|
79
83
|
new_post.post_id = new_post_id
|
84
|
+
return new_post_id
|
80
85
|
end
|
81
86
|
end
|
82
87
|
|
data/lib/compostr/version.rb
CHANGED
data/lib/compostr.rb
CHANGED
@@ -37,7 +37,8 @@ module Compostr
|
|
37
37
|
@wp ||= Rubypress::Client.new(host: config.host,
|
38
38
|
username: config.username,
|
39
39
|
password: config.password,
|
40
|
-
use_ssl: config.use_ssl
|
40
|
+
use_ssl: config.use_ssl,
|
41
|
+
path: config.path || "/xmlrpc.php")
|
41
42
|
end
|
42
43
|
|
43
44
|
# Access the logger, initialize and memoize it on demand.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compostr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Wolfsteller
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubypress
|