xommelier 0.1.34 → 0.1.35

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +5 -5
  2. data/.gitlab-ci.yml +19 -0
  3. data/.rubocop_todo.yml +110 -42
  4. data/.travis.yml +1 -2
  5. data/.yardopts +4 -0
  6. data/LICENSE +21 -0
  7. data/README.md +9 -167
  8. data/bin/console +1 -1
  9. data/{examples → example}/atom.rb +10 -8
  10. data/example/building_an_atom_feed.output.xml +31 -0
  11. data/example/building_an_atom_feed.rb +49 -0
  12. data/example/building_an_atom_feed_using_hash.output.xml +34 -0
  13. data/example/building_an_atom_feed_using_hash.rb +28 -0
  14. data/example/reading_an_atom_feed.rb +13 -0
  15. data/{examples → example}/xml.rb +0 -0
  16. data/lib/xommelier.rb +0 -1
  17. data/lib/xommelier/atom.rb +0 -1
  18. data/lib/xommelier/atom/category.rb +0 -1
  19. data/lib/xommelier/atom/content.rb +0 -1
  20. data/lib/xommelier/atom/entry.rb +0 -1
  21. data/lib/xommelier/atom/feed.rb +0 -1
  22. data/lib/xommelier/atom/full.rb +0 -1
  23. data/lib/xommelier/atom/generator.rb +0 -1
  24. data/lib/xommelier/atom/history.rb +0 -1
  25. data/lib/xommelier/atom/link.rb +0 -1
  26. data/lib/xommelier/atom/links_extension.rb +0 -1
  27. data/lib/xommelier/atom/person.rb +0 -1
  28. data/lib/xommelier/atom/source.rb +0 -1
  29. data/lib/xommelier/atom/threading.rb +0 -1
  30. data/lib/xommelier/common.rb +1 -2
  31. data/lib/xommelier/core_ext.rb +0 -1
  32. data/lib/xommelier/core_ext/boolean.rb +0 -1
  33. data/lib/xommelier/core_ext/date.rb +0 -1
  34. data/lib/xommelier/core_ext/float.rb +0 -1
  35. data/lib/xommelier/core_ext/numeric.rb +1 -2
  36. data/lib/xommelier/core_ext/string.rb +0 -1
  37. data/lib/xommelier/core_ext/symbol.rb +0 -1
  38. data/lib/xommelier/core_ext/time.rb +0 -1
  39. data/lib/xommelier/core_ext/uri.rb +0 -1
  40. data/lib/xommelier/ds.rb +0 -1
  41. data/lib/xommelier/dsig11.rb +0 -1
  42. data/lib/xommelier/factory_girl.rb +0 -1
  43. data/lib/xommelier/open_search.rb +0 -1
  44. data/lib/xommelier/opml.rb +0 -1
  45. data/lib/xommelier/rss.rb +0 -1
  46. data/lib/xommelier/rss/atomic.rb +0 -1
  47. data/lib/xommelier/sitemap.rb +0 -1
  48. data/lib/xommelier/version.rb +1 -2
  49. data/lib/xommelier/xml.rb +0 -1
  50. data/lib/xommelier/xml/element.rb +0 -1
  51. data/lib/xommelier/xml/element/namespace.rb +0 -1
  52. data/lib/xommelier/xml/element/serialization.rb +2 -7
  53. data/lib/xommelier/xml/element/structure.rb +0 -1
  54. data/lib/xommelier/xml/element/structure/property.rb +0 -1
  55. data/lib/xommelier/xml/namespace.rb +0 -1
  56. data/lib/xommelier/xml/schema.rb +0 -1
  57. data/spec/functional/xommelier/atom/feed/building_hash_spec.rb +0 -1
  58. data/spec/functional/xommelier/atom/feed/building_spec.rb +0 -1
  59. data/spec/functional/xommelier/atom/feed/parsing_spec.rb +2 -3
  60. data/spec/functional/xommelier/atom/threading/building_spec.rb +0 -1
  61. data/spec/functional/xommelier/open_search/description/building_spec.rb +0 -1
  62. data/spec/functional/xommelier/open_search/description/parsing_spec.rb +0 -1
  63. data/spec/functional/xommelier/rss/rss/building_spec.rb +0 -1
  64. data/spec/functional/xommelier/rss/rss/parsing_spec.rb +0 -1
  65. data/spec/lib/xommelier/atom/entry_spec.rb +0 -1
  66. data/spec/lib/xommelier/atom_spec.rb +0 -1
  67. data/spec/lib/xommelier/ds/canonicalization_method_spec.rb +0 -1
  68. data/spec/lib/xommelier/ds/digest_method_spec.rb +0 -1
  69. data/spec/lib/xommelier/ds/reference_spec.rb +0 -1
  70. data/spec/lib/xommelier/ds/signature_method_spec.rb +0 -1
  71. data/spec/lib/xommelier/ds/signature_spec.rb +0 -1
  72. data/spec/lib/xommelier/ds/signed_info_spec.rb +0 -1
  73. data/spec/lib/xommelier/ds/transform_spec.rb +0 -1
  74. data/spec/lib/xommelier/ds_spec.rb +0 -1
  75. data/spec/lib/xommelier/rss/email_address_spec.rb +0 -1
  76. data/spec/lib/xommelier/xml/element/serialization_spec.rb +0 -1
  77. data/spec/lib/xommelier/xml/element/structure_spec.rb +0 -1
  78. data/spec/lib/xommelier/xml/element_spec.rb +0 -1
  79. data/spec/lib/xommelier/xml_spec.rb +0 -1
  80. data/spec/lib/xommelier_spec.rb +0 -1
  81. data/spec/spec_helper.rb +1 -3
  82. data/spec/support/fixtures.rb +0 -1
  83. data/spec/support/namespaced_module.rb +0 -1
  84. data/spec/support/schema_validatable.rb +0 -1
  85. data/xommelier.gemspec +8 -10
  86. metadata +43 -37
  87. data/MIT-LICENSE +0 -20
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -56,9 +55,7 @@ module Xommelier
56
55
  xml = Nokogiri::XML(xml) if IO === xml || String === xml
