xommelier 0.1.32 → 0.1.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/.rubocop.yml +2 -0
  4. data/.rubocop_todo.yml +91 -0
  5. data/Gemfile +1 -21
  6. data/Rakefile +10 -17
  7. data/bin/console +13 -0
  8. data/bin/rake +17 -0
  9. data/bin/rubocop +17 -0
  10. data/bin/setup +8 -0
  11. data/examples/atom.rb +1 -0
  12. data/examples/xml.rb +1 -0
  13. data/lib/xommelier/atom/category.rb +1 -0
  14. data/lib/xommelier/atom/content.rb +1 -0
  15. data/lib/xommelier/atom/entry.rb +1 -0
  16. data/lib/xommelier/atom/feed.rb +1 -0
  17. data/lib/xommelier/atom/full.rb +1 -0
  18. data/lib/xommelier/atom/generator.rb +1 -0
  19. data/lib/xommelier/atom/history.rb +1 -0
  20. data/lib/xommelier/atom/link.rb +2 -1
  21. data/lib/xommelier/atom/links_extension.rb +1 -0
  22. data/lib/xommelier/atom/person.rb +1 -0
  23. data/lib/xommelier/atom/source.rb +1 -0
  24. data/lib/xommelier/atom/threading.rb +1 -0
  25. data/lib/xommelier/atom.rb +1 -0
  26. data/lib/xommelier/common.rb +6 -1
  27. data/lib/xommelier/core_ext/boolean.rb +3 -2
  28. data/lib/xommelier/core_ext/date.rb +1 -0
  29. data/lib/xommelier/core_ext/float.rb +1 -0
  30. data/lib/xommelier/core_ext/numeric.rb +1 -0
  31. data/lib/xommelier/core_ext/string.rb +1 -0
  32. data/lib/xommelier/core_ext/symbol.rb +1 -0
  33. data/lib/xommelier/core_ext/time.rb +2 -1
  34. data/lib/xommelier/core_ext/uri.rb +2 -1
  35. data/lib/xommelier/core_ext.rb +1 -0
  36. data/lib/xommelier/ds.rb +10 -11
  37. data/lib/xommelier/dsig11.rb +2 -3
  38. data/lib/xommelier/factory_girl.rb +1 -0
  39. data/lib/xommelier/open_search.rb +3 -2
  40. data/lib/xommelier/opml.rb +10 -10
  41. data/lib/xommelier/rss/atomic.rb +1 -0
  42. data/lib/xommelier/rss.rb +11 -10
  43. data/lib/xommelier/sitemap.rb +1 -0
  44. data/lib/xommelier/version.rb +2 -1
  45. data/lib/xommelier/xml/element/namespace.rb +6 -8
  46. data/lib/xommelier/xml/element/serialization.rb +17 -19
  47. data/lib/xommelier/xml/element/structure/property.rb +5 -4
  48. data/lib/xommelier/xml/element/structure.rb +9 -8
  49. data/lib/xommelier/xml/element.rb +3 -4
  50. data/lib/xommelier/xml/namespace.rb +2 -1
  51. data/lib/xommelier/xml/schema.rb +2 -1
  52. data/lib/xommelier/xml.rb +1 -0
  53. data/lib/xommelier.rb +1 -0
  54. data/spec/functional/xommelier/atom/feed/building_hash_spec.rb +12 -11
  55. data/spec/functional/xommelier/atom/feed/building_spec.rb +6 -5
  56. data/spec/functional/xommelier/atom/feed/parsing_spec.rb +6 -5
  57. data/spec/functional/xommelier/atom/threading/building_spec.rb +7 -6
  58. data/spec/functional/xommelier/open_search/description/building_spec.rb +11 -10
  59. data/spec/functional/xommelier/open_search/description/parsing_spec.rb +2 -1
  60. data/spec/functional/xommelier/rss/rss/building_spec.rb +5 -4
  61. data/spec/functional/xommelier/rss/rss/parsing_spec.rb +4 -3
  62. data/spec/lib/xommelier/atom/entry_spec.rb +2 -1
  63. data/spec/lib/xommelier/atom_spec.rb +15 -0
  64. data/spec/lib/xommelier/ds/canonicalization_method_spec.rb +23 -0
  65. data/spec/lib/xommelier/ds/digest_method_spec.rb +16 -0
  66. data/spec/lib/xommelier/ds/reference_spec.rb +15 -0
  67. data/spec/lib/xommelier/ds/signature_method_spec.rb +23 -0
  68. data/spec/lib/xommelier/ds/signature_spec.rb +30 -0
  69. data/spec/lib/xommelier/ds/signed_info_spec.rb +15 -0
  70. data/spec/lib/xommelier/ds/transform_spec.rb +31 -0
  71. data/spec/lib/xommelier/ds_spec.rb +1 -90
  72. data/spec/lib/xommelier/rss/email_address_spec.rb +1 -0
  73. data/spec/lib/xommelier/xml/element/serialization_spec.rb +1 -0
  74. data/spec/lib/xommelier/xml/element/structure_spec.rb +4 -3
  75. data/spec/lib/xommelier/xml/element_spec.rb +2 -1
  76. data/spec/lib/xommelier/xml_spec.rb +1 -6
  77. data/spec/lib/xommelier_spec.rb +1 -0
  78. data/spec/spec_helper.rb +4 -3
  79. data/spec/support/fixtures.rb +1 -0
  80. data/spec/support/namespaced_module.rb +1 -0
  81. data/spec/support/schema_validatable.rb +2 -9
  82. data/xommelier.gemspec +12 -6
  83. metadata +97 -8
  84. data/Guardfile +0 -11
  85. data/Termfile +0 -36
  86. data/console +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5021eac8283a90857cbf59e48a66eba7f920483a
