nirvdrum-less 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. data/.gitignore +4 -0
  2. data/LICENSE +179 -0
  3. data/README.md +39 -0
  4. data/Rakefile +90 -0
  5. data/VERSION +1 -0
  6. data/bin/lessc +86 -0
  7. data/less.gemspec +205 -0
  8. data/lib/ext.rb +62 -0
  9. data/lib/less.rb +33 -0
  10. data/lib/less/command.rb +106 -0
  11. data/lib/less/engine.rb +54 -0
  12. data/lib/less/engine/builder.rb +8 -0
  13. data/lib/less/engine/grammar/common.tt +29 -0
  14. data/lib/less/engine/grammar/entity.tt +139 -0
  15. data/lib/less/engine/grammar/less.tt +271 -0
  16. data/lib/less/engine/nodes.rb +9 -0
  17. data/lib/less/engine/nodes/element.rb +186 -0
  18. data/lib/less/engine/nodes/entity.rb +79 -0
  19. data/lib/less/engine/nodes/function.rb +79 -0
  20. data/lib/less/engine/nodes/literal.rb +167 -0
  21. data/lib/less/engine/nodes/property.rb +156 -0
  22. data/lib/less/engine/nodes/ruleset.rb +12 -0
  23. data/lib/less/engine/nodes/selector.rb +39 -0
  24. data/lib/vendor/treetop/.gitignore +7 -0
  25. data/lib/vendor/treetop/LICENSE +19 -0
  26. data/lib/vendor/treetop/README +164 -0
  27. data/lib/vendor/treetop/Rakefile +19 -0
  28. data/lib/vendor/treetop/benchmark/seqpar.gnuplot +15 -0
  29. data/lib/vendor/treetop/benchmark/seqpar.treetop +16 -0
  30. data/lib/vendor/treetop/benchmark/seqpar_benchmark.rb +107 -0
  31. data/lib/vendor/treetop/bin/tt +28 -0
  32. data/lib/vendor/treetop/lib/treetop.rb +8 -0
  33. data/lib/vendor/treetop/lib/treetop/bootstrap_gen_1_metagrammar.rb +45 -0
  34. data/lib/vendor/treetop/lib/treetop/compiler.rb +6 -0
  35. data/lib/vendor/treetop/lib/treetop/compiler/grammar_compiler.rb +42 -0
  36. data/lib/vendor/treetop/lib/treetop/compiler/lexical_address_space.rb +17 -0
  37. data/lib/vendor/treetop/lib/treetop/compiler/metagrammar.rb +3097 -0
  38. data/lib/vendor/treetop/lib/treetop/compiler/metagrammar.treetop +408 -0
  39. data/lib/vendor/treetop/lib/treetop/compiler/node_classes.rb +19 -0
  40. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/anything_symbol.rb +18 -0
  41. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/atomic_expression.rb +14 -0
  42. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb +24 -0
  43. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/choice.rb +31 -0
  44. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/declaration_sequence.rb +24 -0
  45. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/grammar.rb +28 -0
  46. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb +27 -0
  47. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/nonterminal.rb +13 -0
  48. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/optional.rb +19 -0
  49. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/parenthesized_expression.rb +9 -0
  50. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/parsing_expression.rb +138 -0
  51. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/parsing_rule.rb +55 -0
  52. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/predicate.rb +45 -0
  53. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/repetition.rb +55 -0
  54. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/sequence.rb +68 -0
  55. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/terminal.rb +20 -0
  56. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/transient_prefix.rb +9 -0
  57. data/lib/vendor/treetop/lib/treetop/compiler/node_classes/treetop_file.rb +9 -0
  58. data/lib/vendor/treetop/lib/treetop/compiler/ruby_builder.rb +113 -0
  59. data/lib/vendor/treetop/lib/treetop/ruby_extensions.rb +2 -0
  60. data/lib/vendor/treetop/lib/treetop/ruby_extensions/string.rb +42 -0
  61. data/lib/vendor/treetop/lib/treetop/runtime.rb +5 -0
  62. data/lib/vendor/treetop/lib/treetop/runtime/compiled_parser.rb +105 -0
  63. data/lib/vendor/treetop/lib/treetop/runtime/interval_skip_list.rb +4 -0
  64. data/lib/vendor/treetop/lib/treetop/runtime/interval_skip_list/head_node.rb +15 -0
  65. data/lib/vendor/treetop/lib/treetop/runtime/interval_skip_list/interval_skip_list.rb +200 -0
  66. data/lib/vendor/treetop/lib/treetop/runtime/interval_skip_list/node.rb +164 -0
  67. data/lib/vendor/treetop/lib/treetop/runtime/syntax_node.rb +72 -0
  68. data/lib/vendor/treetop/lib/treetop/runtime/terminal_parse_failure.rb +16 -0
  69. data/lib/vendor/treetop/lib/treetop/runtime/terminal_syntax_node.rb +17 -0
  70. data/lib/vendor/treetop/lib/treetop/version.rb +9 -0
  71. data/lib/vendor/treetop/spec/compiler/and_predicate_spec.rb +36 -0
  72. data/lib/vendor/treetop/spec/compiler/anything_symbol_spec.rb +44 -0
  73. data/lib/vendor/treetop/spec/compiler/character_class_spec.rb +182 -0
  74. data/lib/vendor/treetop/spec/compiler/choice_spec.rb +80 -0
  75. data/lib/vendor/treetop/spec/compiler/circular_compilation_spec.rb +28 -0
  76. data/lib/vendor/treetop/spec/compiler/failure_propagation_functional_spec.rb +21 -0
  77. data/lib/vendor/treetop/spec/compiler/grammar_compiler_spec.rb +84 -0
  78. data/lib/vendor/treetop/spec/compiler/grammar_spec.rb +41 -0
  79. data/lib/vendor/treetop/spec/compiler/nonterminal_symbol_spec.rb +40 -0
  80. data/lib/vendor/treetop/spec/compiler/not_predicate_spec.rb +38 -0
  81. data/lib/vendor/treetop/spec/compiler/one_or_more_spec.rb +35 -0
  82. data/lib/vendor/treetop/spec/compiler/optional_spec.rb +37 -0
  83. data/lib/vendor/treetop/spec/compiler/parenthesized_expression_spec.rb +19 -0
  84. data/lib/vendor/treetop/spec/compiler/parsing_rule_spec.rb +32 -0
  85. data/lib/vendor/treetop/spec/compiler/sequence_spec.rb +115 -0
  86. data/lib/vendor/treetop/spec/compiler/terminal_spec.rb +81 -0
  87. data/lib/vendor/treetop/spec/compiler/terminal_symbol_spec.rb +37 -0
  88. data/lib/vendor/treetop/spec/compiler/test_grammar.treetop +7 -0
  89. data/lib/vendor/treetop/spec/compiler/test_grammar.tt +7 -0
  90. data/lib/vendor/treetop/spec/compiler/test_grammar_do.treetop +7 -0
  91. data/lib/vendor/treetop/spec/compiler/zero_or_more_spec.rb +56 -0
  92. data/lib/vendor/treetop/spec/composition/a.treetop +11 -0
  93. data/lib/vendor/treetop/spec/composition/b.treetop +11 -0
  94. data/lib/vendor/treetop/spec/composition/c.treetop +10 -0
  95. data/lib/vendor/treetop/spec/composition/d.treetop +10 -0
  96. data/lib/vendor/treetop/spec/composition/f.treetop +17 -0
  97. data/lib/vendor/treetop/spec/composition/grammar_composition_spec.rb +40 -0
  98. data/lib/vendor/treetop/spec/composition/subfolder/e_includes_c.treetop +15 -0
  99. data/lib/vendor/treetop/spec/ruby_extensions/string_spec.rb +32 -0
  100. data/lib/vendor/treetop/spec/runtime/compiled_parser_spec.rb +101 -0
  101. data/lib/vendor/treetop/spec/runtime/interval_skip_list/delete_spec.rb +147 -0
  102. data/lib/vendor/treetop/spec/runtime/interval_skip_list/expire_range_spec.rb +349 -0
  103. data/lib/vendor/treetop/spec/runtime/interval_skip_list/insert_and_delete_node.rb +385 -0
  104. data/lib/vendor/treetop/spec/runtime/interval_skip_list/insert_spec.rb +660 -0
  105. data/lib/vendor/treetop/spec/runtime/interval_skip_list/interval_skip_list_spec.graffle +6175 -0
  106. data/lib/vendor/treetop/spec/runtime/interval_skip_list/interval_skip_list_spec.rb +58 -0
  107. data/lib/vendor/treetop/spec/runtime/interval_skip_list/palindromic_fixture.rb +23 -0
  108. data/lib/vendor/treetop/spec/runtime/interval_skip_list/palindromic_fixture_spec.rb +164 -0
  109. data/lib/vendor/treetop/spec/runtime/interval_skip_list/spec_helper.rb +84 -0
  110. data/lib/vendor/treetop/spec/runtime/syntax_node_spec.rb +53 -0
  111. data/lib/vendor/treetop/spec/spec_helper.rb +106 -0
  112. data/lib/vendor/treetop/spec/spec_suite.rb +4 -0
  113. data/lib/vendor/treetop/treetop.gemspec +17 -0
  114. data/spec/command_spec.rb +102 -0
  115. data/spec/css/accessors.css +18 -0
  116. data/spec/css/big.css +3768 -0
  117. data/spec/css/colors.css +11 -0
  118. data/spec/css/comments.css +9 -0
  119. data/spec/css/css-3.css +2 -0
  120. data/spec/css/css.css +45 -0
  121. data/spec/css/functions.css +6 -0
  122. data/spec/css/import.css +12 -0
  123. data/spec/css/lazy-eval.css +1 -0
  124. data/spec/css/mixins-args.css +0 -0
  125. data/spec/css/mixins.css +28 -0
  126. data/spec/css/operations.css +28 -0
  127. data/spec/css/parens.css +16 -0
  128. data/spec/css/rulesets.css +17 -0
  129. data/spec/css/scope.css +11 -0
  130. data/spec/css/selectors.css +8 -0
  131. data/spec/css/strings.css +12 -0
  132. data/spec/css/variables.css +6 -0
  133. data/spec/css/whitespace.css +11 -0
  134. data/spec/engine_spec.rb +111 -0
  135. data/spec/less/accessors.less +20 -0
  136. data/spec/less/big.less +4810 -0
  137. data/spec/less/colors.less +34 -0
  138. data/spec/less/comments.less +46 -0
  139. data/spec/less/css-3.less +11 -0
  140. data/spec/less/css.less +98 -0
  141. data/spec/less/exceptions/mixed-units-error.less +3 -0
  142. data/spec/less/exceptions/name-error-1.0.less +3 -0
  143. data/spec/less/exceptions/syntax-error-1.0.less +3 -0
  144. data/spec/less/functions.less +6 -0
  145. data/spec/less/import.less +7 -0
  146. data/spec/less/import/import-test-a.less +2 -0
  147. data/spec/less/import/import-test-b.less +8 -0
  148. data/spec/less/import/import-test-c.less +6 -0
  149. data/spec/less/import/import-test-d.css +1 -0
  150. data/spec/less/lazy-eval.less +6 -0
  151. data/spec/less/mixins-args.less +0 -0
  152. data/spec/less/mixins.less +43 -0
  153. data/spec/less/operations.less +39 -0
  154. data/spec/less/parens.less +21 -0
  155. data/spec/less/rulesets.less +30 -0
  156. data/spec/less/scope.less +32 -0
  157. data/spec/less/selectors.less +15 -0
  158. data/spec/less/strings.less +14 -0
  159. data/spec/less/variables.less +18 -0
  160. data/spec/less/whitespace.less +30 -0
  161. data/spec/spec.css +82 -0
  162. data/spec/spec.less +148 -0
  163. data/spec/spec_helper.rb +8 -0
  164. metadata +219 -0
