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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6d098d75c80461cfb88acbaaa2c071ca96dca046
4
- data.tar.gz: a20297b555657488ac0db32bb55fd01e600e56a0
3
+ metadata.gz: 981e6af52b4c1a2bb58fb115a6575cfb2f17f6d1
4
+ data.tar.gz: 44cdbde5be5f6dca0527756c74048324c522b5e3
5
5
  SHA512:
6
- metadata.gz: 7172d0b0cd340babe6fcc030ca6b236343565776e2b7c4ff55066dd676f17a345112fbb37357d8ad93908efd0ddd844cccbf44c9c50e19f145792271c4efac95
7
- data.tar.gz: fc7942c3eb342f914bc2f83b946b56d5b3dfa0863ec00c7e95448a64e9ca85348e290f4f7423c9322f2a75194f1829605ebc5be15f2417f19356c21c58754da7
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
@@ -1,5 +1,5 @@
1
1
  module Wordpress
2
2
  class WXR
3
- VERSION = '0.4.0'.freeze
3
+ VERSION = '0.5.0'.freeze
4
4
  end
5
5
  end
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.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-17 00:00:00.000000000 Z
11
+ date: 2017-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler