Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Sprockets ERB support #11

Merged
merged 1 commit into from

2 participants

@sandrew

No description provided.

@pferdefleisch pferdefleisch merged commit 6187d3a into from
@pferdefleisch

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 23, 2013
  1. @sandrew

    ERB support

    sandrew authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +1 −1  lib/guard/sprockets.rb
  2. +4 −0 spec/guard/sprockets_spec.rb
View
2  lib/guard/sprockets.rb
@@ -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
View
4 spec/guard/sprockets_spec.rb
@@ -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
Something went wrong with that request. Please try again.