roxml 4.1.1 → 4.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
2
  SHA256:
3
- metadata.gz: 27c567c0681f6d38e5b3741668cde44eee9b32f150d9a11d52ea5d0c1c8a4551
4
- data.tar.gz: 8f964263300741e8973287b94a7496050e2432a436bab8064b41ac2b07050860
3
+ metadata.gz: 0af38afb86b97b74c552f4ebd660722c4037154016838e4df2eb64626e2ab3fd
4
+ data.tar.gz: c95d035410a533947c04a41a772fdcbf778e0777bff5fbdf6a9515c97184afec
5
5
  SHA512:
6
- metadata.gz: 77d2448797f6c7055531b4ced3df08bf0012dbcc3d93042583aaaad4b593a46bbd765cfeb0738c6e5630b78528058f60d35fe9f7d4ce6bd6ce65355961c916bc
7
- data.tar.gz: '08e0090edc8a2090a39d0f3675e363ae92983581cdfe9449a7c12eb9228b178ef750a56addcfb6bcd1a90c07d924b5faa73a6bb8b60729ba14f87ca5fef366a4'
6
+ metadata.gz: c48cd9e91df3ced0445098e6c191d5475ec61baa44f61ecc8023d9b6e812079e96d877e4398418e991217165563d2dd3091f2449060483edad558e958c854f93
7
+ data.tar.gz: c45ca74b5168bf80e1d2133d8cc7a9036cb6c2b60fedbbda23df96b920cc89c47a5e5f84728dc3412aba5a2892447d3797e2472f718b12ebec22ae510d4b2760
data/.travis.yml CHANGED
@@ -6,6 +6,7 @@ rvm:
6
6
  - 2.5.3
7
7
  - 2.6.1
8
8
  - 2.7.1
9
+ - 3.0.0
9
10
  - ruby-head
10
11
 
11
12
  matrix:
data/Gemfile CHANGED
@@ -7,6 +7,7 @@ group :development, :test do
7
7
  gem 'rake', '~> 0.9'
8
8
  gem 'juwelier'
9
9
  gem 'minitest'
10
+ gem 'rexml'
10
11
  gem 'rspec', '~> 3.7.0'
11
12
  gem 'sqlite3', '>= 1.2.4'
12
13
  gem 'activerecord', '>= 4.0'
data/Gemfile.lock CHANGED
@@ -12,7 +12,7 @@ GEM
12
12
  minitest (~> 5.1)
13
13
  tzinfo (~> 1.1)
14
14
  zeitwerk (~> 2.2, >= 2.2.2)
15
- addressable (2.7.0)
15
+ addressable (2.8.0)
16
16
  public_suffix (>= 2.0.2, < 5.0)
17
17
  builder (3.2.4)
18
18
  concurrent-ruby (1.1.6)
@@ -50,13 +50,14 @@ GEM
50
50
  jwt (2.2.1)
51
51
  kamelcase (0.0.2)
52
52
  semver2 (~> 3)
53
- mini_portile2 (2.4.0)
54
- minitest (5.14.1)
53
+ mini_portile2 (2.5.1)
54
+ minitest (5.14.4)
55
55
  multi_json (1.14.1)
56
56
  multi_xml (0.6.0)
57
57
  multipart-post (2.1.1)
58
- nokogiri (1.10.9)
59
- mini_portile2 (~> 2.4.0)
58
+ nokogiri (1.11.4)
59
+ mini_portile2 (~> 2.5.0)
60
+ racc (~> 1.4)
60
61
  oauth2 (1.4.4)
61
62
  faraday (>= 0.8, < 2.0)
62
63
  jwt (>= 1.0, < 3.0)
@@ -64,11 +65,13 @@ GEM
64
65
  multi_xml (~> 0.5)
65
66
  rack (>= 1.2, < 3)
66
67
  psych (3.1.0)
67
- public_suffix (4.0.5)
68
+ public_suffix (4.0.6)
69
+ racc (1.5.2)
68
70
  rack (1.6.13)
69
71
  rake (0.9.6)
70
72
  rchardet (1.8.0)
71
- rdoc (6.2.1)
73
+ rdoc (6.3.2)
74
+ rexml (3.2.5)
72
75
  rspec (3.7.0)
73
76
  rspec-core (~> 3.7.0)
74
77
  rspec-expectations (~> 3.7.0)
@@ -101,8 +104,9 @@ DEPENDENCIES
101
104
  nokogiri (>= 1.3.3)
102
105
  rack (< 2.0.0)
103
106
  rake (~> 0.9)
107
+ rexml
104
108
  rspec (~> 3.7.0)
105
109
  sqlite3 (>= 1.2.4)
106
110
 
107
111
  BUNDLED WITH
