less 2.2.2 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Changelog.md +17 -0
- data/Gemfile +7 -3
- data/README.md +29 -13
- data/bin/lessc +3 -1
- data/less.gemspec +2 -6
- data/lib/less/defaults.rb +3 -3
- data/lib/less/java_script/rhino_context.rb +17 -27
- data/lib/less/java_script/v8_context.rb +11 -11
- data/lib/less/js/.gitattributes +10 -0
- data/lib/less/js/.gitignore +24 -0
- data/lib/less/js/.jshintrc +11 -0
- data/lib/less/js/.npmignore +1 -0
- data/lib/less/js/.travis.yml +8 -0
- data/lib/less/js/CHANGELOG.md +299 -0
- data/lib/less/js/CONTRIBUTING.md +50 -0
- data/lib/less/js/Gruntfile.js +298 -0
- data/lib/less/js/README.md +43 -12
- data/lib/less/js/benchmark/benchmark.less +194 -194
- data/lib/less/js/benchmark/less-benchmark.js +9 -10
- data/lib/less/js/bin/lessc +310 -37
- data/lib/less/js/bower.json +18 -0
- data/lib/less/js/build/README.md +51 -0
- data/lib/less/js/build/amd.js +1 -1
- data/lib/less/js/build/browser-header.js +4 -0
- data/lib/less/js/build/build.yml +162 -0
- data/lib/less/js/build/require-rhino.js +7 -2
- data/lib/less/js/build/rhino-header.js +4 -0
- data/lib/less/js/build/rhino-modules.js +131 -0
- data/lib/less/js/build/tasks/.gitkeep +1 -0
- data/lib/less/js/build.gradle +347 -0
- data/lib/less/js/dist/less-1.3.1.js +4011 -0
- data/lib/less/js/dist/less-1.3.1.min.js +9 -0
- data/lib/less/js/dist/less-1.3.2.js +4401 -0
- data/lib/less/js/dist/less-1.3.2.min.js +9 -0
- data/lib/less/js/dist/less-1.3.3.js +4413 -0
- data/lib/less/js/dist/less-1.3.3.min.js +9 -0
- data/lib/less/js/dist/less-1.4.0-beta.js +5830 -0
- data/lib/less/js/dist/less-1.4.0-beta.min.js +11 -0
- data/lib/less/js/dist/less-1.4.0.js +5830 -0
- data/lib/less/js/dist/less-1.4.0.min.js +11 -0
- data/lib/less/js/dist/less-1.4.1.js +5837 -0
- data/lib/less/js/dist/less-1.4.1.min.js +11 -0
- data/lib/less/js/dist/less-1.4.2.js +5837 -0
- data/lib/less/js/dist/less-1.4.2.min.js +11 -0
- data/lib/less/js/dist/less-1.5.0.js +6914 -0
- data/lib/less/js/dist/less-1.5.0.min.js +13 -0
- data/lib/less/js/dist/less-1.5.1.js +6941 -0
- data/lib/less/js/dist/less-1.5.1.min.js +13 -0
- data/lib/less/js/dist/less-1.6.0.js +7485 -0
- data/lib/less/js/dist/less-1.6.0.min.js +16 -0
- data/lib/less/js/dist/less-1.6.1.js +7513 -0
- data/lib/less/js/dist/less-1.6.1.min.js +16 -0
- data/lib/less/js/dist/less-1.6.2.js +7624 -0
- data/lib/less/js/dist/less-1.6.2.min.js +16 -0
- data/lib/less/js/dist/less-1.6.3.js +7627 -0
- data/lib/less/js/dist/less-1.6.3.min.js +16 -0
- data/lib/less/js/dist/less-1.7.0.js +7921 -0
- data/lib/less/js/dist/less-1.7.0.min.js +16 -0
- data/lib/less/js/dist/less-rhino-1.3.1.js +3725 -0
- data/lib/less/js/dist/less-rhino-1.3.2.js +3990 -0
- data/lib/less/js/dist/less-rhino-1.3.3.js +4002 -0
- data/lib/less/js/dist/less-rhino-1.4.0.js +4273 -0
- data/lib/less/js/dist/less-rhino-1.5.1.js +6831 -0
- data/lib/less/js/dist/less-rhino-1.6.2.js +9017 -0
- data/lib/less/js/dist/less-rhino-1.6.3.js +9020 -0
- data/lib/less/js/dist/less-rhino-1.7.0.js +9301 -0
- data/lib/less/js/dist/lessc-rhino-1.6.2.js +449 -0
- data/lib/less/js/dist/lessc-rhino-1.6.3.js +449 -0
- data/lib/less/js/dist/lessc-rhino-1.7.0.js +449 -0
- data/lib/less/js/gradle/wrapper/gradle-wrapper.jar +0 -0
- data/lib/less/js/gradle/wrapper/gradle-wrapper.properties +6 -0
- data/lib/less/js/gradlew +164 -0
- data/lib/less/js/gradlew.bat +90 -0
- data/lib/less/js/lib/less/browser.js +547 -250
- data/lib/less/js/lib/less/encoder.js +4 -0
- data/lib/less/js/lib/less/env.js +136 -0
- data/lib/less/js/lib/less/extend-visitor.js +416 -0
- data/lib/less/js/lib/less/functions.js +576 -36
- data/lib/less/js/lib/less/import-visitor.js +142 -0
- data/lib/less/js/lib/less/index.js +187 -83
- data/lib/less/js/lib/less/join-selector-visitor.js +44 -0
- data/lib/less/js/lib/less/lessc_helper.js +82 -0
- data/lib/less/js/lib/less/parser.js +1286 -523
- data/lib/less/js/lib/less/rhino.js +415 -29
- data/lib/less/js/lib/less/source-map-output.js +141 -0
- data/lib/less/js/lib/less/to-css-visitor.js +240 -0
- data/lib/less/js/lib/less/tree/alpha.js +17 -5
- data/lib/less/js/lib/less/tree/anonymous.js +25 -4
- data/lib/less/js/lib/less/tree/assignment.js +17 -5
- data/lib/less/js/lib/less/tree/call.js +36 -13
- data/lib/less/js/lib/less/tree/color.js +119 -31
- data/lib/less/js/lib/less/tree/comment.js +18 -4
- data/lib/less/js/lib/less/tree/condition.js +35 -28
- data/lib/less/js/lib/less/tree/detached-ruleset.js +20 -0
- data/lib/less/js/lib/less/tree/dimension.js +291 -16
- data/lib/less/js/lib/less/tree/directive.js +56 -22
- data/lib/less/js/lib/less/tree/element.js +78 -17
- data/lib/less/js/lib/less/tree/expression.js +39 -8
- data/lib/less/js/lib/less/tree/extend.js +53 -0
- data/lib/less/js/lib/less/tree/import.js +81 -36
- data/lib/less/js/lib/less/tree/javascript.js +17 -10
- data/lib/less/js/lib/less/tree/keyword.js +8 -3
- data/lib/less/js/lib/less/tree/media.js +70 -27
- data/lib/less/js/lib/less/tree/mixin.js +250 -70
- data/lib/less/js/lib/less/tree/negative.js +24 -0
- data/lib/less/js/lib/less/tree/operation.js +38 -13
- data/lib/less/js/lib/less/tree/paren.js +9 -2
- data/lib/less/js/lib/less/tree/quoted.js +29 -10
- data/lib/less/js/lib/less/tree/rule.js +77 -29
- data/lib/less/js/lib/less/tree/ruleset-call.js +16 -0
- data/lib/less/js/lib/less/tree/ruleset.js +445 -107
- data/lib/less/js/lib/less/tree/selector.js +117 -30
- data/lib/less/js/lib/less/tree/unicode-descriptor.js +15 -0
- data/lib/less/js/lib/less/tree/url.js +43 -15
- data/lib/less/js/lib/less/tree/value.js +16 -6
- data/lib/less/js/lib/less/tree/variable.js +26 -8
- data/lib/less/js/lib/less/tree.js +82 -2
- data/lib/less/js/lib/less/visitor.js +146 -0
- data/lib/less/js/lib/source-map/source-map-0.1.31.js +1933 -0
- data/lib/less/js/lib/source-map/source-map-footer.js +4 -0
- data/lib/less/js/lib/source-map/source-map-header.js +3 -0
- data/lib/less/js/package.json +86 -11
- data/lib/less/js/test/browser/common.js +201 -0
- data/lib/less/js/test/browser/css/global-vars/simple.css +3 -0
- data/lib/less/js/test/browser/css/modify-vars/simple.css +8 -0
- data/lib/less/js/test/browser/css/postProcessor/postProcessor.css +4 -0
- data/lib/less/js/test/browser/css/relative-urls/urls.css +35 -0
- data/lib/less/js/test/browser/css/rootpath/urls.css +35 -0
- data/lib/less/js/test/browser/css/rootpath-relative/urls.css +35 -0
- data/lib/less/js/test/browser/css/urls.css +53 -0
- data/lib/less/js/test/browser/es5.js +27 -0
- data/lib/less/js/test/browser/jasmine-html.js +681 -0
- data/lib/less/js/test/browser/jasmine.css +82 -0
- data/lib/less/js/test/browser/jasmine.js +2600 -0
- data/lib/less/js/test/browser/less/console-errors/test-error.less +3 -0
- data/lib/less/js/test/browser/less/console-errors/test-error.txt +2 -0
- data/lib/less/js/test/browser/less/global-vars/simple.less +3 -0
- data/lib/less/js/test/browser/less/imports/urls.less +4 -0
- data/lib/less/js/test/browser/less/imports/urls2.less +4 -0
- data/lib/less/js/test/browser/less/modify-vars/imports/simple2.less +4 -0
- data/lib/less/js/test/browser/less/modify-vars/simple.less +8 -0
- data/lib/less/js/test/browser/less/postProcessor/postProcessor.less +4 -0
- data/lib/less/js/test/browser/less/relative-urls/urls.less +33 -0
- data/lib/less/js/test/browser/less/rootpath/urls.less +33 -0
- data/lib/less/js/test/browser/less/rootpath-relative/urls.less +33 -0
- data/lib/less/js/test/browser/less/urls.less +57 -0
- data/lib/less/js/test/browser/phantom-runner.js +150 -0
- data/lib/less/js/test/browser/runner-browser-options.js +42 -0
- data/lib/less/js/test/browser/runner-browser-spec.js +12 -0
- data/lib/less/js/test/browser/runner-console-errors.js +5 -0
- data/lib/less/js/test/browser/runner-errors-options.js +5 -0
- data/lib/less/js/test/browser/runner-errors-spec.js +4 -0
- data/lib/less/js/test/browser/runner-global-vars-options.js +4 -0
- data/lib/less/js/test/browser/runner-global-vars-spec.js +3 -0
- data/lib/less/js/test/browser/runner-legacy-options.js +4 -0
- data/lib/less/js/test/browser/runner-legacy-spec.js +3 -0
- data/lib/less/js/test/browser/runner-main-options.js +15 -0
- data/lib/less/js/test/browser/runner-main-spec.js +3 -0
- data/lib/less/js/test/browser/runner-modify-vars-options.js +2 -0
- data/lib/less/js/test/browser/runner-modify-vars-spec.js +43 -0
- data/lib/less/js/test/browser/runner-no-js-errors-options.js +4 -0
- data/lib/less/js/test/browser/runner-no-js-errors-spec.js +4 -0
- data/lib/less/js/test/browser/runner-postProcessor-options.js +4 -0
- data/lib/less/js/test/browser/runner-postProcessor.js +3 -0
- data/lib/less/js/test/browser/runner-production-options.js +3 -0
- data/lib/less/js/test/browser/runner-production-spec.js +5 -0
- data/lib/less/js/test/browser/runner-relative-urls-options.js +3 -0
- data/lib/less/js/test/browser/runner-relative-urls-spec.js +3 -0
- data/lib/less/js/test/browser/runner-rootpath-options.js +3 -0
- data/lib/less/js/test/browser/runner-rootpath-relative-options.js +4 -0
- data/lib/less/js/test/browser/runner-rootpath-relative-spec.js +3 -0
- data/lib/less/js/test/browser/runner-rootpath-spec.js +3 -0
- data/lib/less/js/test/browser/test-runner-template.tmpl +47 -0
- data/lib/less/js/test/css/charsets.css +1 -0
- data/lib/less/js/test/css/colors.css +29 -0
- data/lib/less/js/test/css/comments.css +15 -2
- data/lib/less/js/test/css/compression/compression.css +3 -0
- data/lib/less/js/test/css/css-3.css +73 -2
- data/lib/less/js/test/css/css-escapes.css +4 -0
- data/lib/less/js/test/css/css-guards.css +37 -0
- data/lib/less/js/test/css/css.css +20 -14
- data/lib/less/js/test/css/debug/linenumbers-all.css +49 -0
- data/lib/less/js/test/css/debug/linenumbers-comments.css +40 -0
- data/lib/less/js/test/css/debug/linenumbers-mediaquery.css +40 -0
- data/lib/less/js/test/css/detached-rulesets.css +71 -0
- data/lib/less/js/test/css/empty.css +0 -0
- data/lib/less/js/test/css/extend-chaining.css +81 -0
- data/lib/less/js/test/css/extend-clearfix.css +19 -0
- data/lib/less/js/test/css/extend-exact.css +37 -0
- data/lib/less/js/test/css/extend-media.css +24 -0
- data/lib/less/js/test/css/extend-nest.css +57 -0
- data/lib/less/js/test/css/extend-selector.css +80 -0
- data/lib/less/js/test/css/extend.css +76 -0
- data/lib/less/js/test/css/extract-and-length.css +133 -0
- data/lib/less/js/test/css/functions.css +117 -2
- data/lib/less/js/test/css/globalVars/extended.css +12 -0
- data/lib/less/js/test/css/globalVars/simple.css +6 -0
- data/lib/less/js/test/css/ie-filters.css +7 -3
- data/lib/less/js/test/css/import-inline.css +5 -0
- data/lib/less/js/test/css/import-interpolation.css +6 -0
- data/lib/less/js/test/css/import-once.css +15 -0
- data/lib/less/js/test/css/import-reference.css +68 -0
- data/lib/less/js/test/css/import.css +23 -10
- data/lib/less/js/test/css/javascript.css +3 -2
- data/lib/less/js/test/css/legacy/legacy.css +7 -0
- data/lib/less/js/test/css/media.css +141 -1
- data/lib/less/js/test/css/merge.css +34 -0
- data/lib/less/js/test/css/mixins-args.css +41 -4
- data/lib/less/js/test/css/mixins-guards-default-func.css +129 -0
- data/lib/less/js/test/css/mixins-guards.css +24 -0
- data/lib/less/js/test/css/mixins-important.css +28 -0
- data/lib/less/js/test/css/mixins-interpolated.css +39 -0
- data/lib/less/js/test/css/mixins-named-args.css +27 -0
- data/lib/less/js/test/css/mixins-pattern.css +4 -0
- data/lib/less/js/test/css/mixins.css +70 -0
- data/lib/less/js/test/css/modifyVars/extended.css +9 -0
- data/lib/less/js/test/css/no-output.css +0 -0
- data/lib/less/js/test/css/parens.css +21 -5
- data/lib/less/js/test/css/property-name-interp.css +20 -0
- data/lib/less/js/test/css/scope.css +23 -0
- data/lib/less/js/test/css/selectors.css +84 -0
- data/lib/less/js/test/css/static-urls/urls.css +45 -0
- data/lib/less/js/test/css/strings.css +5 -2
- data/lib/less/js/test/css/url-args/urls.css +56 -0
- data/lib/less/js/test/css/urls.css +71 -0
- data/lib/less/js/test/css/variables-in-at-rules.css +18 -0
- data/lib/less/js/test/css/variables.css +22 -4
- data/lib/less/js/test/css/whitespace.css +4 -0
- data/lib/less/js/test/data/data-uri-fail.png +0 -0
- data/lib/less/js/test/data/image.jpg +1 -0
- data/lib/less/js/test/data/page.html +1 -0
- data/lib/less/js/test/index.js +45 -0
- data/lib/less/js/test/less/charsets.less +3 -0
- data/lib/less/js/test/less/colors.less +37 -4
- data/lib/less/js/test/less/comments.less +21 -3
- data/lib/less/js/test/less/compression/compression.less +36 -0
- data/lib/less/js/test/less/css-3.less +70 -6
- data/lib/less/js/test/less/css-escapes.less +6 -1
- data/lib/less/js/test/less/css-guards.less +102 -0
- data/lib/less/js/test/less/css.less +23 -15
- data/lib/less/js/test/less/debug/import/test.less +25 -0
- data/lib/less/js/test/less/debug/linenumbers.less +33 -0
- data/lib/less/js/test/less/detached-rulesets.less +103 -0
- data/lib/less/js/test/less/empty.less +0 -0
- data/lib/less/js/test/less/errors/add-mixed-units.less +3 -0
- data/lib/less/js/test/less/errors/add-mixed-units.txt +4 -0
- data/lib/less/js/test/less/errors/add-mixed-units2.less +3 -0
- data/lib/less/js/test/less/errors/add-mixed-units2.txt +4 -0
- data/lib/less/js/test/less/errors/at-rules-undefined-var.less +4 -0
- data/lib/less/js/test/less/errors/at-rules-undefined-var.txt +4 -0
- data/lib/less/js/test/less/errors/bad-variable-declaration1.less +1 -0
- data/lib/less/js/test/less/errors/bad-variable-declaration1.txt +2 -0
- data/lib/less/js/test/less/errors/color-func-invalid-color.less +3 -0
- data/lib/less/js/test/less/errors/color-func-invalid-color.txt +4 -0
- data/lib/less/js/test/less/errors/comment-in-selector.less +1 -0
- data/lib/less/js/test/less/errors/comment-in-selector.txt +2 -0
- data/lib/less/js/test/less/errors/css-guard-default-func.less +4 -0
- data/lib/less/js/test/less/errors/css-guard-default-func.txt +4 -0
- data/lib/less/js/test/less/errors/detached-ruleset-1.less +6 -0
- data/lib/less/js/test/less/errors/detached-ruleset-1.txt +4 -0
- data/lib/less/js/test/less/errors/detached-ruleset-2.less +6 -0
- data/lib/less/js/test/less/errors/detached-ruleset-2.txt +4 -0
- data/lib/less/js/test/less/errors/detached-ruleset-3.less +4 -0
- data/lib/less/js/test/less/errors/detached-ruleset-3.txt +4 -0
- data/lib/less/js/test/less/errors/detached-ruleset-4.less +5 -0
- data/lib/less/js/test/less/errors/detached-ruleset-4.txt +3 -0
- data/lib/less/js/test/less/errors/detached-ruleset-5.less +4 -0
- data/lib/less/js/test/less/errors/detached-ruleset-5.txt +3 -0
- data/lib/less/js/test/less/errors/detached-ruleset-6.less +5 -0
- data/lib/less/js/test/less/errors/detached-ruleset-6.txt +4 -0
- data/lib/less/js/test/less/errors/divide-mixed-units.less +3 -0
- data/lib/less/js/test/less/errors/divide-mixed-units.txt +4 -0
- data/lib/less/js/test/less/errors/extend-no-selector.less +3 -0
- data/lib/less/js/test/less/errors/extend-no-selector.txt +3 -0
- data/lib/less/js/test/less/errors/extend-not-at-end.less +3 -0
- data/lib/less/js/test/less/errors/extend-not-at-end.txt +3 -0
- data/lib/less/js/test/less/errors/import-missing.less +6 -0
- data/lib/less/js/test/less/errors/import-missing.txt +3 -0
- data/lib/less/js/test/less/errors/import-no-semi.less +1 -0
- data/lib/less/js/test/less/errors/import-no-semi.txt +2 -0
- data/lib/less/js/test/less/errors/import-subfolder1.less +1 -0
- data/lib/less/js/test/less/errors/import-subfolder1.txt +3 -0
- data/lib/less/js/test/less/errors/import-subfolder2.less +1 -0
- data/lib/less/js/test/less/errors/import-subfolder2.txt +4 -0
- data/lib/less/js/test/less/errors/imports/import-subfolder1.less +1 -0
- data/lib/less/js/test/less/errors/imports/import-subfolder2.less +1 -0
- data/lib/less/js/test/less/errors/imports/import-test.less +4 -0
- data/lib/less/js/test/less/errors/imports/subfolder/mixin-not-defined.less +1 -0
- data/lib/less/js/test/less/errors/imports/subfolder/parse-error-curly-bracket.less +1 -0
- data/lib/less/js/test/less/errors/javascript-error.less +3 -0
- data/lib/less/js/test/less/errors/javascript-error.txt +4 -0
- data/lib/less/js/test/less/errors/javascript-undefined-var.less +3 -0
- data/lib/less/js/test/less/errors/javascript-undefined-var.txt +4 -0
- data/lib/less/js/test/less/errors/mixed-mixin-definition-args-1.less +6 -0
- data/lib/less/js/test/less/errors/mixed-mixin-definition-args-1.txt +4 -0
- data/lib/less/js/test/less/errors/mixed-mixin-definition-args-2.less +6 -0
- data/lib/less/js/test/less/errors/mixed-mixin-definition-args-2.txt +4 -0
- data/lib/less/js/test/less/errors/mixin-not-defined.less +11 -0
- data/lib/less/js/test/less/errors/mixin-not-defined.txt +3 -0
- data/lib/less/js/test/less/errors/mixin-not-matched.less +6 -0
- data/lib/less/js/test/less/errors/mixin-not-matched.txt +3 -0
- data/lib/less/js/test/less/errors/mixin-not-matched2.less +6 -0
- data/lib/less/js/test/less/errors/mixin-not-matched2.txt +3 -0
- data/lib/less/js/test/less/errors/mixin-not-visible-in-scope-1.less +9 -0
- data/lib/less/js/test/less/errors/mixin-not-visible-in-scope-1.txt +4 -0
- data/lib/less/js/test/less/errors/mixins-guards-default-func-1.less +9 -0
- data/lib/less/js/test/less/errors/mixins-guards-default-func-1.txt +4 -0
- data/lib/less/js/test/less/errors/mixins-guards-default-func-2.less +9 -0
- data/lib/less/js/test/less/errors/mixins-guards-default-func-2.txt +4 -0
- data/lib/less/js/test/less/errors/mixins-guards-default-func-3.less +9 -0
- data/lib/less/js/test/less/errors/mixins-guards-default-func-3.txt +4 -0
- data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors.less +4 -0
- data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors.txt +4 -0
- data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors2.less +4 -0
- data/lib/less/js/test/less/errors/multiple-guards-on-css-selectors2.txt +4 -0
- data/lib/less/js/test/less/errors/multiply-mixed-units.less +7 -0
- data/lib/less/js/test/less/errors/multiply-mixed-units.txt +4 -0
- data/lib/less/js/test/less/errors/parens-error-1.less +3 -0
- data/lib/less/js/test/less/errors/parens-error-1.txt +4 -0
- data/lib/less/js/test/less/errors/parens-error-2.less +3 -0
- data/lib/less/js/test/less/errors/parens-error-2.txt +4 -0
- data/lib/less/js/test/less/errors/parens-error-3.less +3 -0
- data/lib/less/js/test/less/errors/parens-error-3.txt +4 -0
- data/lib/less/js/test/less/errors/parse-error-curly-bracket.less +4 -0
- data/lib/less/js/test/less/errors/parse-error-curly-bracket.txt +4 -0
- data/lib/less/js/test/less/errors/parse-error-extra-parens.less +5 -0
- data/lib/less/js/test/less/errors/parse-error-extra-parens.txt +3 -0
- data/lib/less/js/test/less/errors/parse-error-missing-bracket.less +2 -0
- data/lib/less/js/test/less/errors/parse-error-missing-bracket.txt +3 -0
- data/lib/less/js/test/less/errors/parse-error-missing-parens.less +5 -0
- data/lib/less/js/test/less/errors/parse-error-missing-parens.txt +3 -0
- data/lib/less/js/test/less/errors/parse-error-with-import.less +13 -0
- data/lib/less/js/test/less/errors/parse-error-with-import.txt +4 -0
- data/lib/less/js/test/less/errors/percentage-missing-space.less +3 -0
- data/lib/less/js/test/less/errors/percentage-missing-space.txt +4 -0
- data/lib/less/js/test/less/errors/property-asterisk-only-name.less +3 -0
- data/lib/less/js/test/less/errors/property-asterisk-only-name.txt +4 -0
- data/lib/less/js/test/less/errors/property-ie5-hack.less +3 -0
- data/lib/less/js/test/less/errors/property-ie5-hack.txt +4 -0
- data/lib/less/js/test/less/errors/property-in-root.less +4 -0
- data/lib/less/js/test/less/errors/property-in-root.txt +4 -0
- data/lib/less/js/test/less/errors/property-in-root2.less +1 -0
- data/lib/less/js/test/less/errors/property-in-root2.txt +4 -0
- data/lib/less/js/test/less/errors/property-in-root3.less +4 -0
- data/lib/less/js/test/less/errors/property-in-root3.txt +3 -0
- data/lib/less/js/test/less/errors/property-interp-not-defined.less +1 -0
- data/lib/less/js/test/less/errors/property-interp-not-defined.txt +2 -0
- data/lib/less/js/test/less/errors/recursive-variable.less +1 -0
- data/lib/less/js/test/less/errors/recursive-variable.txt +2 -0
- data/lib/less/js/test/less/errors/svg-gradient1.less +3 -0
- data/lib/less/js/test/less/errors/svg-gradient1.txt +4 -0
- data/lib/less/js/test/less/errors/svg-gradient2.less +3 -0
- data/lib/less/js/test/less/errors/svg-gradient2.txt +4 -0
- data/lib/less/js/test/less/errors/svg-gradient3.less +3 -0
- data/lib/less/js/test/less/errors/svg-gradient3.txt +4 -0
- data/lib/less/js/test/less/errors/unit-function.less +3 -0
- data/lib/less/js/test/less/errors/unit-function.txt +4 -0
- data/lib/less/js/test/less/extend-chaining.less +91 -0
- data/lib/less/js/test/less/extend-clearfix.less +19 -0
- data/lib/less/js/test/less/extend-exact.less +46 -0
- data/lib/less/js/test/less/extend-media.less +24 -0
- data/lib/less/js/test/less/extend-nest.less +65 -0
- data/lib/less/js/test/less/extend-selector.less +99 -0
- data/lib/less/js/test/less/extend.less +81 -0
- data/lib/less/js/test/less/extract-and-length.less +133 -0
- data/lib/less/js/test/less/functions.less +130 -6
- data/lib/less/js/test/less/globalVars/extended.json +5 -0
- data/lib/less/js/test/less/globalVars/extended.less +10 -0
- data/lib/less/js/test/less/globalVars/simple.json +3 -0
- data/lib/less/js/test/less/globalVars/simple.less +3 -0
- data/lib/less/js/test/less/ie-filters.less +7 -0
- data/lib/less/js/test/less/import/deeper/import-once-test-a.less +1 -0
- data/lib/less/js/test/less/import/import-and-relative-paths-test.less +17 -0
- data/lib/less/js/test/less/import/import-charset-test.less +1 -0
- data/lib/less/js/test/less/import/import-interpolation.less +1 -0
- data/lib/less/js/test/less/import/import-interpolation2.less +5 -0
- data/lib/less/js/test/less/import/import-once-test-c.less +6 -0
- data/lib/less/js/test/less/import/import-reference.less +51 -0
- data/lib/less/js/test/less/import/import-test-a.less +1 -0
- data/lib/less/js/test/less/import/import-test-c.less +0 -1
- data/lib/less/js/test/less/import/import-test-f.less +5 -0
- data/lib/less/js/test/less/import/imports/font.less +8 -0
- data/lib/less/js/test/less/import/imports/logo.less +5 -0
- data/lib/less/js/test/less/import/invalid-css.less +1 -0
- data/lib/less/js/test/less/import/urls.less +1 -0
- data/lib/less/js/test/less/import-inline.less +2 -0
- data/lib/less/js/test/less/import-interpolation.less +8 -0
- data/lib/less/js/test/less/import-once.less +6 -0
- data/lib/less/js/test/less/import-reference.less +21 -0
- data/lib/less/js/test/less/import.less +13 -3
- data/lib/less/js/test/less/javascript.less +5 -3
- data/lib/less/js/test/less/legacy/legacy.less +7 -0
- data/lib/less/js/test/less/media.less +158 -3
- data/lib/less/js/test/less/merge.less +78 -0
- data/lib/less/js/test/less/mixins-args.less +93 -15
- data/lib/less/js/test/less/mixins-guards-default-func.less +195 -0
- data/lib/less/js/test/less/mixins-guards.less +65 -0
- data/lib/less/js/test/less/mixins-important.less +8 -1
- data/lib/less/js/test/less/mixins-interpolated.less +69 -0
- data/lib/less/js/test/less/mixins-named-args.less +36 -0
- data/lib/less/js/test/less/mixins-nested.less +2 -2
- data/lib/less/js/test/less/mixins-pattern.less +4 -1
- data/lib/less/js/test/less/mixins.less +74 -0
- data/lib/less/js/test/less/modifyVars/extended.json +5 -0
- data/lib/less/js/test/less/modifyVars/extended.less +11 -0
- data/lib/less/js/test/less/no-js-errors/no-js-errors.less +3 -0
- data/lib/less/js/test/less/no-js-errors/no-js-errors.txt +4 -0
- data/lib/less/js/test/less/no-output.less +2 -0
- data/lib/less/js/test/less/operations.less +27 -27
- data/lib/less/js/test/less/parens.less +24 -5
- data/lib/less/js/test/less/property-name-interp.less +53 -0
- data/lib/less/js/test/less/scope.less +73 -1
- data/lib/less/js/test/less/selectors.less +101 -0
- data/lib/less/js/test/less/sourcemaps/basic.json +3 -0
- data/lib/less/js/test/less/sourcemaps/basic.less +27 -0
- data/lib/less/js/test/less/sourcemaps/imported.css +7 -0
- data/lib/less/js/test/less/static-urls/urls.less +33 -0
- data/lib/less/js/test/less/strings.less +7 -1
- data/lib/less/js/test/less/url-args/urls.less +63 -0
- data/lib/less/js/test/less/urls.less +72 -0
- data/lib/less/js/test/less/variables-in-at-rules.less +20 -0
- data/lib/less/js/test/less/variables.less +42 -13
- data/lib/less/js/test/less/whitespace.less +7 -0
- data/lib/less/js/test/less-test.js +251 -65
- data/lib/less/js/test/rhino/test-header.js +15 -0
- data/lib/less/js/test/sourcemaps/basic.json +1 -0
- data/lib/less/js/test/sourcemaps/index.html +17 -0
- data/lib/less/loader.rb +191 -27
- data/lib/less/parser.rb +47 -8
- data/lib/less/version.rb +2 -2
- data/spec/less/loader_spec.rb +45 -0
- data/spec/less/parser_spec.rb +43 -17
- data/spec/less/some/some.css +0 -0
- data/spec/less/some/some.less +4 -0
- metadata +352 -57
- data/lib/less/js/CHANGELOG +0 -41
- data/lib/less/js/Makefile +0 -75
- data/lib/less/js/build/ecma-5.js +0 -120
- data/lib/less/js/build/header.js +0 -7
- data/lib/less/js/lib/less/cssmin.js +0 -355
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 792bbf2f97fe5b11d31fba7f199cf862ed7cc4c0
|
4
|
+
data.tar.gz: 766dd0f65348fceb17aaf77e3057b6dfe52f7f3a
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8e01c4a9d2bdb3d04341b96c4b71ff9967d20b63715a9d699752a9ae8e2bd105bbb832bd73450c98d22225b3b9add67d750877b13f0619612e8fb330e904742b
|
7
|
+
data.tar.gz: 492ade4340c93627608eed38084e9151dd86cc4fc13ef7f99d7ecf398c13cc85f15f10fe3f594f6084bf0f381ba224f0a7633914681e3eef189ea7b7f12d1fb5
|
data/Changelog.md
ADDED
data/Gemfile
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
gemspec
|
4
4
|
|
5
|
+
gem "therubyracer", "~> 0.12.0", :require => nil, :platforms => :ruby
|
6
|
+
gem "therubyrhino", ">= 2.0.2", :require => nil, :platforms => :jruby
|
5
7
|
|
6
|
-
|
7
|
-
gem "
|
8
|
+
group :development do
|
9
|
+
gem "rake", :require => nil
|
10
|
+
gem "rspec", "~> 2.0"
|
11
|
+
end
|
data/README.md
CHANGED
@@ -1,37 +1,53 @@
|
|
1
|
-
less.rb
|
2
|
-
=======
|
1
|
+
# less.rb
|
3
2
|
|
4
3
|
The **dynamic** stylesheet language.
|
5
4
|
|
6
5
|
<http://lesscss.org>
|
7
6
|
|
8
|
-
|
9
|
-
|
7
|
+
[![Build Status](https://secure.travis-ci.org/cowboyd/less.rb.png)](http://travis-ci.org/cowboyd/less.rb)
|
8
|
+
|
9
|
+
## About
|
10
10
|
|
11
11
|
These are Ruby bindings for the next generation LESS, which is implemented in JavaScript
|
12
12
|
|
13
13
|
For more information, visit <http://lesscss.org>.
|
14
14
|
|
15
|
-
|
16
|
-
------
|
15
|
+
## Usage
|
17
16
|
|
18
17
|
less.rb exposes the `less.Parser` constructor to ruby code via `Less::Parser`. You can instate it
|
19
18
|
context free:
|
20
19
|
|
21
|
-
|
20
|
+
```ruby
|
21
|
+
parser = Less::Parser.new
|
22
|
+
```
|
22
23
|
|
23
24
|
or with configuration options:
|
24
25
|
|
25
|
-
|
26
|
+
```ruby
|
27
|
+
parser = Less::Parser.new :paths => ['./lib', 'other/lib'], :filename => 'mystyles.less'
|
28
|
+
```
|
26
29
|
|
27
30
|
Once you have a parser instantiated, you can parse code to get your AST !
|
28
31
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
+
```ruby
|
33
|
+
tree = parser.parse(".class {width: 1+1}") # => Less::Tree
|
34
|
+
tree.to_css #=> .class {\n width: 2;\n}\n
|
35
|
+
tree.to_css(:compress => true) #=> .class{width:2;}
|
36
|
+
```
|
37
|
+
|
38
|
+
## Development
|
39
|
+
|
40
|
+
This repository contains less.js as a submodule, so to run the tests,
|
41
|
+
you'll need to grab that code as well. To do that, run `git submodule update --init`
|
42
|
+
from the root directory of the project.
|
43
|
+
|
44
|
+
To run the tests:
|
45
|
+
|
46
|
+
bundle
|
47
|
+
rake
|
48
|
+
|
32
49
|
|
33
|
-
|
34
|
-
-------
|
50
|
+
## License
|
35
51
|
|
36
52
|
less.rb is licensed under the same terms as less.js
|
37
53
|
|
data/bin/lessc
CHANGED
@@ -17,6 +17,8 @@ output = nil
|
|
17
17
|
require 'optparse'
|
18
18
|
|
19
19
|
opts = OptionParser.new do |opts|
|
20
|
+
opts.summary_width = 37
|
21
|
+
|
20
22
|
opts.banner = 'Usage: lessc [options] [INPUT]'
|
21
23
|
|
22
24
|
opts.on('-h', '--help', 'print this help') do
|
@@ -52,7 +54,7 @@ opts = OptionParser.new do |opts|
|
|
52
54
|
require 'rbconfig'
|
53
55
|
is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)
|
54
56
|
separator = is_windows ? ';' : ':'
|
55
|
-
opts.on('--paths', '--include-path',
|
57
|
+
opts.on('--paths PATHS', '--include-path PATHS',
|
56
58
|
"paths to include separated by '#{separator}'") do |paths|
|
57
59
|
paths = paths.split(separator).map do |path|
|
58
60
|
path.empty? ? nil : File.expand_path(path)
|
data/less.gemspec
CHANGED
@@ -11,8 +11,8 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.homepage = "http://lesscss.org"
|
12
12
|
s.summary = %q{Leaner CSS, in your browser or Ruby (via less.js)}
|
13
13
|
s.description = %q{Invoke the Less CSS compiler from Ruby}
|
14
|
-
|
15
14
|
s.rubyforge_project = "less"
|
15
|
+
s.license = 'Apache 2.0'
|
16
16
|
|
17
17
|
s.files = `git ls-files`.split("\n")
|
18
18
|
Dir.chdir('lib/less/js') do
|
@@ -22,9 +22,5 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
23
23
|
s.require_paths = ["lib"]
|
24
24
|
|
25
|
-
s.add_dependency "commonjs", "~> 0.2.
|
26
|
-
s.add_development_dependency "rake"
|
27
|
-
s.add_development_dependency "rspec", "~> 2.0"
|
28
|
-
|
25
|
+
s.add_dependency "commonjs", "~> 0.2.7"
|
29
26
|
end
|
30
|
-
|
data/lib/less/defaults.rb
CHANGED
@@ -6,18 +6,18 @@ rescue LoadError => e
|
|
6
6
|
end
|
7
7
|
|
8
8
|
require 'rhino/version'
|
9
|
-
if Rhino::VERSION < '
|
10
|
-
raise LoadError, "expected gem 'therubyrhino' '>=
|
9
|
+
if Rhino::VERSION < '2.0.2'
|
10
|
+
raise LoadError, "expected gem 'therubyrhino' '>= 2.0.2' but got '#{Rhino::VERSION}'"
|
11
11
|
end
|
12
12
|
|
13
13
|
module Less
|
14
14
|
module JavaScript
|
15
15
|
class RhinoContext
|
16
|
-
|
16
|
+
|
17
17
|
def self.instance
|
18
18
|
return new # NOTE: for Rhino a context should be kept open per thread !
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def initialize(globals = nil)
|
22
22
|
@rhino_context = Rhino::Context.new :java => true
|
23
23
|
if @rhino_context.respond_to?(:version)
|
@@ -26,14 +26,13 @@ module Less
|
|
26
26
|
else
|
27
27
|
apply_1_8_compatibility!
|
28
28
|
end
|
29
|
-
fix_memory_limit! @rhino_context
|
30
29
|
globals.each { |key, val| @rhino_context[key] = val } if globals
|
31
30
|
end
|
32
31
|
|
33
32
|
def unwrap
|
34
33
|
@rhino_context
|
35
34
|
end
|
36
|
-
|
35
|
+
|
37
36
|
def exec(&block)
|
38
37
|
@rhino_context.open(&block)
|
39
38
|
rescue Rhino::JSError => e
|
@@ -42,7 +41,7 @@ module Less
|
|
42
41
|
|
43
42
|
def eval(source, options = {})
|
44
43
|
source = source.encode('UTF-8') if source.respond_to?(:encode)
|
45
|
-
|
44
|
+
|
46
45
|
source_name = options[:source_name] || "<eval>"
|
47
46
|
line_number = options[:line_number] || 1
|
48
47
|
@rhino_context.eval("(#{source})", source_name, line_number)
|
@@ -52,14 +51,14 @@ module Less
|
|
52
51
|
|
53
52
|
def call(properties, *args)
|
54
53
|
options = args.last.is_a?(::Hash) ? args.pop : {} # extract_option!
|
55
|
-
|
54
|
+
|
56
55
|
source_name = options[:source_name] || "<eval>"
|
57
56
|
line_number = options[:line_number] || 1
|
58
57
|
@rhino_context.eval(properties, source_name, line_number).call(*args)
|
59
58
|
rescue Rhino::JSError => e
|
60
59
|
handle_js_error(e)
|
61
60
|
end
|
62
|
-
|
61
|
+
|
63
62
|
def method_missing(symbol, *args)
|
64
63
|
if @rhino_context.respond_to?(symbol)
|
65
64
|
@rhino_context.send(symbol, *args)
|
@@ -67,44 +66,35 @@ module Less
|
|
67
66
|
super
|
68
67
|
end
|
69
68
|
end
|
70
|
-
|
69
|
+
|
71
70
|
private
|
72
|
-
|
71
|
+
|
73
72
|
def handle_js_error(e)
|
74
73
|
if e.value && ( e.value['message'] || e.value['type'].is_a?(String) )
|
75
74
|
raise Less::ParseError.new(e, e.value) # LessError
|
76
75
|
end
|
77
|
-
if e.unwrap.to_s
|
76
|
+
if e.unwrap.to_s =~ /missing opening `\(`/
|
78
77
|
raise Less::ParseError.new(e.unwrap.to_s)
|
79
78
|
end
|
80
79
|
if e.message && e.message[0, 12] == "Syntax Error"
|
81
80
|
raise Less::ParseError.new(e)
|
82
81
|
else
|
83
82
|
raise Less::Error.new(e)
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
# Disables bytecode compiling which limits you to 64K scripts
|
88
|
-
def fix_memory_limit!(context)
|
89
|
-
if context.respond_to?(:optimization_level=)
|
90
|
-
context.optimization_level = -1
|
91
|
-
else
|
92
|
-
context.instance_eval { @native.setOptimizationLevel(-1) }
|
93
83
|
end
|
94
84
|
end
|
95
|
-
|
85
|
+
|
96
86
|
def apply_1_8_compatibility!
|
97
87
|
# TODO rather load ecma-5.js ...
|
98
88
|
@rhino_context.eval("
|
99
89
|
// String
|
100
|
-
if ( ! String.prototype.trim ) {
|
101
|
-
String.prototype.trim = function () {
|
102
|
-
return this.replace(/^\s+|\s+$/g,'');
|
103
|
-
};
|
90
|
+
if ( ! String.prototype.trim ) {
|
91
|
+
String.prototype.trim = function () {
|
92
|
+
return this.replace(/^\s+|\s+$/g,'');
|
93
|
+
};
|
104
94
|
}
|
105
95
|
")
|
106
96
|
end
|
107
|
-
|
97
|
+
|
108
98
|
end
|
109
99
|
end
|
110
100
|
end
|
@@ -14,7 +14,7 @@ module Less
|
|
14
14
|
def self.instance
|
15
15
|
return new
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
def initialize(globals = nil)
|
19
19
|
lock do
|
20
20
|
@v8_context = V8::Context.new
|
@@ -25,7 +25,7 @@ module Less
|
|
25
25
|
def unwrap
|
26
26
|
@v8_context
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
def exec(&block)
|
30
30
|
lock(&block)
|
31
31
|
end
|
@@ -53,9 +53,9 @@ module Less
|
|
53
53
|
super
|
54
54
|
end
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
private
|
58
|
-
|
58
|
+
|
59
59
|
def lock(&block)
|
60
60
|
do_lock(&block)
|
61
61
|
rescue V8::JSError => e
|
@@ -63,26 +63,26 @@ module Less
|
|
63
63
|
js_value = e.value.respond_to?(:'[]')
|
64
64
|
name = js_value && e.value["name"]
|
65
65
|
constructor = js_value && e.value['constructor']
|
66
|
-
if name == "SyntaxError" ||
|
66
|
+
if name == "SyntaxError" ||
|
67
67
|
( constructor && constructor.name == "LessError" )
|
68
68
|
raise Less::ParseError.new(e, js_value ? e.value : nil)
|
69
69
|
end
|
70
70
|
# NOTE: less/parser.js :
|
71
|
-
#
|
71
|
+
#
|
72
72
|
# error = new(LessError)({
|
73
73
|
# index: i,
|
74
74
|
# type: 'Parse',
|
75
75
|
# message: "missing closing `}`",
|
76
76
|
# filename: env.filename
|
77
77
|
# }, env);
|
78
|
-
#
|
78
|
+
#
|
79
79
|
# comes back as value: RuntimeError !
|
80
|
-
elsif e.value.to_s
|
80
|
+
elsif e.value.to_s =~ /missing opening `\(`/
|
81
81
|
raise Less::ParseError.new(e.value.to_s)
|
82
82
|
end
|
83
83
|
raise Less::Error.new(e)
|
84
84
|
end
|
85
|
-
|
85
|
+
|
86
86
|
def do_lock
|
87
87
|
result, exception = nil, nil
|
88
88
|
V8::C::Locker() do
|
@@ -99,7 +99,7 @@ module Less
|
|
99
99
|
result
|
100
100
|
end
|
101
101
|
end
|
102
|
-
|
102
|
+
|
103
103
|
end
|
104
104
|
end
|
105
|
-
end
|
105
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# OS and IDE
|
2
|
+
.emacs*
|
3
|
+
*.flymake
|
4
|
+
*~
|
5
|
+
.#*
|
6
|
+
.idea
|
7
|
+
*.sublime-*
|
8
|
+
|
9
|
+
# npm
|
10
|
+
node_modules
|
11
|
+
npm-debug.log
|
12
|
+
|
13
|
+
# project-specific
|
14
|
+
tmp
|
15
|
+
test/browser/less.js
|
16
|
+
test/sourcemaps/*.map
|
17
|
+
test/sourcemaps/*.css
|
18
|
+
|
19
|
+
# grunt
|
20
|
+
.grunt
|
21
|
+
|
22
|
+
# gradle
|
23
|
+
.gradle
|
24
|
+
out
|
@@ -0,0 +1 @@
|
|
1
|
+
.gitattributes
|