4
- data.tar.gz: 9903d50374acb7e8d1478b19ae6890289a9936cf
3
+ metadata.gz: 8efd12643e1728124fd07f7360f9fdd0299877d4
4
+ data.tar.gz: ac8c6374588a5833395bc1fae2326ee2d7cadb45
5
5
  SHA512:
6
- metadata.gz: 189d9e449e0af6d6cbebb21fa8ac822184aa3d6afa4d7b02d6015909f88049327a3202c6459a9917ac0d629e0f30c3d3fddada45ae9cb031a64f58523e93bba8
7
- data.tar.gz: 47df7ea79aabb669ab39b2847dc2248d92d9baf5f540ef7d27571df09265c682c9ad2e3dfb390ddf401c54df73a373ab3011885f3a88ddd78c8e45b581ad4e12
6
+ metadata.gz: c52795d9e01d132eee5b12563cc88d021d6ab8f1c25fa4c3b8a6af19339ac540b5603ff2e6ba77ffc4cbb9cdfea4863b3f89b0bdbdf2f79b7b35d5d7c32a9e9a
7
+ data.tar.gz: 33c3b8a099a78fa0c523ae71869da2a4b210f44934243f58a4ee787a55a98df5191aa5512c5620d317cec1cc7a58013aa247014851ace633dddfbb9d22f9a472
data/.gitignore CHANGED
@@ -1,4 +1,3 @@
1
- /bin
2
1
  *.gem
3
2
  /.bundle
4
3
  /Gemfile.lock
