rails-rfc6570 3.3.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (138) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -0
  3. data/README.md +3 -1
  4. data/lib/rails/rfc6570/version.rb +1 -1
  5. data/lib/rails/rfc6570.rb +10 -29
  6. data/spec/dummy/config/application.rb +5 -1
  7. data/spec/dummy/config/environments/test.rb +1 -1
  8. data/spec/rails/rfc6570/extensions/route_set_spec.rb +29 -0
  9. data/spec/rails/rfc6570/helper_spec.rb +44 -0
  10. data/spec/rails/rfc6570/visitor_spec.rb +12 -0
  11. data/spec/spec_helper.rb +6 -0
  12. data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/LICENSE +21 -0
  13. data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/README.md +23 -0
  14. data/vendor/bundle/ruby/3.4.0/bundler/gems/rubocop-config-67802c9d1826/rubocop-config.gemspec +31 -0
  15. data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/CHANGELOG.md +205 -0
  16. data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/MIT-LICENSE +21 -0
  17. data/vendor/bundle/ruby/3.4.0/gems/actionpack-8.0.1/README.rdoc +57 -0
  18. data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/CHANGELOG.md +67 -0
  19. data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/MIT-LICENSE +21 -0
  20. data/vendor/bundle/ruby/3.4.0/gems/actionview-8.0.1/README.rdoc +40 -0
  21. data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/CHANGELOG.md +157 -0
  22. data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/MIT-LICENSE +20 -0
  23. data/vendor/bundle/ruby/3.4.0/gems/activesupport-8.0.1/README.rdoc +40 -0
  24. data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/CHANGELOG.md +301 -0
  25. data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/LICENSE.txt +202 -0
  26. data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/README.md +121 -0
  27. data/vendor/bundle/ruby/3.4.0/gems/addressable-2.8.7/addressable.gemspec +28 -0
  28. data/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/LICENSE.txt +22 -0
  29. data/vendor/bundle/ruby/3.4.0/gems/base64-0.2.0/README.md +48 -0
  30. data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.0/README.md +138 -0
  31. data/vendor/bundle/ruby/3.4.0/gems/benchmark-0.4.0/benchmark.gemspec +32 -0
  32. data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.1.9/LICENSE +56 -0
  33. data/vendor/bundle/ruby/3.4.0/gems/bigdecimal-3.1.9/bigdecimal.gemspec +57 -0
  34. data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/MIT-LICENSE +20 -0
  35. data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/README.md +258 -0
  36. data/vendor/bundle/ruby/3.4.0/gems/builder-3.3.0/builder.gemspec +49 -0
  37. data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/CHANGELOG.md +603 -0
  38. data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/LICENSE.txt +21 -0
  39. data/vendor/bundle/ruby/3.4.0/gems/concurrent-ruby-1.3.5/README.md +407 -0
  40. data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/LICENSE +20 -0
  41. data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/README.md +167 -0
  42. data/vendor/bundle/ruby/3.4.0/gems/connection_pool-2.5.0/connection_pool.gemspec +24 -0
  43. data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/LICENSE +18 -0
  44. data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/README.md +192 -0
  45. data/vendor/bundle/ruby/3.4.0/gems/crass-1.0.6/crass.gemspec +31 -0
  46. data/vendor/bundle/ruby/3.4.0/gems/diff-lcs-1.5.1/README.rdoc +84 -0
  47. data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.1/LICENSE.txt +22 -0
  48. data/vendor/bundle/ruby/3.4.0/gems/drb-2.2.1/drb.gemspec +41 -0
  49. data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/CHANGELOG +111 -0
  50. data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/MIT-LICENSE +21 -0
  51. data/vendor/bundle/ruby/3.4.0/gems/erubi-1.13.1/README.rdoc +151 -0
  52. data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/MIT-LICENSE +20 -0
  53. data/vendor/bundle/ruby/3.4.0/gems/i18n-1.14.7/README.md +127 -0
  54. data/vendor/bundle/ruby/3.4.0/gems/logger-1.6.5/README.md +104 -0
  55. data/vendor/bundle/ruby/3.4.0/gems/logger-1.6.5/logger.gemspec +28 -0
  56. data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/CHANGELOG.md +591 -0
  57. data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/MIT-LICENSE.txt +23 -0
  58. data/vendor/bundle/ruby/3.4.0/gems/loofah-2.24.0/README.md +410 -0
  59. data/vendor/bundle/ruby/3.4.0/gems/minitest-5.25.4/README.rdoc +835 -0
  60. data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.2-x86_64-linux-gnu/LICENSE-DEPENDENCIES.md +2224 -0
  61. data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.2-x86_64-linux-gnu/LICENSE.md +9 -0
  62. data/vendor/bundle/ruby/3.4.0/gems/nokogiri-1.18.2-x86_64-linux-gnu/README.md +293 -0
  63. data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/CHANGELOG.md +491 -0
  64. data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/LICENSE.txt +22 -0
  65. data/vendor/bundle/ruby/3.4.0/gems/public_suffix-6.0.1/README.md +222 -0
  66. data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.ja.rdoc +58 -0
  67. data/vendor/bundle/ruby/3.4.0/gems/racc-1.8.1/README.rdoc +60 -0
  68. data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.9/CHANGELOG.md +1006 -0
  69. data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.9/MIT-LICENSE +20 -0
  70. data/vendor/bundle/ruby/3.4.0/gems/rack-3.1.9/README.md +328 -0
  71. data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/MIT-LICENSE.txt +20 -0
  72. data/vendor/bundle/ruby/3.4.0/gems/rack-test-2.2.0/README.md +139 -0
  73. data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.2.0/MIT-LICENSE +23 -0
  74. data/vendor/bundle/ruby/3.4.0/gems/rails-dom-testing-2.2.0/README.md +91 -0
  75. data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/CHANGELOG.md +255 -0
  76. data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/MIT-LICENSE +23 -0
  77. data/vendor/bundle/ruby/3.4.0/gems/rails-html-sanitizer-1.6.2/README.md +267 -0
  78. data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/MIT-LICENSE +21 -0
  79. data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/README.rdoc +155 -0
  80. data/vendor/bundle/ruby/3.4.0/gems/rake-13.2.1/rake.gemspec +101 -0
  81. data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/LICENSE +21 -0
  82. data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/README.md +107 -0
  83. data/vendor/bundle/ruby/3.4.0/gems/rake-release-1.3.0/rake-release.gemspec +23 -0
  84. data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.0/LICENSE.md +27 -0
  85. data/vendor/bundle/ruby/3.4.0/gems/rspec-3.13.0/README.md +47 -0
  86. data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/LICENSE.md +26 -0
  87. data/vendor/bundle/ruby/3.4.0/gems/rspec-core-3.13.2/README.md +389 -0
  88. data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/LICENSE.md +25 -0
  89. data/vendor/bundle/ruby/3.4.0/gems/rspec-expectations-3.13.3/README.md +326 -0
  90. data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/LICENSE.md +25 -0
  91. data/vendor/bundle/ruby/3.4.0/gems/rspec-mocks-3.13.2/README.md +465 -0
  92. data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/LICENSE.md +23 -0
  93. data/vendor/bundle/ruby/3.4.0/gems/rspec-support-3.13.2/README.md +40 -0
  94. data/vendor/bundle/ruby/3.4.0/gems/securerandom-0.4.1/README.md +72 -0
  95. data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/LICENSE +19 -0
  96. data/vendor/bundle/ruby/3.4.0/gems/tzinfo-2.0.6/README.md +406 -0
  97. data/vendor/bundle/ruby/3.4.0/gems/uri-1.0.2/README.md +55 -0
  98. data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/LICENSE +20 -0
  99. data/vendor/bundle/ruby/3.4.0/gems/useragent-0.16.11/README.md +42 -0
  100. data/vendor/bundle/ruby/3.4.0/specifications/actionpack-8.0.1.gemspec +36 -0
  101. data/vendor/bundle/ruby/3.4.0/specifications/actionview-8.0.1.gemspec +33 -0
  102. data/vendor/bundle/ruby/3.4.0/specifications/activesupport-8.0.1.gemspec +38 -0
  103. data/vendor/bundle/ruby/3.4.0/specifications/addressable-2.8.7.gemspec +30 -0
  104. data/vendor/bundle/ruby/3.4.0/specifications/base64-0.2.0.gemspec +23 -0
  105. data/vendor/bundle/ruby/3.4.0/specifications/benchmark-0.4.0.gemspec +23 -0
  106. data/vendor/bundle/ruby/3.4.0/specifications/bigdecimal-3.1.9.gemspec +25 -0
  107. data/vendor/bundle/ruby/3.4.0/specifications/builder-3.3.0.gemspec +22 -0
  108. data/vendor/bundle/ruby/3.4.0/specifications/concurrent-ruby-1.3.5.gemspec +24 -0
  109. data/vendor/bundle/ruby/3.4.0/specifications/connection_pool-2.5.0.gemspec +28 -0
  110. data/vendor/bundle/ruby/3.4.0/specifications/crass-1.0.6.gemspec +27 -0
  111. data/vendor/bundle/ruby/3.4.0/specifications/diff-lcs-1.5.1.gemspec +37 -0
  112. data/vendor/bundle/ruby/3.4.0/specifications/drb-2.2.1.gemspec +22 -0
  113. data/vendor/bundle/ruby/3.4.0/specifications/erubi-1.13.1.gemspec +29 -0
  114. data/vendor/bundle/ruby/3.4.0/specifications/i18n-1.14.7.gemspec +26 -0
  115. data/vendor/bundle/ruby/3.4.0/specifications/logger-1.6.5.gemspec +22 -0
  116. data/vendor/bundle/ruby/3.4.0/specifications/loofah-2.24.0.gemspec +27 -0
  117. data/vendor/bundle/ruby/3.4.0/specifications/minitest-5.25.4.gemspec +31 -0
  118. data/vendor/bundle/ruby/3.4.0/specifications/nokogiri-1.18.2-x86_64-linux-gnu.gemspec +31 -0
  119. data/vendor/bundle/ruby/3.4.0/specifications/public_suffix-6.0.1.gemspec +24 -0
  120. data/vendor/bundle/ruby/3.4.0/specifications/racc-1.8.1.gemspec +28 -0
  121. data/vendor/bundle/ruby/3.4.0/specifications/rack-3.1.9.gemspec +31 -0
  122. data/vendor/bundle/ruby/3.4.0/specifications/rack-session-2.1.0.gemspec +30 -0
  123. data/vendor/bundle/ruby/3.4.0/specifications/rack-test-2.2.0.gemspec +29 -0
  124. data/vendor/bundle/ruby/3.4.0/specifications/rails-dom-testing-2.2.0.gemspec +28 -0
  125. data/vendor/bundle/ruby/3.4.0/specifications/rails-html-sanitizer-1.6.2.gemspec +27 -0
  126. data/vendor/bundle/ruby/3.4.0/specifications/rake-13.2.1.gemspec +26 -0
  127. data/vendor/bundle/ruby/3.4.0/specifications/rake-release-1.3.0.gemspec +26 -0
  128. data/vendor/bundle/ruby/3.4.0/specifications/rspec-3.13.0.gemspec +31 -0
  129. data/vendor/bundle/ruby/3.4.0/specifications/rspec-core-3.13.2.gemspec +39 -0
  130. data/vendor/bundle/ruby/3.4.0/specifications/rspec-expectations-3.13.3.gemspec +33 -0
  131. data/vendor/bundle/ruby/3.4.0/specifications/rspec-mocks-3.13.2.gemspec +33 -0
  132. data/vendor/bundle/ruby/3.4.0/specifications/rspec-support-3.13.2.gemspec +29 -0
  133. data/vendor/bundle/ruby/3.4.0/specifications/securerandom-0.4.1.gemspec +23 -0
  134. data/vendor/bundle/ruby/3.4.0/specifications/tzinfo-2.0.6.gemspec +30 -0
  135. data/vendor/bundle/ruby/3.4.0/specifications/uri-1.0.2.gemspec +23 -0
  136. data/vendor/bundle/ruby/3.4.0/specifications/useragent-0.16.11.gemspec +25 -0
  137. metadata +130 -8
  138. data/spec/dummy/log/test.log +0 -432
@@ -0,0 +1,192 @@
1
+ Crass
2
+ =====
3
+
4
+ Crass is a Ruby CSS parser that's fully compliant with the
5
+ [CSS Syntax Level 3][css] specification.
6
+
7
+ * [Home](https://github.com/rgrove/crass/)
8
+ * [API Docs](http://rubydoc.info/github/rgrove/crass/master)
9
+
10
+ [![Build Status](https://travis-ci.org/rgrove/crass.svg?branch=master)](https://travis-ci.org/rgrove/crass)
11
+ [![Gem Version](https://badge.fury.io/rb/crass.svg)](http://badge.fury.io/rb/crass)
12
+
13
+ Features
14
+ --------
15
+
16
+ * Pure Ruby, with no runtime dependencies other than Ruby 1.9.x or higher.
17
+
18
+ * Tokenizes and parses CSS according to the rules defined in the 14 November
19
+ 2014 editor's draft of the [CSS Syntax Level 3][css] specification.
20
+
21
+ * Extremely tolerant of broken or invalid CSS. If a browser can handle it, Crass
22
+ should be able to handle it too.
23
+
24
+ * Optionally includes comments in the token stream.
25
+
26
+ * Optionally preserves certain CSS hacks, such as the IE "*" hack, which would
27
+ otherwise be discarded according to CSS3 tokenizing rules.
28
+
29
+ * Capable of serializing the parse tree back to CSS while maintaining all
30
+ original whitespace, comments, and indentation.
31
+
32
+ [css]: http://dev.w3.org/csswg/css-syntax/
33
+
34
+ Problems
35
+ --------
36
+
37
+ * Crass isn't terribly fast. I mean, it's Ruby, and it's not really slow by Ruby
38
+ standards. But compared to the CSS parser in your average browser? Yeah, it's
39
+ slow.
40
+
41
+ * Crass only parses the CSS syntax; it doesn't understand what any of it means,
42
+ doesn't coalesce selectors, etc. You can do this yourself by consuming the
43
+ parse tree, though.
44
+
45
+ * While any node in the parse tree (or the parse tree as a whole) can be
46
+ serialized back to CSS with perfect fidelity, changes made to those nodes
47
+ (except for wholesale removal of nodes) are not reflected in the serialized
48
+ output.
49
+
50
+ * Crass only supports UTF-8 input and doesn't respect `@charset` rules. Input in
51
+ any other encoding will be converted to UTF-8.
52
+
53
+ Installing
54
+ ----------
55
+
56
+ ```
57
+ gem install crass
58
+ ```
59
+
60
+ Examples
61
+ --------
62
+
63
+ Say you have a string containing some CSS:
64
+
65
+ ```css
66
+ /* Comment! */
67
+ a:hover {
68
+ color: #0d8bfa;
69
+ text-decoration: underline;
70
+ }
71
+ ```
72
+
73
+ Parsing it is simple:
74
+
75
+ ```ruby
76
+ tree = Crass.parse(css, :preserve_comments => true)
77
+ ```
78
+
79
+ This returns a big fat beautiful parse tree, which looks like this:
80
+
81
+ ```ruby
82
+ [{:node=>:comment, :pos=>0, :raw=>"/* Comment! */", :value=>" Comment! "},
83
+ {:node=>:whitespace, :pos=>14, :raw=>"\n"},
84
+ {:node=>:style_rule,
85
+ :selector=>
86
+ {:node=>:selector,
87
+ :value=>"a:hover",
88
+ :tokens=>
89
+ [{:node=>:ident, :pos=>15, :raw=>"a", :value=>"a"},
90
+ {:node=>:colon, :pos=>16, :raw=>":"},
91
+ {:node=>:ident, :pos=>17, :raw=>"hover", :value=>"hover"},
92
+ {:node=>:whitespace, :pos=>22, :raw=>" "}]},
93
+ :children=>
94
+ [{:node=>:whitespace, :pos=>24, :raw=>"\n "},
95
+ {:node=>:property,
96
+ :name=>"color",
97
+ :value=>"#0d8bfa",
98
+ :children=>
99
+ [{:node=>:whitespace, :pos=>33, :raw=>" "},
100
+ {:node=>:hash,
101
+ :pos=>34,
102
+ :raw=>"#0d8bfa",
103
+ :type=>:unrestricted,
104
+ :value=>"0d8bfa"}],
105
+ :important=>false,
106
+ :tokens=>
107
+ [{:node=>:ident, :pos=>27, :raw=>"color", :value=>"color"},
108
+ {:node=>:colon, :pos=>32, :raw=>":"},
109
+ {:node=>:whitespace, :pos=>33, :raw=>" "},
110
+ {:node=>:hash,
111
+ :pos=>34,
112
+ :raw=>"#0d8bfa",
113
+ :type=>:unrestricted,
114
+ :value=>"0d8bfa"}]},
115
+ {:node=>:semicolon, :pos=>41, :raw=>";"},
116
+ {:node=>:whitespace, :pos=>42, :raw=>"\n "},
117
+ {:node=>:property,
118
+ :name=>"text-decoration",
119
+ :value=>"underline",
120
+ :children=>
121
+ [{:node=>:whitespace, :pos=>61, :raw=>" "},
122
+ {:node=>:ident, :pos=>62, :raw=>"underline", :value=>"underline"}],
123
+ :important=>false,
124
+ :tokens=>
125
+ [{:node=>:ident,
126
+ :pos=>45,
127
+ :raw=>"text-decoration",
128
+ :value=>"text-decoration"},
129
+ {:node=>:colon, :pos=>60, :raw=>":"},
130
+ {:node=>:whitespace, :pos=>61, :raw=>" "},
131
+ {:node=>:ident, :pos=>62, :raw=>"underline", :value=>"underline"}]},
132
+ {:node=>:semicolon, :pos=>71, :raw=>";"},
133
+ {:node=>:whitespace, :pos=>72, :raw=>"\n"}]}]
134
+ ```
135
+
136
+ If you want, you can stringify the parse tree:
137
+
138
+ ```ruby
139
+ css = Crass::Parser.stringify(tree)
140
+ ```
141
+
142
+ ...which gives you back exactly what you put in!
143
+
144
+ ```css
145
+ /* Comment! */
146
+ a:hover {
147
+ color: #0d8bfa;
148
+ text-decoration: underline;
149
+ }
150
+ ```
151
+
152
+ Wasn't that exciting?
153
+
154
+ A Note on Versioning
155
+ --------------------
156
+
157
+ As of version 1.0.0, Crass adheres strictly to [SemVer 2.0][semver].
158
+
159
+ [semver]:http://semver.org/spec/v2.0.0.html
160
+
161
+ Contributing
162
+ ------------
163
+
164
+ The best way to contribute is to use Crass and [create issues][issue] when you
165
+ run into problems.
166
+
167
+ Pull requests that fix bugs are more than welcome as long as they include tests.
168
+ Please adhere to the style and format of the surrounding code, or I might ask
169
+ you to change things.
170
+
171
+ If you want to add a feature or refactor something, please get in touch first to
172
+ make sure I'm on board with your idea and approach; I'm pretty picky, and I'd
173
+ hate to have to turn down a pull request you spent a lot of time on.
174
+
175
+ [issue]: https://github.com/rgrove/crass/issues/new
176
+
177
+ Acknowledgments
178
+ ---------------
179
+
180
+ I'm deeply, deeply grateful to [Simon Sapin][simon] for his wonderfully
181
+ comprehensive [CSS parsing tests][css-tests], which I adapted to create many of
182
+ Crass's tests. They've been invaluable in helping me fix bugs and handle weird
183
+ edge cases, and Crass would be much crappier without them.
184
+
185
+ I'm also grateful to [Tab Atkins Jr.][tab] and Simon Sapin (again!) for their
186
+ work on the [CSS Syntax Level 3][spec] specification, which defines the
187
+ tokenizing and parsing rules that Crass implements.
188
+
189
+ [css-tests]:https://github.com/SimonSapin/css-parsing-tests/
190
+ [simon]:http://exyr.org/about/
191
+ [spec]:http://www.w3.org/TR/css-syntax-3/
192
+ [tab]:http://www.xanthir.com/contact/
@@ -0,0 +1,31 @@
1
+ # encoding: utf-8
2
+ require './lib/crass/version'
3
+
4
+ Gem::Specification.new do |s|
5
+ s.name = 'crass'
6
+ s.summary = 'CSS parser based on the CSS Syntax Level 3 spec.'
7
+ s.description = 'Crass is a pure Ruby CSS parser based on the CSS Syntax Level 3 spec.'
8
+ s.version = Crass::VERSION
9
+ s.authors = ['Ryan Grove']
10
+ s.email = ['ryan@wonko.com']
11
+ s.homepage = 'https://github.com/rgrove/crass/'
12
+ s.license = 'MIT'
13
+
14
+ s.metadata = {
15
+ 'bug_tracker_uri' => 'https://github.com/rgrove/crass/issues',
16
+ 'changelog_uri' => "https://github.com/rgrove/crass/blob/v#{s.version}/HISTORY.md",
17
+ 'documentation_uri' => "https://www.rubydoc.info/gems/crass/#{s.version}",
18
+ 'source_code_uri' => "https://github.com/rgrove/crass/tree/v#{s.version}",
19
+ }
20
+
21
+ s.platform = Gem::Platform::RUBY
22
+ s.required_ruby_version = Gem::Requirement.new('>= 1.9.2')
23
+
24
+ s.require_paths = ['lib']
25
+
26
+ s.files = `git ls-files -z`.split("\x0").grep_v(%r{^test/})
27
+
28
+ # Development dependencies.
29
+ s.add_development_dependency 'minitest', '~> 5.0.8'
30
+ s.add_development_dependency 'rake', '~> 10.1.0'
31
+ end
@@ -0,0 +1,84 @@
1
+ = Diff::LCS
2
+
3
+ home :: https://github.com/halostatue/diff-lcs
4
+ code :: https://github.com/halostatue/diff-lcs
5
+ bugs :: https://github.com/halostatue/diff-lcs/issues
6
+ rdoc :: http://rubydoc.info/github/halostatue/diff-lcs
7
+ continuous integration :: {<img src="https://github.com/halostatue/diff-lcs/workflows/CI/badge.svg" />}[https://github.com/halostatue/diff-lcs/actions]
8
+
9
+ == Description
10
+
11
+ Diff::LCS computes the difference between two Enumerable sequences using the
12
+ McIlroy-Hunt longest common subsequence (LCS) algorithm. It includes utilities
13
+ to create a simple HTML diff output format and a standard diff-like tool.
14
+
15
+ This is release 1.4.3, providing a simple extension that allows for
16
+ Diff::LCS::Change objects to be treated implicitly as arrays and fixes a
17
+ number of formatting issues.
18
+
19
+ Ruby versions below 2.5 are soft-deprecated, which means that older versions
20
+ are no longer part of the CI test suite. If any changes have been introduced
21
+ that break those versions, bug reports and patches will be accepted, but it
22
+ will be up to the reporter to verify any fixes prior to release. The next
23
+ major release will completely break compatibility.
24
+
25
+ == Synopsis
26
+
27
+ Using this module is quite simple. By default, Diff::LCS does not extend
28
+ objects with the Diff::LCS interface, but will be called as if it were a
29
+ function:
30
+
31
+ require 'diff/lcs'
32
+
33
+ seq1 = %w(a b c e h j l m n p)
34
+ seq2 = %w(b c d e f j k l m r s t)
35
+
36
+ lcs = Diff::LCS.LCS(seq1, seq2)
37
+ diffs = Diff::LCS.diff(seq1, seq2)
38
+ sdiff = Diff::LCS.sdiff(seq1, seq2)
39
+ seq = Diff::LCS.traverse_sequences(seq1, seq2, callback_obj)
40
+ bal = Diff::LCS.traverse_balanced(seq1, seq2, callback_obj)
41
+ seq2 == Diff::LCS.patch!(seq1, diffs)
42
+ seq1 == Diff::LCS.unpatch!(seq2, diffs)
43
+ seq2 == Diff::LCS.patch!(seq1, sdiff)
44
+ seq1 == Diff::LCS.unpatch!(seq2, sdiff)
45
+
46
+ Objects can be extended with Diff::LCS:
47
+
48
+ seq1.extend(Diff::LCS)
49
+ lcs = seq1.lcs(seq2)
50
+ diffs = seq1.diff(seq2)
51
+ sdiff = seq1.sdiff(seq2)
52
+ seq = seq1.traverse_sequences(seq2, callback_obj)
53
+ bal = seq1.traverse_balanced(seq2, callback_obj)
54
+ seq2 == seq1.patch!(diffs)
55
+ seq1 == seq2.unpatch!(diffs)
56
+ seq2 == seq1.patch!(sdiff)
57
+ seq1 == seq2.unpatch!(sdiff)
58
+
59
+ By requiring 'diff/lcs/array' or 'diff/lcs/string', Array or String will be
60
+ extended for use this way.
61
+
62
+ Note that Diff::LCS requires a sequenced enumerable container, which means that
63
+ the order of enumeration is both predictable and consistent for the same set of
64
+ data. While it is theoretically possible to generate a diff for an unordered
65
+ hash, it will only be meaningful if the enumeration of the hashes is
66
+ consistent. In general, this will mean that containers that behave like String
67
+ or Array will perform best.
68
+
69
+ == History
70
+
71
+ Diff::LCS is a port of Perl's Algorithm::Diff that uses the McIlroy-Hunt
72
+ longest common subsequence (LCS) algorithm to compute intelligent differences
73
+ between two sequenced enumerable containers. The implementation is based on
74
+ Mario I. Wolczko's
75
+ {Smalltalk version 1.2}[ftp://st.cs.uiuc.edu/pub/Smalltalk/MANCHESTER/manchester/4.0/diff.st]
76
+ (1993) and Ned Konz's Perl version
77
+ {Algorithm::Diff 1.15}[http://search.cpan.org/~nedkonz/Algorithm-Diff-1.15/].
78
+ Diff::LCS#sdiff and Diff::LCS#traverse_balanced were originally written for the
79
+ Perl version by Mike Schilli.
80
+
81
+ The algorithm is described in <em>A Fast Algorithm for Computing Longest Common
82
+ Subsequences</em>, CACM, vol.20, no.5, pp.350-353, May 1977, with a few minor
83
+ improvements to improve the speed. A simplified description of the algorithm,
84
+ originally written for the Perl version, was written by Mark-Jason Dominus.
@@ -0,0 +1,22 @@
1
+ Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions
5
+ are met:
6
+ 1. Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ 2. Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
11
+
12
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
+ SUCH DAMAGE.
@@ -0,0 +1,41 @@
1
+ begin
2
+ require_relative "lib/drb/version"
3
+ rescue LoadError # Fallback to load version file in ruby core repository
4
+ require_relative "version"
5
+ end
6
+
7
+ Gem::Specification.new do |spec|
8
+ spec.name = "drb"
9
+ spec.version = DRb::VERSION
10
+ spec.authors = ["Masatoshi SEKI"]
11
+ spec.email = ["seki@ruby-lang.org"]
12
+
13
+ spec.summary = %q{Distributed object system for Ruby}
14
+ spec.description = %q{Distributed object system for Ruby}
15
+ spec.homepage = "https://github.com/ruby/drb"
16
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
17
+ spec.licenses = ["Ruby", "BSD-2-Clause"]
18
+
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = spec.homepage
21
+
22
+ spec.files = %w[
23
+ LICENSE.txt
24
+ drb.gemspec
25
+ lib/drb.rb
26
+ lib/drb/acl.rb
27
+ lib/drb/drb.rb
28
+ lib/drb/eq.rb
29
+ lib/drb/extserv.rb
30
+ lib/drb/extservm.rb
31
+ lib/drb/gw.rb
32
+ lib/drb/invokemethod.rb
33
+ lib/drb/observer.rb
34
+ lib/drb/ssl.rb
35
+ lib/drb/timeridconv.rb
36
+ lib/drb/unix.rb
37
+ lib/drb/version.rb
38
+ lib/drb/weakidconv.rb
39
+ ]
40
+ spec.require_paths = ["lib"]
41
+ end
@@ -0,0 +1,111 @@
1
+ === 1.13.1 (2024-12-19)
2
+
3
+ * Avoid spurious frozen string literal warnings for chilled strings when using Ruby 3.4 (jeremyevans)
4
+
5
+ === 1.13.0 (2024-06-13)
6
+
7
+ * Define Erubi.h as a module function (jeremyevans)
8
+
9
+ * Add erubi/capture_block, supporting capturing block output via standard <%= and <%== tags (jeremyevans)
10
+
11
+ === 1.12.0 (2022-12-22)
12
+
13
+ * Use erb/escape for faster html escaping if available (jeremyevans)
14
+
15
+ * Default :freeze_template_literals option to false if running with --enable-frozen-string-literal (casperisfine) (#35)
16
+
17
+ === 1.11.0 (2022-08-02)
18
+
19
+ * Support :freeze_template_literals option for configuring whether to add .freeze to template literal strings (casperisfine) (#33)
20
+
21
+ * Support :chain_appends option for chaining appends to the buffer variable (casperisfine, jeremyevans) (#32)
22
+
23
+ * Avoid unnecessary defined? usage on Ruby 3+ when using the :ensure option (jeremyevans)
24
+
25
+ === 1.10.0 (2020-11-13)
26
+
27
+ * Improve template parsing, mostly by reducing allocations (jeremyevans)
28
+
29
+ * Do not ship tests in the gem, reducing gem size about 20% (jeremyevans)
30
+
31
+ * Support :literal_prefix and :literal_postfix options for how to output literal tags (e.g. <%% code %>) (jaredcwhite) (#26, #27)
32
+
33
+ === 1.9.0 (2019-09-25)
34
+
35
+ * Change default :bufvar from 'String.new' to '::String.new' to work with BasicObject (jeremyevans)
36
+
37
+ === 1.8.0 (2018-12-18)
38
+
39
+ * Support :yield_returns_buffer option in capture_end for always returning the (potentially modified) buffer in <%|= tags (evanleck) (#15)
40
+
41
+ === 1.7.1 (2018-03-05)
42
+
43
+ * Make whitespace handling for <%# %> tags more compatible with Erubis (jeremyevans) (#14)
44
+
45
+ === 1.7.0 (2017-10-09)
46
+
47
+ * Fix escaping in erubi/capture_end, the setting was previously inverted (jeremyevans) (#10)
48
+
49
+ === 1.6.1 (2017-06-27)
50
+
51
+ * Fix usage on newer versions of JRuby 9.1 (jeremyevans)
52
+
53
+ === 1.6.0 (2017-02-27)
54
+
55
+ * Use cgi/escape if available for 6x faster HTML escaping (k0kubun, jeremyevans) (#4)
56
+
57
+ === 1.5.0 (2017-01-26)
58
+
59
+ * Drop tilt/erubi file, as tilt now ships with Erubi support (jeremyevans)
60
+
61
+ * Drop erubi/capture file, Erubi::CaptureEngine support (jeremyevans)
62
+
63
+ === 1.4.0 (2017-01-20)
64
+
65
+ * Allow postambles to depend on internal state of engine (jeremyevans)
66
+
67
+ * Allow overriding of behavior for <%= and <%== tags to depend on which indicator was used (jeremyevans)
68
+
69
+ * Make whitespace handling for <% %> tags more compatible with Erubis for subclasses overriding add_text (jeremyevans)
70
+
71
+ === 1.3.0 (2016-12-29)
72
+
73
+ * Support :capture=>:explicit option in tilt support to use Erubi::CaptureEndEngine (jeremyevans)
74
+
75
+ * Add erubi/capture_end containing Erubi::CaptureEndEngine, allowing <%|= and <%|== for opening capture tags, and <%| for closing capture tags (jeremyevans)
76
+
77
+ === 1.2.1 (2016-11-21)
78
+
79
+ * Don't automatically freeze template text strings on ruby 1.9 or 2.0 (jeremyevans)
80
+
81
+ === 1.2.0 (2016-11-21)
82
+
83
+ * Engine#src now returns a frozen string (jeremyevans)
84
+
85
+ * Automatically freeze template text strings on ruby 2.1+, reducing garbage generated (jeremyevans)
86
+
87
+ * Allow overriding of behavior for <%= and <%== tags (ujifgc) (#1)
88
+
89
+ === 1.1.0 (2016-11-14)
90
+
91
+ * Add :ensure option to supporting restoring bufvar to original value (jeremyevans)
92
+
93
+ * Don't have tilt support require erb (jeremyevans)
94
+
95
+ * Support :engine_class option in tilt support to override engine class used (jeremyevans)
96
+
97
+ * Support :capture option in tilt support to use Erubi::CaptureEngine (jeremyevans)
98
+
99
+ * Add erubi/capture file containing Erubi::CaptureEngine, allowing <%|= and <%|== for capture (and escaping) blocks in templates (jeremyevans)
100
+
101
+ * Raise ArgumentError if template source code contains indicators matched by regexp but not handled (jeremyevans)
102
+
103
+ * Add :bufval option to support arbitrary buffer values (jeremyevans)
104
+
105
+ * Add :regexp option to specify regexp used for scanning (jeremyevans)
106
+
107
+ * Add :src option to specify initial template source (jeremyevans)
108
+
109
+ === 1.0.0 (2016-11-10)
110
+
111
+ * Initial Public Release
@@ -0,0 +1,21 @@
1
+ copyright(c) 2006-2011 kuwata-lab.com all rights reserved.
2
+ copyright(c) 2016-2021 Jeremy Evans
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining
5
+ a copy of this software and associated documentation files (the
6
+ "Software"), to deal in the Software without restriction, including
7
+ without limitation the rights to use, copy, modify, merge, publish,
8
+ distribute, sublicense, and/or sell copies of the Software, and to
9
+ permit persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,151 @@
1
+ = Erubi
2
+
3
+ Erubi is a ERB template engine for ruby. It is a simplified fork of Erubis, using
4
+ the same basic algorithm, with the following differences:
5
+
6
+ * Handles postfix conditionals when using escaping (e.g. <tt><%= foo if bar %></tt>)
7
+ * Supports frozen_string_literal: true in templates via :freeze option
8
+ * Works with ruby's <tt>--enable-frozen-string-literal</tt> option
9
+ * Automatically freezes strings for template text when ruby optimizes it (on ruby 2.1+)
10
+ * Escapes <tt>'</tt> (apostrophe) when escaping for better XSS protection
11
+ * Has 15x-6x faster escaping by using erb/escape or cgi/escape
12
+ * Has 81% smaller memory footprint (calculated using +ObjectSpace.memsize_of_all+)
13
+ * Does no monkey patching (Erubis adds a method to Kernel)
14
+ * Uses an immutable design (all options passed to the constructor, which returns a frozen object)
15
+ * Has simpler internals (1 file, <150 lines of code)
16
+ * Is not dead (Erubis hasn't been updated since 2011)
17
+
18
+ It is not designed with Erubis API compatibility in mind, though most Erubis
19
+ ERB syntax works, with the following exceptions:
20
+
21
+ * No support for <tt><%===</tt> for debug output
22
+
23
+ = Installation
24
+
25
+ gem install erubi
26
+
27
+ = Source Code
28
+
29
+ Source code is available on GitHub at https://github.com/jeremyevans/erubi
30
+
31
+ = Usage
32
+
33
+ Erubi only has built in support for retrieving the generated source for a
34
+ file:
35
+
36
+ require 'erubi'
37
+ eval(Erubi::Engine.new(File.read('filename.erb')).src)
38
+
39
+ Most users will probably use Erubi via Rails or Tilt. Erubi is the default
40
+ erb template handler in Tilt 2.0.6+ and Rails 5.1+.
41
+
42
+ == Capturing
43
+
44
+ Erubi does not support capturing block output into the template by default.
45
+ It currently ships with two implementations that allow it.
46
+
47
+ === Erubi::CaptureBlockEngine
48
+
49
+ The recommended implementation can be required via +erubi/capture_block+,
50
+ which allows capturing to work with normal <tt><%=</tt> and <tt><%==</tt>
51
+ tags.
52
+
53
+ <%= form do %>
54
+ <input>
55
+ <% end %>
56
+
57
+ When using the capture_block support, capture methods should just return
58
+ the text it emit into the template, and call +capture+ on the buffer value.
59
+ Since the buffer variable is a local variable and not an instance variable
60
+ by default, you'll probably want to set the +:bufvar+ variable when using
61
+ the capture_block support to an instance variable, and have any methods
62
+ used call capture on that instance variable. Example:
63
+
64
+ def form(&block)
65
+ "<form>#{@_buf.capture(&block)}</form>"
66
+ end
67
+
68
+ puts eval(Erubi::CaptureBlockEngine.new(<<-END, bufvar: '@_buf', trim: false).src)
69
+ before
70
+ <%= form do %>
71
+ inside
72
+ <% end %>
73
+ after
74
+ END
75
+
76
+ # Output:
77
+ # before
78
+ # <form>
79
+ # inside
80
+ # </form>
81
+ # after
82
+
83
+ To use the capture_block support with tilt:
84
+
85
+ require 'tilt'
86
+ require 'erubi/capture_block'
87
+ Tilt.new("filename.erb", :engine_class=>Erubi::CaptureBlockEngine).render
88
+
89
+ Note that the capture_block support, while very compatible with the default
90
+ support, is not 100% compatible. One area where behavior differs is when
91
+ using multiple statements inside <tt><%=</tt> and <tt><%==</tt> tags:
92
+
93
+ <%= 1; 2 %>
94
+
95
+ The default support will output 2, but the capture_block support will output
96
+ 1.
97
+
98
+ === Erubi::CaptureEndEngine
99
+
100
+ An alternative capture implementation can be required via +erubi/capture_end+,
101
+ which supports it via <tt><%|=</tt> and <tt><%|==</tt> tags which are
102
+ closed with a <tt><%|</tt> tag:
103
+
104
+ <%|= form do %>
105
+ <input>
106
+ <%| end %>
107
+
108
+ It is only recommended to use +erubi/capture_end+ for backwards
109
+ compatibilty.
110
+
111
+ When using the capture_end support, capture methods (such as +form+ in the example
112
+ above) should return the (potentially modified) buffer. Similar to the
113
+ capture_block support, using an instance variable is recommended. Example:
114
+
115
+ def form
116
+ @_buf << "<form>"
117
+ yield
118
+ @_buf << "</form>"
119
+ @_buf
120
+ end
121
+
122
+ puts eval(Erubi::CaptureEndEngine.new(<<-END, bufvar: '@_buf').src)
123
+ before
124
+ <%|= form do %>
125
+ inside
126
+ <%| end %>
127
+ after
128
+ END
129
+
130
+ # Output:
131
+ # before
132
+ # <form>
133
+ # inside
134
+ # </form>
135
+ # after
136
+
137
+ Alternatively, passing the option <tt>:yield_returns_buffer => true</tt> will return the
138
+ buffer captured by the block instead of the last expression in the block.
139
+
140
+ = Reporting Bugs
141
+
142
+ The bug tracker is located at https://github.com/jeremyevans/erubi/issues
143
+
144
+ = License
145
+
146
+ MIT
147
+
148
+ = Authors
149
+
150
+ Jeremy Evans <code@jeremyevans.net>
151
+ kuwata-lab.com
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2008 The Ruby I18n team
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.