108
- 1.17.3
112
+ 2.2.22
data/VERSION CHANGED
@@ -1 +1 @@
1
- 4.1.1
1
+ 4.2.0
@@ -1,5 +1,3 @@
1
- require "rexml/xpath_parser"
2
-
3
1
  module ROXML
4
2
  class RequiredElementMissing < ArgumentError # :nodoc:
5
3
  end
@@ -47,7 +45,7 @@ module ROXML
47
45
  def conventionize(what)
48
46
  convention ||= @instance.class.respond_to?(:roxml_naming_convention) && @instance.class.roxml_naming_convention
49
47
  if !what.blank? && convention.respond_to?(:call)
50
- URI.unescape(convention.call(URI.escape(what, /\/|::/)))
48
+ URI.decode_www_form_component(convention.call(URI.encode_www_form_component(what)))
51
49
  else
52
50
  what
53
51
  end
@@ -55,6 +53,8 @@ module ROXML
55
53
 
56
54
  def namespacify(what)
57
55
  if what.to_s.present? && opts.namespace != false && ns = [opts.namespace, @instance.class.roxml_namespace, @default_namespace].compact.map(&:to_s).first
56
+ require "rexml/xpath_parser"
57
+
58
58
  parser = REXML::Parsers::XPathParser.new
59
59
  parsed = parser.parse what
60
60
 
@@ -102,7 +102,7 @@ module ROXML
102
102
  end
103
103
 
104
104
  def wrap(xml, opts = {:always_create => false})
105
- wrap_with = @auto_vals ? auto_wrapper : wrapper
105
+ wrap_with = defined?(@auto_vals) && @auto_vals ? auto_wrapper : wrapper
106
106
 
107
107
  return xml if !wrap_with || xml.name == wrap_with
108
108
 
data/lib/roxml.rb CHANGED
@@ -92,7 +92,7 @@ module ROXML # :nodoc:
92
92
  def xml_namespace(namespace)
93
93
  @roxml_namespace = namespace.to_s
94
94
  end
95
-
95
+
96
96
  # Sets up a mapping of namespace prefixes to hrefs, to be used by this class.
97
97
  # These namespace prefixes are independent of what appears in the xml, only
98
98
  # the namespace hrefs themselves need to match
@@ -128,7 +128,11 @@ module ROXML # :nodoc:
128
128
  end
129
129
 
130
130
  def roxml_namespaces # :nodoc:
131
- @roxml_namespaces || {}
131
+ if defined? @roxml_namespaces
132
+ @roxml_namespaces
133
+ else
134
+ {}
135
+ end
132
136
  end
133
137
 
134
138
  # Most xml documents have a consistent naming convention, for example, the node and
@@ -163,7 +167,7 @@ module ROXML # :nodoc:
163
167
  # Note that the xml_convention is also applied to the default root-level tag_name,
164
168
  # but in this case an underscored version of the name is applied, for convenience.
165
169
  def xml_convention(to_proc_able = nil, &block)
166
- raise ArgumentError, "conventions are already set" if @roxml_naming_convention
170
+ raise ArgumentError, "conventions are already set" if defined?(@roxml_naming_convention)
167
171
  @roxml_naming_convention =
168
172
  if to_proc_able
169
173
  raise ArgumentError, "only one conventions can be set" if block_given?
@@ -174,8 +178,10 @@ module ROXML # :nodoc:
174
178
  end
175
179
 
176
180
  def roxml_naming_convention # :nodoc:
177
- @roxml_naming_convention || begin
178
- superclass.roxml_naming_convention if superclass.respond_to?(:roxml_naming_convention)
181
+ if defined? @roxml_naming_convention
182
+ @roxml_naming_convention
183
+ elsif superclass.respond_to?(:roxml_naming_convention)
184
+ superclass.roxml_naming_convention
179
185
  end
180
186
  end
181
187
 
@@ -482,7 +488,7 @@ module ROXML # :nodoc:
482
488
  private
483
489
  def add_reader(attr)
484
490
  define_method(attr.accessor) do
485
- if instance_variable_get(attr.instance_variable_name).nil?
491
+ unless instance_variable_defined?(attr.instance_variable_name)
486
492
  instance_variable_set(attr.instance_variable_name, attr.default)
487
493
  end
488
494
  instance_variable_get(attr.instance_variable_name)
@@ -501,21 +507,25 @@ module ROXML # :nodoc:
501
507
  # do not work without one.
502
508
  def tag_name
503
509
  return roxml_tag_name if roxml_tag_name
504
-
510
+
505
511
  if tag_name = name.split('::').last
506
512
  roxml_naming_convention ? roxml_naming_convention.call(tag_name.underscore) : tag_name.downcase
