rails-rfc6570 3.3.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +25 -0
  3. data/README.md +3 -1
  4. data/lib/rails/rfc6570/formatter.rb +9 -12
  5. data/lib/rails/rfc6570/patches.rb +1 -1
  6. data/lib/rails/rfc6570/version.rb +1 -1
  7. data/lib/rails/rfc6570.rb +10 -29
  8. data/spec/dummy/config/application.rb +5 -1
  9. data/spec/dummy/config/environments/test.rb +1 -1
  10. data/spec/rails/rfc6570/extensions/route_set_spec.rb +29 -0
  11. data/spec/rails/rfc6570/helper_spec.rb +44 -0
  12. data/spec/rails/rfc6570/visitor_spec.rb +12 -0
  13. data/spec/rails/rfc6570_spec.rb +49 -1
  14. data/spec/spec_helper.rb +6 -0
  15. data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-3bcd2110ca87/LICENSE +21 -0
  16. data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-3bcd2110ca87/README.md +23 -0
  17. data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-3bcd2110ca87/rubocop-config.gemspec +31 -0
  18. data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.3/CHANGELOG.md +285 -0
  19. data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.3/MIT-LICENSE +21 -0
  20. data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.3/README.rdoc +57 -0
  21. data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.3/CHANGELOG.md +129 -0
  22. data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.3/MIT-LICENSE +21 -0
  23. data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.3/README.rdoc +40 -0
  24. data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/CHANGELOG.md +309 -0
  25. data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/MIT-LICENSE +20 -0
  26. data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.3/README.rdoc +40 -0
  27. data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/CHANGELOG.md +301 -0
  28. data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/LICENSE.txt +202 -0
  29. data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/README.md +121 -0
  30. data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/addressable.gemspec +28 -0
  31. data/vendor/bundle/ruby/3.4.0/gems/base64-0.3.0/README.md +48 -0
  32. data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.1/README.md +138 -0
  33. data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.1/benchmark.gemspec +32 -0
  34. data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.2.3/LICENSE +56 -0
  35. data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.2.3/bigdecimal.gemspec +57 -0
  36. data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/MIT-LICENSE +20 -0
  37. data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/README.md +258 -0
  38. data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/builder.gemspec +49 -0
  39. data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/CHANGELOG.md +603 -0
  40. data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/LICENSE.txt +21 -0
  41. data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/README.md +407 -0
  42. data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.4/LICENSE +20 -0
  43. data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.4/README.md +188 -0
  44. data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.4/connection_pool.gemspec +24 -0
  45. data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/LICENSE +18 -0
  46. data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/README.md +192 -0
  47. data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/crass.gemspec +31 -0
  48. data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.6.2/CHANGELOG.md +518 -0
  49. data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.6.2/README.md +92 -0
  50. data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.3/LICENSE.txt +22 -0
  51. data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.3/drb.gemspec +42 -0
  52. data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/CHANGELOG +111 -0
  53. data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/MIT-LICENSE +21 -0
  54. data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/README.rdoc +151 -0
  55. data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/MIT-LICENSE +20 -0
  56. data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/README.md +127 -0
  57. data/vendor/bundle/ruby/3.4.0/gems/logger-1.7.0/README.md +104 -0
  58. data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.1/CHANGELOG.md +598 -0
  59. data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.1/MIT-LICENSE.txt +23 -0
  60. data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.1/README.md +410 -0
  61. data/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.5/README.rdoc +842 -0
  62. data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.10-x86_64-linux-gnu/LICENSE-DEPENDENCIES.md +2224 -0
  63. data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.10-x86_64-linux-gnu/LICENSE.md +9 -0
  64. data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.10-x86_64-linux-gnu/README.md +293 -0
  65. data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.2/CHANGELOG.md +498 -0
  66. data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.2/LICENSE.txt +22 -0
  67. data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.2/README.md +222 -0
  68. data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.ja.rdoc +58 -0
  69. data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.rdoc +60 -0
  70. data/vendor/bundle/ruby/3.4.0/gems/rack-3.2.1/CHANGELOG.md +1236 -0
  71. data/vendor/bundle/ruby/3.4.0/gems/rack-3.2.1/MIT-LICENSE +20 -0
  72. data/vendor/bundle/ruby/3.4.0/gems/rack-3.2.1/README.md +376 -0
  73. data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/MIT-LICENSE.txt +20 -0
  74. data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/README.md +139 -0
  75. data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.3.0/MIT-LICENSE +23 -0
  76. data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.3.0/README.md +94 -0
  77. data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/CHANGELOG.md +255 -0
  78. data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/MIT-LICENSE +23 -0
  79. data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/README.md +267 -0
  80. data/vendor/bundle/ruby/3.4.0/gems/rake-13.3.0/MIT-LICENSE +21 -0
  81. data/vendor/bundle/ruby/3.4.0/gems/rake-13.3.0/README.rdoc +155 -0
  82. data/vendor/bundle/ruby/3.4.0/gems/rake-13.3.0/rake.gemspec +101 -0
  83. data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/LICENSE +21 -0
  84. data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/README.md +107 -0
  85. data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/rake-release.gemspec +23 -0
  86. data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.1/LICENSE.md +27 -0
  87. data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.1/README.md +47 -0
  88. data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.5/LICENSE.md +26 -0
  89. data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.5/README.md +389 -0
  90. data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.5/LICENSE.md +25 -0
  91. data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.5/README.md +326 -0
  92. data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.5/LICENSE.md +25 -0
  93. data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.5/README.md +465 -0
  94. data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.6/LICENSE.md +23 -0
  95. data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.6/README.md +40 -0
  96. data/vendor/bundle/ruby/3.4.0/gems/securerandom-0.4.1/README.md +72 -0
  97. data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/LICENSE +19 -0
  98. data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/README.md +406 -0
  99. data/vendor/bundle/ruby/3.4.0/gems/uri-1.0.3/README.md +55 -0
  100. data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/LICENSE +20 -0
  101. data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/README.md +42 -0
  102. data/vendor/bundle/ruby/3.4.0/specifications/actionpack-8.0.3.gemspec +36 -0
  103. data/vendor/bundle/ruby/3.4.0/specifications/actionview-8.0.3.gemspec +33 -0
  104. data/vendor/bundle/ruby/3.4.0/specifications/activesupport-8.0.3.gemspec +38 -0
  105. data/vendor/bundle/ruby/3.4.0/specifications/addressable-2.8.7.gemspec +30 -0
  106. data/vendor/bundle/ruby/3.4.0/specifications/base64-0.3.0.gemspec +23 -0
  107. data/vendor/bundle/ruby/3.4.0/specifications/benchmark-0.4.1.gemspec +23 -0
  108. data/vendor/bundle/ruby/3.4.0/specifications/bigdecimal-3.2.3.gemspec +25 -0
  109. data/vendor/bundle/ruby/3.4.0/specifications/builder-3.3.0.gemspec +22 -0
  110. data/vendor/bundle/ruby/3.4.0/specifications/concurrent-ruby-1.3.5.gemspec +24 -0
  111. data/vendor/bundle/ruby/3.4.0/specifications/connection_pool-2.5.4.gemspec +28 -0
  112. data/vendor/bundle/ruby/3.4.0/specifications/crass-1.0.6.gemspec +27 -0
  113. data/vendor/bundle/ruby/3.4.0/specifications/diff-lcs-1.6.2.gemspec +35 -0
  114. data/vendor/bundle/ruby/3.4.0/specifications/drb-2.2.3.gemspec +22 -0
  115. data/vendor/bundle/ruby/3.4.0/specifications/erubi-1.13.1.gemspec +29 -0
  116. data/vendor/bundle/ruby/3.4.0/specifications/i18n-1.14.7.gemspec +26 -0
  117. data/vendor/bundle/ruby/3.4.0/specifications/logger-1.7.0.gemspec +22 -0
  118. data/vendor/bundle/ruby/3.4.0/specifications/loofah-2.24.1.gemspec +27 -0
  119. data/vendor/bundle/ruby/3.4.0/specifications/minitest-5.25.5.gemspec +31 -0
  120. data/vendor/bundle/ruby/3.4.0/specifications/nokogiri-1.18.10-x86_64-linux-gnu.gemspec +31 -0
  121. data/vendor/bundle/ruby/3.4.0/specifications/public_suffix-6.0.2.gemspec +24 -0
  122. data/vendor/bundle/ruby/3.4.0/specifications/racc-1.8.1.gemspec +28 -0
  123. data/vendor/bundle/ruby/3.4.0/specifications/rack-3.2.1.gemspec +31 -0
  124. data/vendor/bundle/ruby/3.4.0/specifications/rack-session-2.1.1.gemspec +30 -0
  125. data/vendor/bundle/ruby/3.4.0/specifications/rack-test-2.2.0.gemspec +29 -0
  126. data/vendor/bundle/ruby/3.4.0/specifications/rails-dom-testing-2.3.0.gemspec +28 -0
  127. data/vendor/bundle/ruby/3.4.0/specifications/rails-html-sanitizer-1.6.2.gemspec +27 -0
  128. data/vendor/bundle/ruby/3.4.0/specifications/rake-13.3.0.gemspec +26 -0
  129. data/vendor/bundle/ruby/3.4.0/specifications/rake-release-1.3.0.gemspec +26 -0
  130. data/vendor/bundle/ruby/3.4.0/specifications/rspec-3.13.1.gemspec +31 -0
  131. data/vendor/bundle/ruby/3.4.0/specifications/rspec-core-3.13.5.gemspec +31 -0
  132. data/vendor/bundle/ruby/3.4.0/specifications/rspec-expectations-3.13.5.gemspec +29 -0
  133. data/vendor/bundle/ruby/3.4.0/specifications/rspec-mocks-3.13.5.gemspec +29 -0
  134. data/vendor/bundle/ruby/3.4.0/specifications/rspec-support-3.13.6.gemspec +29 -0
  135. data/vendor/bundle/ruby/3.4.0/specifications/securerandom-0.4.1.gemspec +23 -0
  136. data/vendor/bundle/ruby/3.4.0/specifications/tzinfo-2.0.6.gemspec +30 -0
  137. data/vendor/bundle/ruby/3.4.0/specifications/uri-1.0.3.gemspec +23 -0
  138. data/vendor/bundle/ruby/3.4.0/specifications/useragent-0.16.11.gemspec +25 -0
  139. metadata +129 -8
  140. data/spec/dummy/log/test.log +0 -432