data/.rubocop.yml ADDED
@@ -0,0 +1,2 @@
1
+ require: rubocop-rspec
2
+ inherit_from: .rubocop_todo.yml
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,91 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2016-07-05 04:35:13 +0300 using RuboCop version 0.41.1.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 1
10
+ Lint/ShadowingOuterLocalVariable:
11
+ Exclude:
12
+ - 'examples/atom.rb'
13
+
14
+ # Offense count: 9
15
+ Metrics/AbcSize:
16
+ Max: 70
17
+
18
+ # Offense count: 2
19
+ Metrics/CyclomaticComplexity:
20
+ Max: 14
21
+
22
+ # Offense count: 125
23
+ # Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
24
+ # URISchemes: http, https
25
+ Metrics/LineLength:
26
+ Max: 265
27
+
28
+ # Offense count: 10
29
+ # Configuration parameters: CountComments.
30
+ Metrics/MethodLength:
31
+ Max: 46
32
+
33
+ # Offense count: 1
34
+ # Configuration parameters: CountComments.
35
+ Metrics/ModuleLength:
36
+ Max: 203
37
+
38
+ # Offense count: 3
39
+ Metrics/PerceivedComplexity:
40
+ Max: 15
41
+
42
+ # Offense count: 61
43
+ Style/AsciiComments:
44
+ Enabled: false
45
+
46
+ # Offense count: 2
47
+ Style/CaseEquality:
48
+ Exclude:
49
+ - 'lib/xommelier/xml/element/serialization.rb'
50
+
51
+ # Offense count: 1
52
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
53
+ # SupportedStyles: nested, compact
54
+ Style/ClassAndModuleChildren:
55
+ Exclude:
56
+ - 'lib/xommelier/core_ext/uri.rb'
57
+
58
+ # Offense count: 110
59
+ Style/Documentation:
60
+ Enabled: false
61
+
62
+ # Offense count: 1
63
+ Style/DoubleNegation:
64
+ Exclude:
65
+ - 'lib/xommelier/xml/element.rb'
66
+
67
+ # Offense count: 1
68
+ Style/EachWithObject:
69
+ Exclude:
70
+ - 'lib/xommelier/xml/element/serialization.rb'
71
+
72
+ # Offense count: 1
73
+ # Configuration parameters: MinBodyLength.
74
+ Style/GuardClause:
75
+ Exclude:
76
+ - 'lib/xommelier/xml/element/namespace.rb'
77
+
78
+ # Offense count: 1
79
+ Style/IfInsideElse:
80
+ Exclude:
81
+ - 'lib/xommelier/xml/element/serialization.rb'
82
+
83
+ # Offense count: 1
84
+ # Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
85
+ # NamePrefix: is_, has_, have_
86
+ # NamePrefixBlacklist: is_, has_, have_
87
+ # NameWhitelist: is_a?
88
+ Style/PredicateName:
89
+ Exclude:
90
+ - 'spec/**/*'
91
+ - 'lib/xommelier/ds.rb'
data/Gemfile CHANGED
@@ -1,27 +1,7 @@
1
+ # frozen_string_literal: true
1
2
  source 'https://rubygems.org'
2
3
 
3
4
  # Specify your gem's dependencies in xommelier.gemspec
4
5
  gemspec
5
6
 
6
- group :ide do
7
- gem 'ripl'
8
- gem 'ripl-auto_indent', require: 'ripl/auto_indent'
9
- gem 'ripl-color_error', require: 'ripl/color_error'
10
- gem 'ripl-color_result', require: 'ripl/color_result'
11
- gem 'ripl-multi_line', require: 'ripl/multi_line'
12
- gem 'ripl-rails', require: 'ripl/rails'
13
- gem 'ripl-rocket', require: 'ripl/rocket'
14
- gem 'guard'
15
- gem 'guard-rspec'
16
- gem 'guard-bundler'
17
- gem 'rb-inotify'
18
- gem 'libnotify'
19
- gem 'terminal-notifier-guard'
20
- gem 'rb-fsevent'
21
- end
22
-
23
- group :documentation do
24
- gem 'yard'
25
- end
26
-
27
7
  gem 'simplecov', require: false, group: :test
data/Rakefile CHANGED
@@ -1,21 +1,14 @@
1
+ # frozen_string_literal: true
1
2
  require 'bundler/gem_tasks'
2
3
 
3
- begin
4
- require 'yard'
5
- YARD::Rake::YardocTask.new(:doc)
6
- rescue LoadError
7
- task :doc do
8
- abort 'YARD is not available. In order to run yardoc, you must: gem install yard'
9
- end
10
- end
4
+ require 'rspec/core/rake_task'
5
+ RSpec::Core::RakeTask.new(:spec)
6
+ task default: :spec
11
7
 
12
- begin
13
- require 'rspec/core/rake_task'
14
- RSpec::Core::RakeTask.new(:spec)
15
- rescue LoadError
16
- task :spec do
17
- abort 'RSpec is not available. In order to run specs, you must: gem install rspec'
18
- end
19
- end
8
+ require 'rubocop/rake_task'
9
+ RuboCop::RakeTask.new
10
+ task default: :rubocop
20
11
 
