less / more

less on rails — the official LESS plugin for Ruby on Rails
http://lesscss.org
MIT License
226 stars 41 forks source link

Ruby 1.9.1 path gsub wants regexp #22

Closed kayleg closed 14 years ago

kayleg commented 14 years ago

Ruby looking for a regexp in the gsub method

At line 126:

destination_dir = source.dirname.to_s.gsub(source_path, cache_path) destination = File.join(destination_dir, source.basename.to_s.gsub('.less', '.css').gsub('.lss', '.css'))

needs to be destination_dir = source.dirname.to_s.gsub(/#{source_path}/, cache_path) destination = File.join(destination_dir, source.basename.to_s.gsub(/.less/, '.css').gsub(/.lss/, '.css'))

augustl commented 14 years ago

String#gsub takes a string as both arguments. In what case does it help that it is a regexp and not a string?

kayleg commented 14 years ago

There is no case that I know of, just that there was a server error reporting that a regexp was expected when running on Ruby 1.9.1, until the above changes were made.

augustl commented 14 years ago

Can you write a test and possibly a fix? I'm unable to reproduce it.

grosser commented 14 years ago

tests pass on 1.9.1, can be closed afaik

augustl commented 14 years ago

Goodie :)