@@ -0,0 +1,57 @@
1
+ # coding: utf-8
2
+
3
+ name = File.basename(__FILE__, '.*')
4
+ source_version = ["", "ext/#{name}/"].find do |dir|
5
+ begin
6
+ break File.foreach(File.join(__dir__, "#{dir}#{name}.c")) {|line|
7
+ break $1.sub("-", ".") if /^#define\s+#{name.upcase}_VERSION\s+"(.+)"/o =~ line
8
+ }
9
+ rescue Errno::ENOENT
10
+ end
11
+ end or raise "can't find #{name.upcase}_VERSION"
12
+
13
+ Gem::Specification.new do |s|
14
+ s.name = name
15
+ s.version = source_version
16
+ s.authors = ["Kenta Murata", "Zachary Scott", "Shigeo Kobayashi"]
17
+ s.email = ["mrkn@mrkn.jp"]
18
+
19
+ s.summary = "Arbitrary-precision decimal floating-point number library."
20
+ s.description = "This library provides arbitrary-precision decimal floating-point number class."
21
+ s.homepage = "https://github.com/ruby/bigdecimal"
22
+ s.licenses = ["Ruby", "BSD-2-Clause"]
23
+
24
+ s.require_paths = %w[lib]
25
+ s.files = %w[
26
+ LICENSE
27
+ bigdecimal.gemspec
28
+ lib/bigdecimal.rb
29
+ lib/bigdecimal/jacobian.rb
30
+ lib/bigdecimal/ludcmp.rb
31
+ lib/bigdecimal/math.rb
32
+ lib/bigdecimal/newton.rb
33
+ lib/bigdecimal/util.rb
34
+ sample/linear.rb
35
+ sample/nlsolve.rb
36
+ sample/pi.rb
37
+ ]
38
+ if Gem::Platform === s.platform and s.platform =~ 'java' or RUBY_ENGINE == 'jruby'
39
+ s.platform = 'java'
40
+ else
41
+ s.extensions = %w[ext/bigdecimal/extconf.rb]
42
+ s.files += %w[
43
+ ext/bigdecimal/bigdecimal.c
44
+ ext/bigdecimal/bigdecimal.h
45
+ ext/bigdecimal/bits.h
46
+ ext/bigdecimal/feature.h
47
+ ext/bigdecimal/missing.c
48
+ ext/bigdecimal/missing.h
49
+ ext/bigdecimal/missing/dtoa.c
50
+ ext/bigdecimal/static_assert.h
51
+ ]
52
+ end
53
+
54
+ s.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
55
+
56
+ s.metadata["changelog_uri"] = s.homepage + "/blob/master/CHANGES.md"
57
+ end
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2003-2012 Jim Weirich (jim.weirich@gmail.com)
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,258 @@
1
+ # Project: Builder
2
+
3
+ ## Goal
4
+
5
+ Provide a simple way to create XML markup and data structures.
6
+
7
+ ## Classes
8
+
9
+ Builder::XmlMarkup:: Generate XML markup notation
10
+ Builder::XmlEvents:: Generate XML events (i.e. SAX-like)
11
+
12
+ **Notes:**
13
+
14
+ * An <tt>Builder::XmlTree</tt> class to generate XML tree
15
+ (i.e. DOM-like) structures is also planned, but not yet implemented.
16
+ Also, the events builder is currently lagging the markup builder in
17
+ features.
18
+
19
+ ## Usage
20
+
21
+ ```ruby
22
+ require 'rubygems'
23
+ require_gem 'builder', '~> 2.0'
24
+
25
+ builder = Builder::XmlMarkup.new
26
+ xml = builder.person { |b| b.name("Jim"); b.phone("555-1234") }
27
+ xml #=> <person><name>Jim</name><phone>555-1234</phone></person>
28
+ ```
29
+
30
+ or
31
+
32
+ ```ruby
33
+ require 'rubygems'
34
+ require_gem 'builder'
35
+
36
+ builder = Builder::XmlMarkup.new(:target=>STDOUT, :indent=>2)
37
+ builder.person { |b| b.name("Jim"); b.phone("555-1234") }
38
+ #
39
+ # Prints:
40
+ # <person>
41
+ # <name>Jim</name>
42
+ # <phone>555-1234</phone>
43
+ # </person>
44
+ ```
45
+
46
+ ## Compatibility
47
+
48
+ ### Version 2.0.0 Compatibility Changes
49
+
50
+ Version 2.0.0 introduces automatically escaped attribute values for
51
+ the first time. Versions prior to 2.0.0 did not insert escape
52
+ characters into attribute values in the XML markup. This allowed
53
+ attribute values to explicitly reference entities, which was
54
+ occasionally used by a small number of developers. Since strings
55
+ could always be explicitly escaped by hand, this was not a major
56
+ restriction in functionality.
57
+
58
+ However, it did surprise most users of builder. Since the body text is
59
+ normally escaped, everybody expected the attribute values to be
60
+ escaped as well. Escaped attribute values were the number one support
61
+ request on the 1.x Builder series.
62
+
63
+ Starting with Builder version 2.0.0, all attribute values expressed as
64
+ strings will be processed and the appropriate characters will be
65
+ escaped (e.g. "&" will be translated to "&amp;amp;"). Attribute values
66
+ that are expressed as Symbol values will not be processed for escaped
67
+ characters and will be unchanged in output. (Yes, this probably counts
68
+ as Symbol abuse, but the convention is convenient and flexible).
69
+
70
+ Example:
71
+
72
+ ```ruby
73
+ xml = Builder::XmlMarkup.new
74
+ xml.sample(:escaped=>"This&That", :unescaped=>:"Here&amp;There")
75
+ xml.target! =>
76
+ <sample escaped="This&amp;That" unescaped="Here&amp;There"/>
77
+ ```
78
+
79
+ ### Version 1.0.0 Compatibility Changes
80
+
81
+ Version 1.0.0 introduces some changes that are not backwards
82
+ compatible with earlier releases of builder. The main areas of
83
+ incompatibility are:
84
+
85
+ * Keyword based arguments to +new+ (rather than positional based). It
86
+ was found that a developer would often like to specify indentation
87
+ without providing an explicit target, or specify a target without
88
+ indentation. Keyword based arguments handle this situation nicely.
89
+
90
+ * Builder must now be an explicit target for markup tags. Instead of
91
+ writing
92
+
93
+ ```ruby
94
+ xml_markup = Builder::XmlMarkup.new
95
+ xml_markup.div { strong("text") }
96
+ ```
97
+
98
+ you need to write
99
+
100
+ ```ruby
101
+ xml_markup = Builder::XmlMarkup.new
102
+ xml_markup.div { xml_markup.strong("text") }
103
+ ```
104
+
105
+ * The builder object is passed as a parameter to all nested markup
106
+ blocks. This allows you to create a short alias for the builder
107
+ object that can be used within the block. For example, the previous
108
+ example can be written as:
109
+
110
+ ```ruby
111
+ xml_markup = Builder::XmlMarkup.new
112
+ xml_markup.div { |xml| xml.strong("text") }
113
+ ```
114
+
115
+ * If you have both a pre-1.0 and a post-1.0 gem of builder installed,
116
+ you can choose which version to use through the RubyGems
117
+ +require_gem+ facility.
118
+
119
+ ```ruby
120
+ require_gem 'builder', "~> 0.0" # Gets the old version
121
+ require_gem 'builder', "~> 1.0" # Gets the new version
122
+ ```
123
+
124
+ ## Features
125
+
126
+ * XML Comments are supported ...
127
+
128
+ ```ruby
129
+ xml_markup.comment! "This is a comment"
130
+ #=> <!-- This is a comment -->
131
+ ```
132
+
133
+ * XML processing instructions are supported ...
134
+
135
+ ```ruby
136
+ xml_markup.instruct! :xml, :version=>"1.0", :encoding=>"UTF-8"
137
+ #=> <?xml version="1.0" encoding="UTF-8"?>
138
+ ```
139
+
140
+ If the processing instruction is omitted, it defaults to "xml".
141
+ When the processing instruction is "xml", the defaults attributes
142
+ are:
143
+
144
+ <b>version</b>: 1.0
145
+ <b>encoding</b>: "UTF-8"
146
+
147
+ (NOTE: if the encoding is set to "UTF-8" and $KCODE is set to
148
+ "UTF8", then Builder will emit UTF-8 encoded strings rather than
149
+ encoding non-ASCII characters as entities.)
150
+
151
+ * XML entity declarations are now supported to a small degree.
152
+
153
+ ```ruby
154
+ xml_markup.declare! :DOCTYPE, :chapter, :SYSTEM, "../dtds/chapter.dtd"
155
+ #=> <!DOCTYPE chapter SYSTEM "../dtds/chapter.dtd">
156
+ ```
157
+
158
+ The parameters to a declare! method must be either symbols or
159
+ strings. Symbols are inserted without quotes, and strings are
160
+ inserted with double quotes. Attribute-like arguments in hashes are
161
+ not allowed.
162
+
163
+ If you need to have an argument to declare! be inserted without
164
+ quotes, but the argument does not conform to the typical Ruby
165
+ syntax for symbols, then use the :"string" form to specify a symbol.
166
+
167
+ For example:
168
+
169
+ ```ruby
170
+ xml_markup.declare! :ELEMENT, :chapter, :"(title,para+)"
171
+ #=> <!ELEMENT chapter (title,para+)>
172
+ ```
173
+
174
+ Nested entity declarations are allowed. For example:
175
+
176
+ ```ruby
177
+ @xml_markup.declare! :DOCTYPE, :chapter do |x|
178
+ x.declare! :ELEMENT, :chapter, :"(title,para+)"
179
+ x.declare! :ELEMENT, :title, :"(#PCDATA)"
180
+ x.declare! :ELEMENT, :para, :"(#PCDATA)"
181
+ end
182
+
183
+ #=>
184
+
185
+ <!DOCTYPE chapter [
186
+ <!ELEMENT chapter (title,para+)>
187
+ <!ELEMENT title (#PCDATA)>
188
+ <!ELEMENT para (#PCDATA)>
189
+ ]>
190
+ ```
191
+
192
+ * Some support for XML namespaces is now available. If the first
193
+ argument to a tag call is a symbol, it will be joined to the tag to
194
+ produce a namespace:tag combination. It is easier to show this than
195
+ describe it.
196
+
197
+ ```ruby
198
+ xml.SOAP :Envelope do ... end
199
+ ```
200
+
201
+ Just put a space before the colon in a namespace to produce the
202
+ right form for builder (e.g. "<tt>SOAP:Envelope</tt>" =>
203
+ "<tt>xml.SOAP :Envelope</tt>")
204
+
205
+ * String attribute values are <em>now</em> escaped by default by
206
+ Builder (<b>NOTE:</b> this is _new_ behavior as of version 2.0).
207
+
208
+ However, occasionally you need to use entities in attribute values.
209
+ Using a symbol (rather than a string) for an attribute value will
210
+ cause Builder to not run its quoting/escaping algorithm on that
211
+ particular value.
212
+
213
+ (<b>Note:</b> The +escape_attrs+ option for builder is now
214
+ obsolete).
215
+
216
+ Example:
217
+
218
+ ```ruby
219
+ xml = Builder::XmlMarkup.new
220
+ xml.sample(:escaped=>"This&That", :unescaped=>:"Here&amp;There")
221
+ xml.target! =>
222
+ <sample escaped="This&amp;That" unescaped="Here&amp;There"/>
223
+ ```
224
+
225
+ * UTF-8 Support
226
+
227
+ Builder correctly translates UTF-8 characters into valid XML. (New
228
+ in version 2.0.0). Thanks to Sam Ruby for the translation code.
229
+
230
+ You can get UTF-8 encoded output by making sure that the XML
231
+ encoding is set to "UTF-8" and that the $KCODE variable is set to
232
+ "UTF8".
233
+
234
+ ```ruby
235
+ $KCODE = 'UTF8'
236
+ xml = Builder::Markup.new
237
+ xml.instruct!(:xml, :encoding => "UTF-8")
238
+ xml.sample("Iñtërnâtiônàl")
239
+ xml.target! =>
240
+ "<sample>Iñtërnâtiônàl</sample>"
241
+ ```
242
+
243
+ ## Links
244
+
245
+ | Description | Link |
246
+ | :----: | :----: |
247
+ | Documents | http://builder.rubyforge.org/ |
248
+ | Github Clone | git://github.com/rails/builder.git |
249
+ | Issue / Bug Reports | https://github.com/rails/builder/issues?state=open |
250
+
251
+ ## Contact
252
+
253
+ | Description | Value |
254
+ | :----: | :----: |
255
+ | Author | Jim Weirich |
256
+ | Email | jim.weirich@gmail.com |
257
+ | Home Page | http://onestepback.org |
258
+ | License | MIT Licence (http://www.opensource.org/licenses/mit-license.html) |
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+ require './lib/builder/version'
3
+
4
+ Gem::Specification.new do |s|
5
+
6
+ #### Basic information.
7
+
8
+ s.name = 'builder'
9
+ s.version = Builder::VERSION
10
+ s.summary = "Builders for MarkUp."
11
+ s.description = %{\
12
+ Builder provides a number of builder objects that make creating structured data
13
+ simple to do. Currently the following builder objects are supported:
14
+
15
+ * XML Markup
16
+ * XML Events
17
+ }
18
+
19
+ pkg_files = Dir[
20
+ '[A-Z]*',
21
+ 'doc/**/*',
22
+ 'lib/**/*.rb',
23
+ 'test/**/*.rb',
24
+ 'rakelib/**/*'
25
+ ]
26
+
27
+ s.files = pkg_files
28
+ s.require_path = 'lib'
29
+
30
+ s.test_files = pkg_files.select { |fn| fn =~ /^test\/test/ }
31
+
32
+ # s.extra_rdoc_files = rd.rdoc_files.reject { |fn| fn =~ /\.rb$/ }.to_a
33
+ s.rdoc_options <<
34
+ '--title' << 'Builder -- Easy XML Building' <<
35
+ '--main' << 'README.rdoc' <<
36
+ '--line-numbers'
37
+
38
+ s.authors = ["Jim Weirich", "Aaron Patterson"]
39
+ s.email = "aron.patterson@gmail.com"
40
+ s.homepage = "https://github.com/rails/builder"
41
+ s.license = 'MIT'
42
+ s.metadata = {
43
+ "bug_tracker_uri" => "#{s.homepage}/issues",
44
+ "changelog_uri" => "#{s.homepage}/blob/master/CHANGES",
45
+ "documentation_uri" => "https://www.rubydoc.info/gems/builder/#{s.version}",
46
+ "homepage_uri" => s.homepage,
47
+ "source_code_uri" => "#{s.homepage}/tree/v#{s.version}"
48
+ }
49
+ end