@@ -0,0 +1,4 @@
1
+ /*.css
2
+ *.tmproj
3
+ *.gem
4
+ pkg/
data/LICENSE ADDED
@@ -0,0 +1,179 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ Copyright (c) 2009 Alexis Sellier
@@ -0,0 +1,39 @@
1
+ LESS
2
+ ====
3
+ It's time CSS was done right – LESS is _leaner_ css.
4
+
5
+ Explained
6
+ ---------
7
+ LESS allows you to write CSS the way (I think) it was meant to, that is: with *variables*, *nested rules* and *mixins*!
8
+
9
+ ### Here's some example LESS code:
10
+
11
+ @dark: #110011;
12
+ .outline { border: 1px solid black }
13
+
14
+ .article {
15
+ a { text-decoration: none }
16
+ p { color: @dark }
17
+ .outline;
18
+ }
19
+
20
+ ### And the CSS output it produces:
21
+
22
+ .outline { border: 1px solid black }
23
+ .article a { text-decoration: none }
24
+ .article p { color: #110011 }
25
+ .article { border: 1px solid black }
26
+
27
+ If you have CSS nightmares, just
28
+ $ lessc style.less
29
+
30
+ For more information, see you at [http://lesscss.org]
31
+
32
+ People without whom this wouldn't have happened a.k.a *Credits*
33
+ ---------------------------------------------------------------
34
+
35
+ - **Dmitry Fadeyev**, for pushing me to do this, and designing our awesome website
36
+ - **August Lilleaas**, for initiating the work on the treetop grammar, as well as writing the rails plugin
37
+ - **Nathan Sobo**, for creating treetop
38
+ - **Jason Garber**, for his magical performance optimizations on treetop
39
+ - And finally, the people of #ruby-lang for answering all my ruby questions. **apeiros**, **manveru** and **rue** come to mind
@@ -0,0 +1,90 @@
1
+ begin
2
+ require 'jeweler'
3
+ Jeweler::Tasks.new do |s|
4
+ s.name = "less"
5
+ s.authors = ["cloudhead"]
6
+ s.email = "self@cloudhead.net"
7
+ s.summary = "LESS compiler"
8
+ s.homepage = "http://www.lesscss.org"
9
+ s.description = "LESS is leaner CSS"
10
+ s.rubyforge_project = 'less'
11
+ end
12
+ rescue LoadError
13
+ puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
14
+ end
15
+
16
+ # rubyforge
17
+ begin
18
+ require 'rake/contrib/sshpublisher'
19
+ namespace :rubyforge do
20
+ desc "Release gem and RDoc documentation to RubyForge"
21
+ task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
22
+
23
+ namespace :release do
24
+ desc "Publish RDoc to RubyForge."
25
+ task :docs => [:rdoc] do
26
+ config = YAML.load(
27
+ File.read(File.expand_path('~/.rubyforge/user-config.yml'))
28
+ )
29
+ options << '--line-numbers' << '--inline-source'
30
+ host = "#{config['username']}@rubyforge.org"
31
+ remote_dir = "/var/www/gforge-projects/the-perfect-gem/"
32
+ local_dir = 'rdoc'
33
+
34
+ Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
35
+ end
36
+ end
37
+ end
38
+ rescue LoadError
39
+ puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
40
+ end
41
+
42
+ begin
43
+ require 'spec/rake/spectask'
44
+
45
+ Spec::Rake::SpecTask.new("spec") do |t|
46
+ t.spec_files = FileList['spec/**/*_spec.rb']
47
+ t.spec_opts = ['--color', '--format=specdoc']
48
+ end
49
+
50
+ task :test do
51
+ Rake::Task['spec'].invoke
52
+ end
53
+
54
+ Spec::Rake::SpecTask.new("rcov_spec") do |t|
55
+ t.spec_files = FileList['spec/**/*_spec.rb']
56
+ t.spec_opts = ['--color']
57
+ t.rcov = true
58
+ t.rcov_opts = ['--exclude', '^spec,/gems/']
59
+ end
60
+ end
61
+
62
+ begin
63
+ require 'lib/less'
64
+ require 'benchmark'
65
+
66
+ task :compile do
67
+ abort "compiling isn't necessary anymore."
68
+ puts "compiling #{LESS_GRAMMAR.split('/').last}..."
69
+ File.open(LESS_PARSER, 'w') {|f| f.write Treetop::Compiler::GrammarCompiler.new.ruby_source(LESS_GRAMMAR) }
70
+ end
71
+
72
+ task :benchmark do
73
+ #require 'profile'
74
+ puts "benchmarking... "
75
+ less, tree = File.read("spec/less/big.less"), nil
76
+
77
+ parse = Benchmark.measure do
78
+ tree = Less::Engine.new(less).parse(false)
79
+ end.total.round(2)
80
+
81
+ build = Benchmark.measure do
82
+ tree.build(Less::Node::Element.new)
83
+ end.total.round(2)
84
+
85
+ puts "parse: #{parse}s\nbuild: #{build}s"
86
+ puts "------------"
87
+ puts "total: #{parse + build}s"
88
+ end
89
+ end
90
+
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 1.1.4
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $:.unshift File.dirname(__FILE__) + "/../lib"
4
+
5
+ require 'optparse'
6
+ require 'rubygems'
7
+ require 'less'
8
+
9
+ begin
10
+ require 'growl'
11
+ rescue LoadError
12
+ Less::GROWL = false
13
+ else
14
+ Less::GROWL = true
15
+ end
16
+
17
+ # Argument defaults
18
+ options = {
19
+ :watch => false,
20
+ :compress => false,
21
+ :debug => false,
22
+ :growl => false
23
+ }
24
+
25
+ # Get arguments
26
+ opts = OptionParser.new do |o|
27
+ o.banner = "usage: lessc source [destination] [--watch]"
28
+ o.separator ""
29
+
30
+ # Watch mode
31
+ o.on("-w", "--watch", "watch for changes") do
32
+ options[:watch] = true
33
+ end
34
+
35
+ # Growl
36
+ o.on("-g", "--growl", "growl notifications") do
37
+ if Less::GROWL && (Growl.installed? rescue false)
38
+ options[:growl] = true
39
+ elsif Less::GROWL
40
+ abort "Growl or 'growlnotify' wasn't found on your system."
41
+ else
42
+ abort "Growl gem not found, please install with: " +
43
+ "`sudo gem install visionmedia-growl -s http://gems.github.com`"
44
+ end
45
+ end
46
+
47
+ # Compression needs a proper algorithm
48
+ #
49
+ # o.on("-x", "--compress", "compress css file") do
50
+ # options[:compress] = true
51
+ # end
52
+
53
+ o.separator ""
54
+
55
+ # Help
56
+ o.on_tail("-h", "--help", "show this message") do
57
+ puts opts
58
+ exit
59
+ end
60
+
61
+ o.on_tail("-d", "--debug", "show full error messages") do
62
+ options[:debug] = true
63
+ end
64
+
65
+ # Version
66
+ o.on_tail("-v", "--version", "show version") do
67
+ puts "lessc " + Less.version
68
+ exit
69
+ end
70
+ end
71
+
72
+ opts.parse! # Parse arguments into `options` hash
73
+
74
+ # Get source and destintation from command line
75
+ case ARGV.size
76
+ when 1
77
+ options[:source] = ARGV[ 0 ]
78
+ when 2
79
+ options[:source] = ARGV[ 0 ]
80
+ options[:destination] = ARGV[ 1 ]
81
+ else
82
+ puts opts
83
+ exit
84
+ end
85
+
86
+ Less::Command.new( options ).run!
@@ -0,0 +1,205 @@
1
+ # -*- encoding: utf-8 -*-
2
+
3
+ Gem::Specification.new do |s|
4
+ s.name = %q{less}
5
+ s.version = "1.1.4"
6
+
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
+ s.authors = ["cloudhead"]
9
+ s.date = %q{2009-07-27}
10
+ s.default_executable = %q{lessc}
11
+ s.description = %q{LESS is leaner CSS}
12
+ s.email = %q{self@cloudhead.net}
13
+ s.executables = ["lessc"]
14
+ s.extra_rdoc_files = [
15
+ "LICENSE",
16
+ "README.md"
17
+ ]
18
+ s.files = [
19
+ ".gitignore",
20
+ "LICENSE",
21
+ "README.md",
22
+ "Rakefile",
23
+ "VERSION",
24
+ "bin/lessc",
25
+ "less.gemspec",
26
+ "lib/ext.rb",
27
+ "lib/less.rb",
28
+ "lib/less/command.rb",
29
+ "lib/less/engine.rb",
30
+ "lib/less/engine/builder.rb",
31
+ "lib/less/engine/grammar/common.tt",
32
+ "lib/less/engine/grammar/entity.tt",
33
+ "lib/less/engine/grammar/less.tt",
34
+ "lib/less/engine/nodes.rb",
35
+ "lib/less/engine/nodes/element.rb",
36
+ "lib/less/engine/nodes/entity.rb",
37
+ "lib/less/engine/nodes/function.rb",
38
+ "lib/less/engine/nodes/literal.rb",
39
+ "lib/less/engine/nodes/property.rb",
40
+ "lib/less/engine/nodes/ruleset.rb",
41
+ "lib/less/engine/nodes/selector.rb",
42
+ "lib/vendor/treetop/.gitignore",
43
+ "lib/vendor/treetop/LICENSE",
44
+ "lib/vendor/treetop/README",
45
+ "lib/vendor/treetop/Rakefile",
46
+ "lib/vendor/treetop/benchmark/seqpar.gnuplot",
47
+ "lib/vendor/treetop/benchmark/seqpar.treetop",
48
+ "lib/vendor/treetop/benchmark/seqpar_benchmark.rb",
49
+ "lib/vendor/treetop/bin/tt",
50
+ "lib/vendor/treetop/lib/treetop.rb",
51
+ "lib/vendor/treetop/lib/treetop/bootstrap_gen_1_metagrammar.rb",
52
+ "lib/vendor/treetop/lib/treetop/compiler.rb",
53
+ "lib/vendor/treetop/lib/treetop/compiler/grammar_compiler.rb",
54
+ "lib/vendor/treetop/lib/treetop/compiler/lexical_address_space.rb",
55
+ "lib/vendor/treetop/lib/treetop/compiler/metagrammar.rb",
56
+ "lib/vendor/treetop/lib/treetop/compiler/metagrammar.treetop",
57
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes.rb",
58
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/anything_symbol.rb",
59
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/atomic_expression.rb",
60
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/character_class.rb",
61
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/choice.rb",
62
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/declaration_sequence.rb",
63
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/grammar.rb",
64
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/inline_module.rb",
65
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/nonterminal.rb",
66
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/optional.rb",
67
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/parenthesized_expression.rb",
68
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/parsing_expression.rb",
69
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/parsing_rule.rb",
70
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/predicate.rb",
71
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/repetition.rb",
72
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/sequence.rb",
73
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/terminal.rb",
74
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/transient_prefix.rb",
75
+ "lib/vendor/treetop/lib/treetop/compiler/node_classes/treetop_file.rb",
76
+ "lib/vendor/treetop/lib/treetop/compiler/ruby_builder.rb",
77
+ "lib/vendor/treetop/lib/treetop/ruby_extensions.rb",
78
+ "lib/vendor/treetop/lib/treetop/ruby_extensions/string.rb",
79
+ "lib/vendor/treetop/lib/treetop/runtime.rb",
80
+ "lib/vendor/treetop/lib/treetop/runtime/compiled_parser.rb",
81
+ "lib/vendor/treetop/lib/treetop/runtime/interval_skip_list.rb",
82
+ "lib/vendor/treetop/lib/treetop/runtime/interval_skip_list/head_node.rb",
83
+ "lib/vendor/treetop/lib/treetop/runtime/interval_skip_list/interval_skip_list.rb",
84
+ "lib/vendor/treetop/lib/treetop/runtime/interval_skip_list/node.rb",
85
+ "lib/vendor/treetop/lib/treetop/runtime/syntax_node.rb",
86
+ "lib/vendor/treetop/lib/treetop/runtime/terminal_parse_failure.rb",
87
+ "lib/vendor/treetop/lib/treetop/runtime/terminal_syntax_node.rb",
88
+ "lib/vendor/treetop/lib/treetop/version.rb",
89
+ "lib/vendor/treetop/spec/compiler/and_predicate_spec.rb",
90
+ "lib/vendor/treetop/spec/compiler/anything_symbol_spec.rb",
91
+ "lib/vendor/treetop/spec/compiler/character_class_spec.rb",
92
+ "lib/vendor/treetop/spec/compiler/choice_spec.rb",
93
+ "lib/vendor/treetop/spec/compiler/circular_compilation_spec.rb",
94
+ "lib/vendor/treetop/spec/compiler/failure_propagation_functional_spec.rb",
95
+ "lib/vendor/treetop/spec/compiler/grammar_compiler_spec.rb",
96
+ "lib/vendor/treetop/spec/compiler/grammar_spec.rb",
97
+ "lib/vendor/treetop/spec/compiler/nonterminal_symbol_spec.rb",
98
+ "lib/vendor/treetop/spec/compiler/not_predicate_spec.rb",
99
+ "lib/vendor/treetop/spec/compiler/one_or_more_spec.rb",
100
+ "lib/vendor/treetop/spec/compiler/optional_spec.rb",
101
+ "lib/vendor/treetop/spec/compiler/parenthesized_expression_spec.rb",
102
+ "lib/vendor/treetop/spec/compiler/parsing_rule_spec.rb",
103
+ "lib/vendor/treetop/spec/compiler/sequence_spec.rb",
104
+ "lib/vendor/treetop/spec/compiler/terminal_spec.rb",
105
+ "lib/vendor/treetop/spec/compiler/terminal_symbol_spec.rb",
106
+ "lib/vendor/treetop/spec/compiler/test_grammar.treetop",
107
+ "lib/vendor/treetop/spec/compiler/test_grammar.tt",
108
+ "lib/vendor/treetop/spec/compiler/test_grammar_do.treetop",
109
+ "lib/vendor/treetop/spec/compiler/zero_or_more_spec.rb",
110
+ "lib/vendor/treetop/spec/composition/a.treetop",
111
+ "lib/vendor/treetop/spec/composition/b.treetop",
112
+ "lib/vendor/treetop/spec/composition/c.treetop",
113
+ "lib/vendor/treetop/spec/composition/d.treetop",
114
+ "lib/vendor/treetop/spec/composition/f.treetop",
115
+ "lib/vendor/treetop/spec/composition/grammar_composition_spec.rb",
116
+ "lib/vendor/treetop/spec/composition/subfolder/e_includes_c.treetop",
117
+ "lib/vendor/treetop/spec/ruby_extensions/string_spec.rb",
118
+ "lib/vendor/treetop/spec/runtime/compiled_parser_spec.rb",
119
+ "lib/vendor/treetop/spec/runtime/interval_skip_list/delete_spec.rb",
120
+ "lib/vendor/treetop/spec/runtime/interval_skip_list/expire_range_spec.rb",
121
+ "lib/vendor/treetop/spec/runtime/interval_skip_list/insert_and_delete_node.rb",
122
+ "lib/vendor/treetop/spec/runtime/interval_skip_list/insert_spec.rb",
123
+ "lib/vendor/treetop/spec/runtime/interval_skip_list/interval_skip_list_spec.graffle",
124
+ "lib/vendor/treetop/spec/runtime/interval_skip_list/interval_skip_list_spec.rb",
125
+ "lib/vendor/treetop/spec/runtime/interval_skip_list/palindromic_fixture.rb",
126
+ "lib/vendor/treetop/spec/runtime/interval_skip_list/palindromic_fixture_spec.rb",
127
+ "lib/vendor/treetop/spec/runtime/interval_skip_list/spec_helper.rb",
128
+ "lib/vendor/treetop/spec/runtime/syntax_node_spec.rb",
129
+ "lib/vendor/treetop/spec/spec_helper.rb",
130
+ "lib/vendor/treetop/spec/spec_suite.rb",
131
+ "lib/vendor/treetop/treetop.gemspec",
132
+ "spec/command_spec.rb",
133
+ "spec/css/accessors.css",
134
+ "spec/css/big.css",
135
+ "spec/css/colors.css",
136
+ "spec/css/comments.css",
137
+ "spec/css/css-3.css",
138
+ "spec/css/css.css",
139
+ "spec/css/functions.css",
140
+ "spec/css/import.css",
141
+ "spec/css/lazy-eval.css",
142
+ "spec/css/mixins-args.css",
143
+ "spec/css/mixins.css",
144
+ "spec/css/operations.css",
145
+ "spec/css/parens.css",
146
+ "spec/css/rulesets.css",
147
+ "spec/css/scope.css",
148
+ "spec/css/selectors.css",
149
+ "spec/css/strings.css",
150
+ "spec/css/variables.css",
151
+ "spec/css/whitespace.css",
152
+ "spec/engine_spec.rb",
153
+ "spec/less/accessors.less",
154
+ "spec/less/big.less",
155
+ "spec/less/colors.less",
156
+ "spec/less/comments.less",
157
+ "spec/less/css-3.less",
158
+ "spec/less/css.less",
159
+ "spec/less/exceptions/mixed-units-error.less",
160
+ "spec/less/exceptions/name-error-1.0.less",
161
+ "spec/less/exceptions/syntax-error-1.0.less",
162
+ "spec/less/functions.less",
163
+ "spec/less/import.less",
164
+ "spec/less/import/import-test-a.less",
165
+ "spec/less/import/import-test-b.less",
166
+ "spec/less/import/import-test-c.less",
167
+ "spec/less/import/import-test-d.css",
168
+ "spec/less/lazy-eval.less",
169
+ "spec/less/mixins-args.less",
170
+ "spec/less/mixins.less",
171
+ "spec/less/operations.less",
172
+ "spec/less/parens.less",
173
+ "spec/less/rulesets.less",
174
+ "spec/less/scope.less",
175
+ "spec/less/selectors.less",
176
+ "spec/less/strings.less",
177
+ "spec/less/variables.less",
178
+ "spec/less/whitespace.less",
179
+ "spec/spec.css",
180
+ "spec/spec.less",
181
+ "spec/spec_helper.rb"
182
+ ]
183
+ s.has_rdoc = true
184
+ s.homepage = %q{http://www.lesscss.org}
185
+ s.rdoc_options = ["--charset=UTF-8"]
186
+ s.require_paths = ["lib"]
187
+ s.rubyforge_project = %q{less}
188
+ s.rubygems_version = %q{1.3.1}
189
+ s.summary = %q{LESS compiler}
190
+ s.test_files = [
191
+ "spec/command_spec.rb",
192
+ "spec/engine_spec.rb",
193
+ "spec/spec_helper.rb"
194
+ ]
195
+
196
+ if s.respond_to? :specification_version then
197
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
198
+ s.specification_version = 2
199
+
200
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
201
+ else
202
+ end
203
+ else
204
+ end
205
+ end