21
- task default: :spec
12
+ require 'yard'
13
+ YARD::Rake::YardocTask.new(:doc)
14
+ task default: :doc
data/bin/console ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ require 'bundler/setup'
4
+ require 'xommelier'
5
+ require 'pry'
6
+ require 'pry-byebug'
7
+ require 'pp'
8
+
9
+ SPEC_ROOT = File.expand_path('..', __FILE__)
10
+
11
+ Dir[File.join(SPEC_ROOT, 'spec/support/**/*.rb')].each { |f| require f }
12
+
13
+ Pry.start
data/bin/rake ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'rake' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require 'pathname'
11
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require 'rubygems'
15
+ require 'bundler/setup'
16
+
17
+ load Gem.bin_path('rake', 'rake')
data/bin/rubocop ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+ #
4
+ # This file was generated by Bundler.
5
+ #
6
+ # The application 'rubocop' is installed as part of a gem, and
7
+ # this file is here to facilitate running it.
8
+ #
9
+
10
+ require 'pathname'
11
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
12
+ Pathname.new(__FILE__).realpath)
13
+
14
+ require 'rubygems'
15
+ require 'bundler/setup'
16
+
17
+ load Gem.bin_path('rubocop', 'rubocop')
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/examples/atom.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'xommelier/atom'
2
3
  require 'xommelier/atom/threading'
3
4
  require 'active_support/core_ext'
data/examples/xml.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'xommelier'
2
3
 
3
4
  class Author < Xommelier::Xml::Element
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -13,7 +14,7 @@ module Xommelier
13
14
  attribute :href, type: Uri
14
15
 
15
16
  may do
16
- attribute :rel#, type: Enum(:alternate, :related, :self, :enclosure, :via)
17
+ attribute :rel # , type: Enum(:alternate, :related, :self, :enclosure, :via)
17
18
  attribute :type
18
19
  attribute :hreflang
19
20
  attribute :title
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -15,7 +16,11 @@ module Xommelier
15
16
  return unless value
16
17
  case value
17
18
  when String
18
- value = rfc2822(value) rescue parse(value)
19
+ value = begin
20
+ rfc2822(value)
21
+ rescue
22
+ parse(value)
23
+ end
19
24
  at(value)
20
25
  when Time, Date, DateTime
21
26
  at(value.to_time)
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -9,11 +10,11 @@
9
10
  require 'xommelier'
10
11
 
11
12
  class Boolean
12
- #noinspection RubyStringKeysInHashInspection,RubyDuplicatedKeysInHashInspection
13
+ # noinspection RubyStringKeysInHashInspection,RubyDuplicatedKeysInHashInspection
13
14
  BOOLEAN_MAP = {
14
15
  true => true, 'true' => true, 'TRUE' => true, '1' => true, '1.0' => true, 1 => true, 1.0 => true,
15
16
  false => false, 'false' => false, 'FALSE' => false, '0' => false, '0.0' => false, 0 => false, 0.0 => false, nil => false, '' => false
16
- }
17
+ }.freeze
17
18
 
18
19
  def self.from_xommelier(value)
19
20
  BOOLEAN_MAP[value]
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -9,7 +10,7 @@ require 'time'
9
10
 
10
11
  class Time
11
12
  def self.from_xommelier(value)
12
- return if value == nil
13
+ return if value.nil?
13
14
  case value
14
15
  when String
15
16
  Time.xmlschema(value)
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -17,7 +18,7 @@ end
17
18
 
18
19
  class Uri < String
19
20
  def self.from_xommelier(value)
20
- return if value == nil
21
+ return if value.nil?
21
22
  case value
22
23
  when URI::Generic
23
24
  value
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
data/lib/xommelier/ds.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -7,7 +8,7 @@
7
8
 
8
9
  require 'xommelier'
9
10
  require 'base64'
10
- require 'delegate'
11
+ require 'active_support/core_ext/module/delegation'
11
12
 
