traject_plus 1.3.0 → 2.0.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
  SHA256:
3
- metadata.gz: ac49598e6fa3578027500a5cb03388b8286d935f8f2910316154e0d1910a0ea3
4
- data.tar.gz: 724c5cb095f104ccce9ad2ba9d347bb8db3a3f90fc25d47500198c4163edbfc8
3
+ metadata.gz: d47d5d02e74d7c07596131245fae67f22216eea3d48c77f4580a901d81725c90
4
+ data.tar.gz: 71eae5b4ad6ab04b38d0c65e5e27c5541cf90816e415bb278da4a17905ba799c
5
5
  SHA512:
6
- metadata.gz: 127c5a3e0950802438bf6a3f67adbaf7fede6141b488180b1b71a7c81f025949bd5d40a30f93790ee213d931763ad5da10738bd55f7c8c87021728c82c3f4c00
7
- data.tar.gz: 56da44f35bc86dad71bc2701cceb7be653e2926e8729a08b8c47ee6513cf73b2c9cdb3f2a20f576ff18521d67ffa83273fe0e455ddb12460bcbe872a1caf41ff
6
+ metadata.gz: 9ee90ffd3dc1601c5a5ccdc569127378b08ad9c7b8bb9dce7eca3ec1c15b9c12303bcaf7c0e73bc8d5c5b36bfa467b6cd37d77bd207d397a388862ee418f21ce
7
+ data.tar.gz: cebf3fda210f12e3e53c9388bbd440ccc2dcd44daf1dcaadc19da2b6ba6283fd06b214b92c5454c8d6cce59203417aa59d42ede8108e144bdfe95dc7435b6d42
@@ -6,9 +6,11 @@ module TrajectPlus
6
6
  module FGDC
7
7
  NS = { fgdc: 'http://www.fgdc.gov/metadata/fgdc-std-001-1998.dtd' }.freeze
8
8
 
9
+ include Traject::Macros::NokogiriMacros
10
+
9
11
  # @param xpath [String] the xpath query expression
10
- def extract_fgdc(xpath, options = {})
11
- extract_xml(xpath, NS, options)
12
+ def extract_fgdc(xpath)
13
+ extract_xpath(xpath, ns: NS)
12
14
  end
13
15
  end
14
16
  end
@@ -9,9 +9,11 @@ module TrajectPlus
9
9
  dc: 'http://purl.org/dc/elements/1.1/',
10
10
  xlink: 'http://www.w3.org/1999/xlink' }.freeze
11
11
 
12
+ include Traject::Macros::NokogiriMacros
13
+
12
14
  # @param xpath [String] the xpath query expression
13
- def extract_mods(xpath, options = {})
14
- extract_xml(xpath, NS, options)
15
+ def extract_mods(xpath)
16
+ extract_xpath(xpath, ns: NS)
15
17
  end
16
18
  end
17
19
  end
@@ -5,9 +5,11 @@ module TrajectPlus
5
5
  module Tei
6
6
  NS = { tei: 'http://www.tei-c.org/ns/1.0' }.freeze
7
7
 
8
+ include Traject::Macros::NokogiriMacros
9
+
8
10
  # @param xpath [String] the xpath query expression
9
- def extract_tei(xpath, options = {})
10
- extract_xml(xpath, NS, options)
11
+ def extract_tei(xpath)
12
+ extract_xpath(xpath, ns: NS)
11
13
  end
12
14
  end
13
15
  end
@@ -8,6 +8,8 @@ module TrajectPlus
8
8
  # @param namespaces [Hash<String,String>] The namespaces for the xpath query
9
9
  # @param options [Hash] other options, may include :trim
10
10
  def extract_xml(xpath, namespaces, options = {})
11
+ Deprecation.warn(self, "extract_xml is deprecated and will be removed in the next major release. Use the Traject 3 pipeline instead")
12
+
11
13
  lambda do |xml, accumulator, _context|
12
14
  result = xml.xpath(xpath, namespaces).map(&:text)
13
15
  unless options.empty?
@@ -1,3 +1,3 @@
1
1
  module TrajectPlus
2
- VERSION = '1.3.0'.freeze
2
+ VERSION = '2.0.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: traject_plus
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer