mini-max-kit 0.0.1

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 (69) hide show
  1. checksums.yaml +7 -0
  2. data/haml-7.2.0/CHANGELOG.md +1705 -0
  3. data/haml-7.2.0/FAQ.md +147 -0
  4. data/haml-7.2.0/Gemfile +25 -0
  5. data/haml-7.2.0/MIT-LICENSE +20 -0
  6. data/haml-7.2.0/README.md +205 -0
  7. data/haml-7.2.0/REFERENCE.md +1309 -0
  8. data/haml-7.2.0/Rakefile +48 -0
  9. data/haml-7.2.0/bin/bench +66 -0
  10. data/haml-7.2.0/bin/console +10 -0
  11. data/haml-7.2.0/bin/ruby +3 -0
  12. data/haml-7.2.0/bin/setup +7 -0
  13. data/haml-7.2.0/bin/stackprof +27 -0
  14. data/haml-7.2.0/bin/test +24 -0
  15. data/haml-7.2.0/exe/haml +6 -0
  16. data/haml-7.2.0/haml.gemspec +45 -0
  17. data/haml-7.2.0/lib/haml/ambles.rb +20 -0
  18. data/haml-7.2.0/lib/haml/attribute_builder.rb +162 -0
  19. data/haml-7.2.0/lib/haml/attribute_compiler.rb +133 -0
  20. data/haml-7.2.0/lib/haml/attribute_parser.rb +116 -0
  21. data/haml-7.2.0/lib/haml/cli.rb +154 -0
  22. data/haml-7.2.0/lib/haml/compiler/children_compiler.rb +155 -0
  23. data/haml-7.2.0/lib/haml/compiler/comment_compiler.rb +51 -0
  24. data/haml-7.2.0/lib/haml/compiler/doctype_compiler.rb +52 -0
  25. data/haml-7.2.0/lib/haml/compiler/script_compiler.rb +114 -0
  26. data/haml-7.2.0/lib/haml/compiler/silent_script_compiler.rb +24 -0
  27. data/haml-7.2.0/lib/haml/compiler/tag_compiler.rb +76 -0
  28. data/haml-7.2.0/lib/haml/compiler.rb +97 -0
  29. data/haml-7.2.0/lib/haml/dynamic_merger.rb +67 -0
  30. data/haml-7.2.0/lib/haml/engine.rb +59 -0
  31. data/haml-7.2.0/lib/haml/error.rb +66 -0
  32. data/haml-7.2.0/lib/haml/escape.rb +13 -0
  33. data/haml-7.2.0/lib/haml/escape_any.rb +21 -0
  34. data/haml-7.2.0/lib/haml/filters/base.rb +12 -0
  35. data/haml-7.2.0/lib/haml/filters/cdata.rb +20 -0
  36. data/haml-7.2.0/lib/haml/filters/coffee.rb +17 -0
  37. data/haml-7.2.0/lib/haml/filters/css.rb +33 -0
  38. data/haml-7.2.0/lib/haml/filters/erb.rb +10 -0
  39. data/haml-7.2.0/lib/haml/filters/escaped.rb +22 -0
  40. data/haml-7.2.0/lib/haml/filters/javascript.rb +33 -0
  41. data/haml-7.2.0/lib/haml/filters/less.rb +20 -0
  42. data/haml-7.2.0/lib/haml/filters/markdown.rb +11 -0
  43. data/haml-7.2.0/lib/haml/filters/plain.rb +29 -0
  44. data/haml-7.2.0/lib/haml/filters/preserve.rb +22 -0
  45. data/haml-7.2.0/lib/haml/filters/ruby.rb +10 -0
  46. data/haml-7.2.0/lib/haml/filters/sass.rb +15 -0
  47. data/haml-7.2.0/lib/haml/filters/scss.rb +15 -0
  48. data/haml-7.2.0/lib/haml/filters/text_base.rb +25 -0
  49. data/haml-7.2.0/lib/haml/filters/tilt_base.rb +59 -0
  50. data/haml-7.2.0/lib/haml/filters.rb +75 -0
  51. data/haml-7.2.0/lib/haml/force_escape.rb +29 -0
  52. data/haml-7.2.0/lib/haml/helpers.rb +15 -0
  53. data/haml-7.2.0/lib/haml/html.rb +22 -0
  54. data/haml-7.2.0/lib/haml/identity.rb +13 -0
  55. data/haml-7.2.0/lib/haml/object_ref.rb +35 -0
  56. data/haml-7.2.0/lib/haml/parser.rb +991 -0
  57. data/haml-7.2.0/lib/haml/rails_helpers.rb +53 -0
  58. data/haml-7.2.0/lib/haml/rails_template.rb +62 -0
  59. data/haml-7.2.0/lib/haml/railtie.rb +10 -0
  60. data/haml-7.2.0/lib/haml/ruby_expression.rb +32 -0
  61. data/haml-7.2.0/lib/haml/string_splitter.rb +140 -0
  62. data/haml-7.2.0/lib/haml/template.rb +20 -0
  63. data/haml-7.2.0/lib/haml/temple_line_counter.rb +31 -0
  64. data/haml-7.2.0/lib/haml/util.rb +262 -0
  65. data/haml-7.2.0/lib/haml/version.rb +4 -0
  66. data/haml-7.2.0/lib/haml/whitespace.rb +8 -0
  67. data/haml-7.2.0/lib/haml.rb +9 -0
  68. data/mini-max-kit.gemspec +12 -0
  69. metadata +108 -0
