Sprockets ERB support #11

Merged
merged 1 commit into from May 2, 2013
Jump to file or symbol
Failed to load files and symbols.
+5 −1
Diff settings

Always

Just for now

View
@@ -81,7 +81,7 @@ def sprocketize(path)
end
def without_preprocessor_extension(filename)
- filename.gsub(/^(.*\.(?:js|css))\.[^.]+$/, '\1')
+ filename.gsub(/^(.*\.(?:js|css))\.[^.]+(\.erb)?$/, '\1')
end
end
end
@@ -32,6 +32,10 @@
it { subject.send(:without_preprocessor_extension, 'foo.js.coffee').should eq 'foo.js' }
end
+ describe 'with ERB' do
+ it { subject.send(:without_preprocessor_extension, 'foo.js.coffee.erb').should eq 'foo.js' }
+ end
+
describe 'run_on_change' do
before do
subject.sprockets.should_receive(:[]).and_raise ExecJS::ProgramError