nom-xml 1.1.0 → 1.2.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
- SHA1:
3
- metadata.gz: 958e8e47f3ad37b2a192354cf1d7d04b31d45ab8
4
- data.tar.gz: 24307ffb65569e749fdc820fe62fa9f611418d3f
2
+ SHA256:
3
+ metadata.gz: 2b2ab72999bcce7d9fc1173c01393e03d8e2388428d90943e2fe1831f8b52563
4
+ data.tar.gz: 6c1c4a29b276fc07afe6bfd241f4a2a29105e49a9e20c39801f15577dc512889
5
5
  SHA512:
6
- metadata.gz: 5637795c9e229b0d24107dc5301919c01e59ef6950e59b3006c836db4a04fe63698edebc6053d5d870a4c8f534f23f3ceb7b5a31ee24d8068f65fb7c936f6b74
7
- data.tar.gz: ee6630352a0fb50069b43a77213658d8dc4a35344667af50817e9886caa7f5be0823bff6c9304947e8d74fa9cb27eae2489bef0a0044dc4585ef4d9781537b7b
6
+ metadata.gz: 91ac790f990da5482c3489d3e57d0c014e01f9684ad408e5202e792d8f581d0412df55b427435aa320250ef9398a2f774c81c1abfda151f0ba7a55c94d20e8a9
7
+ data.tar.gz: 0ecd92b30918cde11a15197ea58edc6ccbc2d479a7a2f7d010789eee303f55edfac4cff0525dfbe972349f72cc49e4d4d43fc82ccb16422b343ae2a3593cbcea
@@ -0,0 +1,24 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ tests:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby: [jruby-9.2.12.0, 2.4, 2.5, 2.6, 2.7, 3.0]
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - name: Set up Ruby
18
+ uses: ruby/setup-ruby@v1
19
+ with:
20
+ ruby-version: ${{ matrix.ruby }}
21
+ - name: Install dependencies
22
+ run: bundle install
23
+ - name: Run tests
24
+ run: bundle exec rake
@@ -82,9 +82,7 @@ module Nom::XML::Decorators::Terminology
82
82
  end
83
83
 
84
84
  def lookup_term term, *args
85
- options = args.extract_options!
86
-
87
- args += options.map { |key, value| %{#{key}="#{value.gsub(/"/, '\\\"') }"} }
85
+ args = extract_term_options(*args)
88
86
 
89
87
  xpath = term.local_xpath
90
88
 
@@ -99,4 +97,14 @@ module Nom::XML::Decorators::Terminology
99
97
 
100
98
  result.values_for_term(term)
101
99
  end
100
+
101
+ def extract_term_options(*args)
102
+ if args.last.is_a? Hash
103
+ h = args.pop
104
+
105
+ args + h.map { |key, value| %(#{key}="#{value.gsub(/"/, '\\\"')}") }
106
+ else
107
+ args
108
+ end
109
+ end
102
110
  end
@@ -1,5 +1,3 @@
1
- require 'active_support/core_ext/array'
2
-
3
1
  module Nom::XML
4
2
  module NokogiriExtension
5
3
 
@@ -24,7 +22,7 @@ module Nom::XML
24
22
  # Set the terminology accessors for this document
25
23
  def set_terminology options = {}, &block
26
24
  @terminology = Nom::XML::Terminology.new(self, options, &block)
27
-
25
+
28
26
  self
29
27
  end
30
28
 
data/lib/nom/xml/term.rb CHANGED
@@ -52,7 +52,7 @@ module Nom::XML
52
52
  # Get the relative xpath to this node from its immediate parent's term
53
53
  # @return [String]
54
54
  def local_xpath
55
- xpath = if xmlns.blank?
55
+ xpath = if xmlns.nil? || xmlns.empty?
56
56
  ""
57
57
  else
58
58
  xmlns + ":"
@@ -1,5 +1,5 @@
1
1
  module Nom
2
2
  module XML
3
- VERSION = '1.1.0'
3
+ VERSION = '1.2.0'
4
4
  end
5
5
  end
data/nom-xml.gemspec CHANGED
@@ -12,7 +12,6 @@ Gem::Specification.new do |s|
12
12
  s.summary = %q{ A library to help you tame sprawling XML schemas. }
13
13
  s.description = %q{ NOM allows you to define a “terminology” to ease translation between XML and ruby objects }
14
14
 
15
- s.add_dependency 'activesupport', '>= 3.2.18' # could be rails/AS 3 or 4+, but we don't support old insecure versions
16
15
  s.add_dependency 'i18n'
17
16
  s.add_dependency 'nokogiri'
18
17
 
metadata CHANGED
@@ -1,30 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nom-xml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Beer
8
8
  - Michael B. Klein
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-12-11 00:00:00.000000000 Z
12
+ date: 2022-01-10 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: activesupport
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ">="
19
- - !ruby/object:Gem::Version
20
- version: 3.2.18
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- version: 3.2.18
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: i18n
30
16
  requirement: !ruby/object:Gem::Requirement
@@ -118,9 +104,9 @@ extra_rdoc_files:
118
104
  - LICENSE
119
105
  - README.md
120
106
  files:
107
+ - ".github/workflows/ruby.yml"
121
108
  - ".gitignore"
122
109
  - ".rspec"
123
- - ".travis.yml"
124
110
  - Gemfile
125
111
  - LICENSE
126
112
  - README.md
@@ -154,7 +140,7 @@ files:
154
140
  homepage: http://github.com/cbeer/nom-xml
155
141
  licenses: []
156
142
  metadata: {}
157
- post_install_message:
143
+ post_install_message:
158
144
  rdoc_options: []
159
145
  require_paths:
160
146
  - lib
@@ -169,9 +155,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
155
  - !ruby/object:Gem::Version
170
156
  version: '0'
171
157
  requirements: []
172
- rubyforge_project:
173
- rubygems_version: 2.6.11
174
- signing_key:
158
+ rubygems_version: 3.2.32
159
+ signing_key:
175
160
  specification_version: 4
176
161
  summary: A library to help you tame sprawling XML schemas.
177
162
  test_files:
data/.travis.yml DELETED
@@ -1,7 +0,0 @@
1
- notifications:
2
- email: false
3
-
4
- rvm:
5
- - 2.4.4
6
- - 2.5.1
7
- - jruby-9.2.0.0