12
13
  module Xommelier
13
14
  module DS
@@ -30,16 +31,14 @@ module Xommelier
30
31
  end
31
32
 
32
33
  def inspect
33
- %(#<#{self.class.name} "#{to_s}">)
34
+ %(#<#{self.class.name} "#{self}">)
34
35
  end
35
36
 
36
37
  def raw
37
38
  __getobj__
38
39
  end
39
40
 
40
- def to_s
41
- to_xommelier.to_s
42
- end
41
+ delegate :to_s, to: :to_xommelier
43
42
 
44
43
  def to_xommelier
45
44
  Base64.encode64(raw)
@@ -57,19 +56,19 @@ module Xommelier
57
56
  super(name, options)
58
57
  end
59
58
 
60
- def self.any!(options = {})
61
- # TODO implement <any /> logic
59
+ def self.any!(_options = {})
60
+ # TODO: implement <any /> logic
62
61
  end
63
62
 
64
- def self.choice!(options = {})
65
- # TODO implement <choice /> logic
63
+ def self.choice!(_options = {})
64
+ # TODO: implement <choice /> logic
66
65
  may do
67
66
  yield
68
67
  end
69
68
  end
70
69
 
71
- def self.sequence!(options = {})
72
- # TODO implement <choice /> logic
70
+ def self.sequence!(_options = {})
71
+ # TODO: implement <choice /> logic
73
72
  yield
74
73
  end
75
74
 
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -103,9 +104,7 @@ module Xommelier
103
104
 
104
105
  class X509Digest < Element
105
106
  text
106
- has_algorithm(
107
-
108
- )
107
+ has_algorithm
109
108
  end
110
109
  end
111
110
  end
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -58,7 +59,7 @@ module Xommelier
58
59
  end
59
60
 
60
61
  class Query < Element
61
- attribute :role#, type: Enum[:request, :example, :related, :correction, :subset, :superset]
62
+ attribute :role # , type: Enum[:request, :example, :related, :correction, :subset, :superset]
62
63
 
63
64
  may do
64
65
  attribute :title
@@ -88,7 +89,7 @@ module Xommelier
88
89
  element :long_name
89
90
  element :developer
90
91
  element :attribution
91
- element :syndication_right, type: String, default: 'open' #, type: Enum[:open, :limited, :private, :closed]
92
+ element :syndication_right, type: String, default: 'open' # , type: Enum[:open, :limited, :private, :closed]
92
93
  element :adult_content, type: Boolean
93
94
  element :language, default: '*'
94
95
  element :input_encoding, default: 'UTF-8'
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #
@@ -20,7 +21,7 @@ module Xommelier
20
21
  end
21
22
 
22
23
  def category?
23
- [0] == nil
24
+ [0].nil?
24
25
  end
25
26
 
26
27
  def tag?
@@ -38,7 +39,7 @@ module Xommelier
38
39
  end
39
40
 
40
41
  def to_xommelier
41
- map { |category| category.to_xommelier }.join(',')
42
+ map(&:to_xommelier).join(',')
42
43
  end
43
44
  end
44
45
 
@@ -65,16 +66,15 @@ module Xommelier
65
66
  element :owner_email
66
67
  element :owner_id
67
68
  element :docs
68
- #element :expansionState
69
- #element :vertScrollState
70
- #element :windowTop
71
- #element :windowLeft
72
- #element :windowBottom
73
- #element :windowRight
69
+ # element :expansionState
70
+ # element :vertScrollState
71
+ # element :windowTop
72
+ # element :windowLeft
73
+ # element :windowBottom
74
+ # element :windowRight
74
75
  end
75
76
  end
76
77
 
77
-
78
78
  class Outline < Element
79
79
  attribute :text
80
80
 
@@ -100,7 +100,7 @@ module Xommelier
100
100
  end
101
101
 
102
102
  def each_outline(&block)
103
- block.call(self)
103
+ yield(self)
104
104
  outlines.each do |outline|
105
105
  outline.each_outline(&block)
106
106
  end
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  ################################################
4
5
  # © Alexander Semyonov, 2011—2013, MIT License #