Permalink
Browse files

Disable less support for sass-convert.

Closes #122
  • Loading branch information...
1 parent 0bba15c commit 0db3cb6c69625af872dc39f2694ba1017516c2bb @nex3 nex3 committed Jul 20, 2012
Showing with 7 additions and 1,151 deletions.
  1. +0 −1 Rakefile
  2. +2 −0 doc-src/SASS_CHANGELOG.md
  3. +4 −20 lib/sass/exec.rb
  4. +0 −382 lib/sass/less.rb
  5. +1 −2 test/.bundle/config
  6. +0 −1 test/Gemfile
  7. +0 −9 test/Gemfile.lock
  8. +0 −736 test/sass/less_conversion_test.rb
View
@@ -194,7 +194,6 @@ OPTS
t.files = FileList.new(scope('lib/**/*.rb')) do |list|
list.exclude('lib/sass/plugin/merb.rb')
list.exclude('lib/sass/plugin/rails.rb')
- list.exclude('lib/sass/less.rb')
end.to_a
t.options << '--incremental' if Rake.application.top_level_tasks.include?('redoc')
t.options += FileList.new(scope('yard/*.rb')).to_a.map {|f| ['-e', f]}.flatten
@@ -175,6 +175,8 @@ This will not print a warning.
* `#{}` interpolation is now disallowed in all `@import` statements
except for those using `url()`.
+* `sass-convert` no longer supports converting files from LessCSS.
+
## 3.1.21 (Unreleased)
* Preserve single-line comments that are embedded within multi-line comments.
View
@@ -490,14 +490,14 @@ def set_opts(opts)
END
opts.on('-F', '--from FORMAT',
- 'The format to convert from. Can be css, scss, sass, less.',
+ 'The format to convert from. Can be css, scss, sass.',
'By default, this is inferred from the input filename.',
'If there is none, defaults to css.') do |name|
@options[:from] = name.downcase.to_sym
- unless [:css, :scss, :sass, :less].include?(@options[:from])
+ raise "sass-convert no longer supports LessCSS." if @options[:from] == :less
+ unless [:css, :scss, :sass].include?(@options[:from])
raise "Unknown format for sass-convert --from: #{name}"
end
- try_less_note if @options[:from] == :less
end
opts.on('-T', '--to FORMAT',
@@ -630,7 +630,7 @@ def process_file(input, output)
case input.path
when /\.scss$/; :scss
when /\.sass$/; :sass
- when /\.less$/; :less
+ when /\.less$/; raise "sass-convert no longer supports LessCSS."
when /\.css$/; :css
end
elsif @options[:in_place]
@@ -654,11 +654,6 @@ def process_file(input, output)
if @options[:from] == :css
require 'sass/css'
::Sass::CSS.new(input.read, @options[:for_tree]).render(@options[:to])
- elsif @options[:from] == :less
- require 'sass/less'
- try_less_note
- input = input.read if input.is_a?(IO) && !input.is_a?(File) # Less is dumb
- Less::Engine.new(input).to_tree.to_sass_tree.send("to_#{@options[:to]}", @options[:for_tree])
else
if input.is_a?(File)
::Sass::Engine.for_file(input.path, @options[:for_engine])
@@ -677,17 +672,6 @@ def process_file(input, output)
rescue LoadError => err
handle_load_error(err)
end
-
- @@less_note_printed = false
- def try_less_note
- return if @@less_note_printed
- @@less_note_printed = true
- warn <<NOTE
-* NOTE: Sass and Less are different languages, and they work differently.
-* I'll do my best to translate, but some features -- especially mixins --
-* should be checked by hand.
-NOTE
- end
end
end
end
Oops, something went wrong.

0 comments on commit 0db3cb6

Please sign in to comment.