compostr 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/compostr/image_uploader.rb +2 -1
- data/lib/compostr/syncer.rb +2 -2
- data/lib/compostr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 502575895cdf999e84d5058302eb6a964a924a7d
|
4
|
+
data.tar.gz: 8513205b1925cb4e3e24da3c7a0f4a8db0e90f9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12b8c27e1a2be6484e3879a4f7655e53b5c954494fddc9824dd66d79f6665428404a215d4f627e1afce73e9323ba98fcb9af2a6f9caebffa9211088516c3e921
|
7
|
+
data.tar.gz: 5328423341c639bc15b0006f262db56b884dfa501bc41ba45258a2000f09e84cc5ed18fc333ec3f866134c44408d59d2de531a63227b248cc50a00f5687e656a
|
@@ -16,14 +16,15 @@ module Compostr
|
|
16
16
|
# Returns attachment id of an image already uploaded
|
17
17
|
# or attachment_id of image after fresh upload
|
18
18
|
# (or nil if path empty)
|
19
|
+
# path is relative path to file to upload.
|
19
20
|
def process rel_path, wp_event=nil
|
20
21
|
return nil if rel_path.to_s.strip.empty?
|
21
|
-
return nil if @image_store.nil?
|
22
22
|
|
23
23
|
# Do we need URI encoding here?
|
24
24
|
if attachment_id = @media_cache.id_of_name(rel_path)
|
25
25
|
Compostr.logger.debug "Image already uploaded."
|
26
26
|
else
|
27
|
+
return nil if @image_store.nil?
|
27
28
|
path = File.join(@image_store, rel_path)
|
28
29
|
Compostr.logger.info "Uploading file #{path}"
|
29
30
|
upload = Compostr::ImageUpload.new(path)
|
data/lib/compostr/syncer.rb
CHANGED
@@ -20,11 +20,11 @@ module Compostr
|
|
20
20
|
#
|
21
21
|
# The post will be identified by uuid (or not).
|
22
22
|
#
|
23
|
-
# new_post_content
|
23
|
+
# new_post_content (a CustomPostType)
|
24
24
|
# The data that **should** be in wordpress (without knowing
|
25
25
|
# of wordpress post or custom field ids). Usually descendant of CustomPostType.
|
26
26
|
#
|
27
|
-
# old_post
|
27
|
+
# old_post (a hash)
|
28
28
|
# The data currently available in wordpress (including
|
29
29
|
# wordpress post id, custom field ids).
|
30
30
|
def merge_push new_post, old_post
|
data/lib/compostr/version.rb
CHANGED
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.2
|
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-
|
11
|
+
date: 2018-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubypress
|