data/haml-7.2.0/FAQ.md ADDED
@@ -0,0 +1,147 @@
1
+ # Frequently Asked Questions
2
+
3
+ ## Haml
4
+
5
+ ### How do I put a punctuation mark after an element, like "`I like <strong>cake</strong>!`"? {#q-punctuation}
6
+
7
+ Expressing the structure of a document
8
+ and expressing inline formatting are two very different problems.
9
+ Haml is mostly designed for structure,
10
+ so the best way to deal with formatting is to leave it to other languages
11
+ that are designed for it.
12
+ You could use Textile:
13
+
14
+ %p
15
+ :textile
16
+ I like *cake*!
17
+
18
+ or Markdown:
19
+
20
+ %p
21
+ :markdown
22
+ I like **cake**!
23
+
24
+ or plain old XHTML:
25
+
26
+ %p I like <strong>cake</strong>!
27
+
28
+ If you're inserting something that's generated by a helper, like a link,
29
+ then it's even easier:
30
+
31
+ %p== I like #{link_to 'chocolate', 'http://franschocolates.com'}!
32
+
33
+ ### How do I stop Haml from indenting the contents of my `pre` and `textarea` tags? {#q-preserve}
34
+
35
+ Because Haml automatically indents the HTML source code,
36
+ the contents of whitespace-sensitive tags like `pre` and `textarea`
37
+ can get screwed up.
38
+ The solution is to replace the newlines inside these tags
39
+ with HTML newline entities (`&#x000A;`),
40
+ which Haml does using the {Haml::Helpers#preserve} and {Haml::Helpers#find_and_preserve} helpers.
41
+
42
+ Normally, Haml will do this for you automatically
43
+ when you're using a tag that needs it
44
+ (this can be customized using the {Haml::Options#preserve `:preserve`} option).
45
+ For example,
46
+
47
+ %p
48
+ %textarea= "Foo\nBar"
49
+
50
+ will be compiled to
51
+
52
+ <p>
53
+ <textarea>
54
+ Foo&#x000A;Bar</textarea>
55
+ </p>
56
+
57
+ However, if a helper is generating the tag,
58
+ Haml can't detect that and so you'll have to call {Haml::Helpers#find_and_preserve} yourself.
59
+ You can also use `~`, which is the same as `=`
60
+ except that it automatically runs `find_and_preserve` on its input.
61
+ For example:
62
+
63
+ %p= find_and_preserve "<textarea>Foo\nBar</textarea>"
64
+
65
+ is the same as
66
+
67
+ %p~ "<textarea>Foo\nBar</textarea>"
68
+
69
+ and renders
70
+
71
+ <p><textarea>Foo&#x000A;Bar</textarea></p>
72
+
73
+ ### How do I make my long lines of Ruby code look nicer in my Haml document? {#q-multiline}
74
+
75
+ Put them in a helper or your model.
76
+
77
+ Haml purposefully makes it annoying to put lots of Ruby code into your templates,
78
+ because lots of code doesn't belong in the view.
79
+ If you take that huge `link_to_remote` call
80
+ and move it to a `update_sidebar_link` helper,
81
+ it'll make your view both easier to read and more semantic.
82
+
83
+ If you absolutely must put lots of code in your template,
84
+ Haml offers a somewhat awkward multiline-continuation tool.
85
+ Put a `|` (pipe character) at the end of each line you want to be merged into one
86
+ (including the last line!).
87
+ For example:
88
+
89
+ %p= @this.is(way.too.much). |
90
+ code("and I should"). |
91
+ really_move.it.into( |
92
+ :a => @helper) |
93
+
94
+ Note that sometimes it is valid to include lots of Ruby in a template
95
+ when that Ruby is a helper call that passes in a lot of template information.
96
+ Thus when a function has lots of arguments,
97
+ it's possible to wrap it across multiple lines
98
+ as long as each line ends in a comma.
99
+ For example:
100
+
101
+ = link_to_remote "Add to cart",
102
+ :url => { :action => "add", :id => product.id },
103
+ :update => { :success => "cart", :failure => "error" }
104
+
105
+ ### `form_for` is printing the form tag twice!
106
+
107
+ Make sure you're calling it with `-`, not `=`.
108
+ Just like in ERB, you have to do
109
+
110
+ <% form_for stuff do %>
111
+ ...
112
+ <% end %>
113
+
114
+ in Haml, you have to do
115
+
116
+ - form_for stuff do
117
+ ...
118
+
119
+ ### I have Haml installed. Why is Rails (only looking for `.html.erb` files | rendering Haml files as plain text | rendering Haml files as blank pages)? {#q-blank-page}
120
+
121
+ There are several reasons these things might be happening.
122
+ First of all, make sure that Haml really is installed;
123
+ either you've loaded the gem (via `config.gem` in Rails 2.3 or in the Gemfile in Rails 3),
124
+ or `vendor/plugins/haml` exists and contains files.
125
+ Then try restarting Mongrel or WEBrick or whatever you might be using.
126
+
127
+ Finally, if none of these work,
128
+ chances are you've got some localization plugin like Globalize installed.
129
+ Such plugins often don't play nicely with Haml.
130
+ Luckily, there's usually an easy fix.
131
+ For Globalize, just edit `globalize/lib/globalize/rails/action_view.rb`
132
+ and change
133
+
134
+ @@re_extension = /\.(rjs|rhtml|rxml)$/
135
+
136
+ to
137
+
138
+ @@re_extension = /\.(rjs|rhtml|rxml|erb|builder|haml)$/
139
+
140
+ For other plugins, a little searching will probably turn up a way to fix them as well.
141
+
142
+ ## You still haven't answered my question!
143
+
144
+ Sorry! Try looking at the [Haml](https://haml.info/docs/yardoc/file.REFERENCE.html) reference,
145
+ If you can't find an answer there,
146
+ feel free to ask in `#haml` on irc.freenode.net
147
+ or send an email to the [mailing list](http://groups.google.com/group/haml).
@@ -0,0 +1,25 @@
1
+ source 'https://rubygems.org'
2
+
3
+ git_source(:github) do |repo_name|
4
+ repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
5
+ "https://github.com/#{repo_name}.git"
6
+ end
7
+
8
+ # Specify your gem's dependencies in haml.gemspec
9
+ gemspec
10
+
11
+ gem 'benchmark-ips', '2.3.0'
12
+ gem 'maxitest'
13
+ gem 'base64'
14
+ gem 'bigdecimal'
15
+ gem 'mutex_m'
16
+
17
+ if /java/.match?(RUBY_PLATFORM) # JRuby
18
+ gem 'pandoc-ruby'
19
+ else
20
+ gem 'redcarpet'
21
+
22
+ if RUBY_PLATFORM !~ /mswin|mingw/ && RUBY_ENGINE != 'truffleruby'
23
+ gem 'stackprof'
24
+ end
25
+ end
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2006-2021 Hampton Catlin, Natalie Weizenbaum and Takashi Kokubun
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,205 @@
1
+ # Haml
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/haml.svg)](https://rubygems.org/gems/haml)
4
+ [![test](https://github.com/haml/haml/actions/workflows/test.yml/badge.svg)](https://github.com/haml/haml/actions/workflows/test.yml)
5
+ [![Code Climate](https://codeclimate.com/github/haml/haml/badges/gpa.svg)](https://codeclimate.com/github/haml/haml)
6
+ [![Inline docs](https://inch-ci.org/github/haml/haml.svg)](https://inch-ci.org/github/haml/haml)
7
+ [![Discord Server](https://dcbadge.limes.pink/api/server/https://discord.gg/G8dEAwvV2Y)](https://discord.gg/G8dEAwvV2Y)
8
+
9
+ Haml is a templating engine for HTML. It's designed to make it both easier and
10
+ more pleasant to write HTML documents, by eliminating redundancy, reflecting the
11
+ underlying structure that the document represents, and providing an elegant syntax
12
+ that's both powerful and easy to understand.
13
+
14
+ ## Basic Usage
15
+
16
+ Haml can be used from the command line or as part of a Ruby web framework. The
17
+ first step is to install the gem:
18
+
19
+ ~~~sh
20
+ gem install haml
21
+ ~~~
22
+
23
+ After you write some Haml, you can run
24
+
25
+ ~~~sh
26
+ haml render document.haml
27
+ ~~~
28
+
29
+ to compile it to HTML. For more information on these commands, check out
30
+
31
+ ~~~sh
32
+ haml --help
33
+ ~~~
34
+
35
+ To use Haml programmatically, check out the [YARD documentation](https://haml.info/docs/yardoc/).
36
+
37
+ ## Using Haml with Rails
38
+
39
+ To use Haml with Rails, simply add Haml to your Gemfile and run `bundle`.
40
+
41
+ ~~~ruby
42
+ gem 'haml'
43
+ ~~~
44
+
45
+ If you'd like to replace Rails's ERB-based generators with Haml, add
46
+ [haml-rails](https://github.com/haml/haml-rails) to your Gemfile as well.
47
+
48
+ ## Formatting
49
+
50
+ The most basic element of Haml is a shorthand for creating HTML:
51
+
52
+ ~~~haml
53
+ %tagname{:attr1 => 'value1', :attr2 => 'value2'} Contents
54
+ ~~~
55
+
56
+ No end-tag is needed; Haml handles that automatically. If you prefer HTML-style
57
+ attributes, you can also use:
58
+
59
+ ~~~haml
60
+ %tagname(attr1='value1' attr2='value2') Contents
61
+ ~~~
62
+
63
+ Adding `class` and `id` attributes is even easier. Haml uses the same syntax as
64
+ the CSS that styles the document:
65
+
66
+ ~~~haml
67
+ %tagname#id.class
68
+ ~~~
69
+
70
+ In fact, when you're using the `<div>` tag, it becomes _even easier_. Because
71
+ `<div>` is such a common element, a tag without a name defaults to a div. So
72
+
73
+ ~~~haml
74
+ #foo Hello!
75
+ ~~~
76
+
77
+ becomes
78
+
79
+ ~~~html
80
+ <div id='foo'>Hello!</div>
81
+ ~~~
82
+
83
+ Haml uses indentation to bring the individual elements to represent the HTML
84
+ structure. A tag's children are indented beneath than the parent tag. Again, a
85
+ closing tag is automatically added. For example:
86
+
87
+ ~~~haml
88
+ %ul
89
+ %li Salt
90
+ %li Pepper
91
+ ~~~
92
+
93
+ becomes:
94
+
95
+ ~~~html
96
+ <ul>
97
+ <li>Salt</li>
98
+ <li>Pepper</li>
99
+ </ul>
100
+ ~~~
101
+
102
+ You can also put plain text as a child of an element:
103
+
104
+ ~~~haml
105
+ %p
106
+ Hello,
107
+ World!
108
+ ~~~
109
+
110
+ It's also possible to embed Ruby code into Haml documents. An equals sign, `=`,
111
+ will output the result of the code. A hyphen, `-`, will run the code but not
112
+ output the result. You can even use control statements like `if` and `while`:
113
+
114
+ ~~~haml
115
+ %p
116
+ Date/Time:
117
+ - now = DateTime.now
118
+ %strong= now
119
+ - if now > DateTime.parse("December 31, 2006")
120
+ = "Happy new " + "year!"
121
+ ~~~
122
+
123
+ Haml provides far more tools than those presented here. Check out the [reference
124
+ documentation](https://haml.info/docs/yardoc/file.REFERENCE.html)
125
+ for full details.
126
+
127
+ ### Indentation
128
+
129
+ Haml's indentation can be made up of one or more tabs or spaces. However,
130
+ indentation must be consistent within a given document. Hard tabs and spaces
131
+ can't be mixed, and the same number of tabs or spaces must be used throughout.
132
+
133
+ ## Contributing
134
+
135
+ Contributions are welcomed, but before you get started please read the
136
+ [guidelines](https://haml.info/development.html#contributing).
137
+
138
+ After forking and then cloning the repo locally, install Bundler and then use it
139
+ to install the development gem dependencies:
140
+ ~~~sh
141
+ gem install bundler
142
+ bundle install
143
+ ~~~
144
+
145
+ Once this is complete, you should be able to run the test suite:
146
+ ~~~sh
147
+ rake
148
+ ~~~
149
+
150
+ At this point `rake` should run without error or warning and you are ready to
151
+ start working on your patch!
152
+
153
+ Note that you can also run just one test out of the test suite if you're working
154
+ on a specific area:
155
+
156
+ ~~~sh
157
+ ruby -Itest test/helper_test.rb -n test_buffer_access
158
+ ~~~
159
+
160
+ Haml currently supports Ruby 3.2.0 and higher, so please make sure your changes run on 3.2+.
161
+
162
+ ## Team
163
+
164
+ ### Current Maintainers
165
+
166
+ * [Akira Matsuda](https://github.com/amatsuda)
167
+ * [Matt Wildig](https://github.com/mattwildig)
168
+ * [Tee Parham](https://github.com/teeparham)
169
+ * [Takashi Kokubun](https://github.com/k0kubun)
170
+
171
+ ### Alumni
172
+
173
+ Haml was created by [Hampton Catlin](http://hamptoncatlin.com), the author of
174
+ the original implementation. Hampton is no longer involved in day-to-day coding,
175
+ but still consults on language issues.
176
+
177
+ [Natalie Weizenbaum](http://nex-3.com) was for many years the primary developer
178
+ and architect of the "modern" Ruby implementation of Haml.
179
+
180
+ [Norman Clarke](https://github.com/norman) was the primary maintainer of Haml from 2012 to 2016.
181
+
182
+ ## License
183
+
184
+ Some of Natalie's work on Haml was supported by Unspace Interactive.
185
+
186
+ Beyond that, the implementation is licensed under the MIT License.
187
+
188
+ Copyright (c) 2006-2019 Hampton Catlin, Natalie Weizenbaum and the Haml team
189
+
190
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
191
+ this software and associated documentation files (the "Software"), to deal in
192
+ the Software without restriction, including without limitation the rights to
193
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
194
+ the Software, and to permit persons to whom the Software is furnished to do so,
195
+ subject to the following conditions:
196
+
197
+ The above copyright notice and this permission notice shall be included in all
198
+ copies or substantial portions of the Software.
199
+
200
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
201
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
202
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
203
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
204
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
205
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.