wordpress-wxr 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wordpress/wxr/attachments.rb +9 -0
- data/lib/wordpress/wxr/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: 981e6af52b4c1a2bb58fb115a6575cfb2f17f6d1
|
4
|
+
data.tar.gz: 44cdbde5be5f6dca0527756c74048324c522b5e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c9cf18fcb87c9a1ec49782d8a49e2eff1d16f3c477674d4b986985693372fd94440a1eae4d71ba047a79595cfe6cee40e2c5880282f19cd3e2642e64c3a0b2f
|
7
|
+
data.tar.gz: b9cb37e2b440f5d012a8f594fd57d814adbc657e199a954761c15fcc8add556082c9ddd5fefc34cb012e0dec13263c8a2107a39faad63ce6d36154986c206370
|
@@ -21,6 +21,15 @@ module Wordpress
|
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|
24
|
+
def find_by(id:)
|
25
|
+
return if id.empty?
|
26
|
+
|
27
|
+
attachment = nodes.xpath("wp:post_id[text() = '#{id}']/parent::node()")
|
28
|
+
return unless attachment
|
29
|
+
|
30
|
+
Attachment.new(attachment, wxr)
|
31
|
+
end
|
32
|
+
|
24
33
|
private
|
25
34
|
|
26
35
|
def nodes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wordpress-wxr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ePublishing, inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03-
|
11
|
+
date: 2017-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|