507
513
  end
508
514
  end
509
515
 
510
516
  def roxml_tag_name # :nodoc:
511
- @roxml_tag_name || begin
512
- superclass.roxml_tag_name if superclass.respond_to?(:roxml_tag_name)
517
+ if defined? @roxml_tag_name
518
+ @roxml_tag_name
519
+ elsif superclass.respond_to?(:roxml_tag_name)
520
+ superclass.roxml_tag_name
513
521
  end
514
522
  end
515
523
 
516
524
  def roxml_namespace # :nodoc:
517
- @roxml_namespace || begin
518
- superclass.roxml_namespace if superclass.respond_to?(:roxml_namespace)
525
+ if defined? @roxml_namespace
526
+ @roxml_namespace
527
+ elsif superclass.respond_to?(:roxml_namespace)
528
+ superclass.roxml_namespace
519
529
  end
520
530
  end
521
531
 
@@ -567,4 +577,3 @@ module ROXML # :nodoc:
567
577
  end
568
578
  end
569
579
  end
570
-
data/roxml.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: roxml 4.1.1 ruby lib
5
+ # stub: roxml 4.2.0 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "roxml".freeze
9
- s.version = "4.1.1"
9
+ s.version = "4.2.0"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Ben Woosley".freeze, "Zak Mandhro".freeze, "Anders Engstrom".freeze, "Russ Olsen".freeze]
14
- s.date = "2020-07-06"
14
+ s.date = "2021-09-09"
15
15
  s.description = "ROXML is a Ruby library designed to make it easier for Ruby developers to work with XML.\nUsing simple annotations, it enables Ruby classes to be mapped to XML. ROXML takes care\nof the marshalling and unmarshalling of mapped attributes so that developers can focus on\nbuilding first-class Ruby classes. As a result, ROXML simplifies the development of\nRESTful applications, Web Services, and XML-RPC.\n".freeze
16
16
  s.email = "ben.woosley@gmail.com".freeze
17
17
  s.extra_rdoc_files = [
@@ -133,7 +133,7 @@ Gem::Specification.new do |s|
133
133
  "website/index.html"
134
134
  ]
135
135
  s.homepage = "https://github.com/Empact/roxml".freeze
136
- s.rubygems_version = "3.1.2".freeze
136
+ s.rubygems_version = "3.2.15".freeze
137
137
  s.summary = "Ruby Object to XML mapping library".freeze
138
138
 
139
139
  if s.respond_to? :specification_version then
@@ -146,6 +146,7 @@ Gem::Specification.new do |s|
146
146
  s.add_development_dependency(%q<rake>.freeze, ["~> 0.9"])
147
147
  s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
148
148
  s.add_development_dependency(%q<minitest>.freeze, [">= 0"])
149
+ s.add_development_dependency(%q<rexml>.freeze, [">= 0"])
149
150
  s.add_development_dependency(%q<rspec>.freeze, ["~> 3.7.0"])
150
151
  s.add_development_dependency(%q<sqlite3>.freeze, [">= 1.2.4"])
151
152
  s.add_development_dependency(%q<activerecord>.freeze, [">= 4.0"])
@@ -157,6 +158,7 @@ Gem::Specification.new do |s|
157
158
  s.add_dependency(%q<rake>.freeze, ["~> 0.9"])
158
159
  s.add_dependency(%q<juwelier>.freeze, [">= 0"])
159
160
  s.add_dependency(%q<minitest>.freeze, [">= 0"])
161
+ s.add_dependency(%q<rexml>.freeze, [">= 0"])
160
162
  s.add_dependency(%q<rspec>.freeze, ["~> 3.7.0"])
161
163
  s.add_dependency(%q<sqlite3>.freeze, [">= 1.2.4"])
162
164
  s.add_dependency(%q<activerecord>.freeze, [">= 4.0"])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roxml
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.1
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Woosley
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-07-06 00:00:00.000000000 Z
14
+ date: 2021-09-09 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -83,6 +83,20 @@ dependencies:
83
83
  - - ">="
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
+ - !ruby/object:Gem::Dependency
87
+ name: rexml
88
+ requirement: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ type: :development
94
+ prerelease: false
95
+ version_requirements: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '0'
86
100
  - !ruby/object:Gem::Dependency
87
101
  name: rspec
88
102
  requirement: !ruby/object:Gem::Requirement
@@ -296,7 +310,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
296
310
  - !ruby/object:Gem::Version
297
311
  version: '0'
298
312
  requirements: []
299
- rubygems_version: 3.1.2
313
+ rubygems_version: 3.2.15
300
314
  signing_key:
301
315
  specification_version: 4
302
316
  summary: Ruby Object to XML mapping library