57
56
  @_xml_node = options.delete(:node) { xml.at_xpath(element_xpath(xml.document, element_name)) }
58
57
 
59
- if text? && @_xml_node.inner_html.present?
60
- self.text = @_xml_node.inner_html
61
- end
58
+ self.text = @_xml_node.inner_html if text? && @_xml_node.inner_html.present?
62
59
 
63
60
  self.class.attributes.values.each do |attribute|
64
61
  deserialize_attribute(attribute)
@@ -265,9 +262,7 @@ module Xommelier
265
262
  end
266
263
  else
267
264
  xmlns = element.overridden_xmlns || self.xmlns
268
- prefix = if xmlns != xml.doc.namespaces['xmlns']
269
- xml.doc.namespaces.key(element.ns.uri).try(:[], 6..-1).presence
270
- end
265
+ prefix = (xml.doc.namespaces.key(element.ns.uri).try(:[], 6..-1).presence if xmlns != xml.doc.namespaces['xmlns'])
271
266
  case value
272
267
  when Xommelier::Xml::Element
273
268
  value.to_xommelier(
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -41,7 +40,7 @@ describe Xommelier::Atom::Feed do
41
40
  its(:rights) { should == '© Mark Pilgrim, 2003' }
42
41
  describe 'Generator' do
43
42
  subject { feed.generator }
44
- context '#to_s' do
43
+ describe '#to_s' do
45
44
  it { is_expected.to eq('Example Toolkit') }
46
45
  its(:text) { should == 'Example Toolkit' }
47
46
  end
@@ -92,7 +91,7 @@ describe Xommelier::Atom::Feed do
92
91
  it { expect(entry.contributors[0].name).to eq('Sam Ruby') }
93
92
  it { expect(entry.contributors[1].name).to eq('Joe Gregorio') }
94
93
  its(:summary) { should == 'Some text.' }
95
- context 'Content' do
94
+ describe 'Content' do
96
95
  subject { entry.content }
97
96
  it { is_expected.to match(/#{Regexp.escape('[Update: The Atom draft is finished.]')}/) }
98
97
  its(:text) do
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -6,7 +5,7 @@
6
5
  # Author: Alexander Semyonov <al@semyonov.us> #
7
6
  ################################################
8
7
 
9
- SPEC_ROOT = File.expand_path('../..', __FILE__)
8
+ SPEC_ROOT = File.expand_path('..', __dir__)
10
9
  require 'simplecov'
11
10
  require 'codeclimate-test-reporter'
12
11
  # CodeClimate::TestReporter.start
@@ -27,7 +26,6 @@ ATOM_XMLNS = 'http://www.w3.org/2005/Atom'.freeze
27
26
  RSpec.configure do |config|
28
27
  config.mock_with :rspec
29
28
  config.order = 'random'
30
- config.treat_symbols_as_metadata_keys_with_true_values = true
31
29
  config.filter_run focus: true
32
30
  config.run_all_when_everything_filtered = true
33
31
  end
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
3
  ################################################
@@ -1,8 +1,6 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: true
3
2
 
4
- $LOAD_PATH.push Pathname(__dir__).join('lib')
5
- require 'xommelier/version'
3
+ require_relative 'lib/xommelier/version'
6
4
 
7
5
  Gem::Specification.new do |s|
8
6
  s.name = 'xommelier'
@@ -10,7 +8,7 @@ Gem::Specification.new do |s|
10
8
  s.authors = ['Alexander Semyonov']
11
9
  s.email = %w[al@semyonov.us]
12
10
  s.homepage = 'https://gitlab.com/alsemyonov/xommelier'
13
- s.summary = 'Xommelier is an XML Sommelier'
11
+ s.summary = 'Xommelier. The XML Sommelier'
14
12
  s.description = 'XML-Object Mapper with many built-in XML formats supported'
15
13
  s.license = 'MIT'
16
14
 
@@ -19,20 +17,20 @@ Gem::Specification.new do |s|
19
17
  s.executables = `git ls-files -- exe/*`.split("\n").map { |f| File.basename(f) }
20
18
  s.require_paths = %w[lib]
21
19
 
22
- s.add_dependency 'nokogiri', '~> 1.7.1'
23
- s.add_dependency 'activesupport', '>= 4.2.2'
24
20
  s.add_dependency 'activemodel'
21
+ s.add_dependency 'activesupport', '>= 4.2.2'
22
+ s.add_dependency 'nokogiri', '~> 1.8.3'
25
23
  s.add_dependency 'tzinfo', '~> 1.2'
26
24
 
27
25
  s.add_development_dependency 'bundler-audit'
28
26
  s.add_development_dependency 'codeclimate-test-reporter'
29
27
  s.add_development_dependency 'pry'
30
- s.add_development_dependency 'rspec', '~> 3.5.0'
31
- s.add_development_dependency 'rspec-its', '~> 1.2.0'
32
28
  s.add_development_dependency 'rake', '~> 12.0'
33
29
  s.add_development_dependency 'redcarpet'
30
+ s.add_development_dependency 'rspec', '~> 3.5'
31
+ s.add_development_dependency 'rspec-its', '~> 1.2.0'
34
32
  s.add_development_dependency 'rubocop', '~> 0.48'
35
33
  s.add_development_dependency 'rubocop-rspec'
36
- s.add_development_dependency 'simplecov', '~> 0.13.0'
37
- s.add_development_dependency 'yard', '~> 0.9.8'
34
+ s.add_development_dependency 'simplecov', '~> 0.13'
35
+ s.add_development_dependency 'yard', '~> 0.9.11'
38
36
  end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xommelier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.34
4
+ version: 0.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Semyonov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-06 00:00:00.000000000 Z
11
+ date: 2018-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: nokogiri
14
+ name: activemodel
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.7.1
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.7.1
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 4.2.2
41
41
  - !ruby/object:Gem::Dependency
42
- name: activemodel
42
+ name: nokogiri
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 1.8.3
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 1.8.3
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: tzinfo
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -109,61 +109,61 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: rspec
112
+ name: rake
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 3.5.0
117
+ version: '12.0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 3.5.0
124
+ version: '12.0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: rspec-its
126
+ name: redcarpet
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - "~>"
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 1.2.0
131
+ version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - "~>"
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: 1.2.0
138
+ version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: rake
140
+ name: rspec
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '12.0'
145
+ version: '3.5'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '12.0'
152
+ version: '3.5'
153
153
  - !ruby/object:Gem::Dependency
154
- name: redcarpet
154
+ name: rspec-its
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
157
+ - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '0'
159
+ version: 1.2.0
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ">="
164
+ - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '0'
166
+ version: 1.2.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: rubocop
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -198,28 +198,28 @@ dependencies:
198
198
  requirements:
199
199
  - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: 0.13.0
201
+ version: '0.13'
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: 0.13.0
208
+ version: '0.13'
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: yard
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: 0.9.8
215
+ version: 0.9.11
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: 0.9.8
222
+ version: 0.9.11
223
223
  description: XML-Object Mapper with many built-in XML formats supported
224
224
  email:
225
225
  - al@semyonov.us
@@ -228,13 +228,14 @@ extensions: []
228
228
  extra_rdoc_files: []
229
229
  files:
230
230
  - ".gitignore"
231
+ - ".gitlab-ci.yml"
231
232
  - ".rspec"
232
233
  - ".rubocop.yml"
233
234
  - ".rubocop_todo.yml"
234
235
  - ".travis.yml"
235
236
  - ".yardopts"
236
237
  - Gemfile
237
- - MIT-LICENSE
238
+ - LICENSE
238
239
  - README.md
239
240
  - Rakefile
240
241
  - bin/console
@@ -242,8 +243,13 @@ files:
242
243
  - bin/rubocop
243
244
  - bin/setup
244
245
  - config/giteaucrat.yml
245
- - examples/atom.rb
246
- - examples/xml.rb
246
+ - example/atom.rb
247
+ - example/building_an_atom_feed.output.xml
248
+ - example/building_an_atom_feed.rb
249
+ - example/building_an_atom_feed_using_hash.output.xml
250
+ - example/building_an_atom_feed_using_hash.rb
251
+ - example/reading_an_atom_feed.rb
252
+ - example/xml.rb
247
253
  - lib/xommelier.rb
248
254
  - lib/xommelier/atom.rb
249
255
  - lib/xommelier/atom/category.rb
@@ -363,10 +369,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
363
369
  version: '0'
364
370
  requirements: []
365
371
  rubyforge_project:
366
- rubygems_version: 2.5.2
372
+ rubygems_version: 2.7.7
367
373
  signing_key:
368
374
  specification_version: 4
369
- summary: Xommelier is an XML Sommelier
375
+ summary: Xommelier. The XML Sommelier
370
376
  test_files:
371
377
  - spec/fixtures/atom.rng.xml
372
378
  - spec/fixtures/ds_rsa.xml