wordpress-wxr 0.1.0 → 0.1.1

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: 3a6e12c55a5574216b7300de4ac2d1e533654527
4
- data.tar.gz: 73272e1c15e8bb66364e6f7ccbe0eac645cf6df2
3
+ metadata.gz: 96422fc63ea4a194ae6a32f1f105cc25888721bd
4
+ data.tar.gz: 2b586ae6e1e41221026fcc2fe4b3cfe38686961b
5
5
  SHA512:
6
- metadata.gz: 4adbbf58d4272d8515858cc824e1e9c30d6d4b0f219e04c531901a08214242f3b460bb2afa3c4124011c82918aa991f3234eed0b2ba8d73d7c71ed45f649ce54
7
- data.tar.gz: d98e0f54758da12b6c0eb98cdb92b968777632989cbe3224d68a667afca9014b4fd2a9d1d282805acdcdecbe13d77b43ffee5b81730a818fdab55221bcf0aff8
6
+ metadata.gz: 097d9d3c199ffc08791f71b2654ec25f4bc43ca59663c7531ae57d8db7930d71b8be4a1d4100c40d7f086a4ebb21e4125bed8868f6b0b2a345127cc84ffedf7d
7
+ data.tar.gz: 6f348a5bfa004f3e45430107260eb45e051bd65c579ffd96d390fe39d1b6778a55974d971124d520e2a9d392d654e0d9b3067212c238e58c18b88716d4ab360d
@@ -22,7 +22,12 @@ module Wordpress
22
22
  end
23
23
 
24
24
  def find_by(login:)
25
- each.find { |author| author.login == login }
25
+ return if login.empty?
26
+
27
+ author = nodes.xpath("wp:author_login[text() = '#{login}']/parent::node()")
28
+ return unless author
29
+
30
+ Author.new(author, wxr)
26
31
  end
27
32
 
28
33
  private
@@ -22,7 +22,12 @@ module Wordpress
22
22
  end
23
23
 
24
24
  def find_by(nicename:)
25
- each.find { |category| category.nicename == nicename }
25
+ return if nicename.empty?
26
+
27
+ category = nodes.xpath("wp:category_nicename[text() = '#{nicename}']/parent::node()")
28
+ return unless category
29
+
30
+ Category.new(category, wxr)
26
31
  end
27
32
 
28
33
  private
@@ -1,5 +1,5 @@
1
1
  module Wordpress
2
2
  class WXR
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'.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.1.0
4
+ version: 0.1.1
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-13 00:00:00.000000000 Z
11
+ date: 2017-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler