Permalink
Browse files

Simple, faster, dumber absolute? check

  • Loading branch information...
1 parent ed4b14a commit b0013a4e20d7879f19e7f9c009166788fdbf4a6b @josh josh committed Oct 11, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/sprockets/base.rb
  2. +1 −1 lib/sprockets/context.rb
@@ -149,7 +149,7 @@ def find_asset(path, options = {})
logical_path = path
pathname = Pathname.new(path)
- if pathname.absolute?
+ if pathname.to_s =~ /^\//
return unless stat(pathname)
logical_path = attributes_for(pathname).logical_path
else
@@ -78,7 +78,7 @@ def resolve(path, options = {}, &block)
pathname = Pathname.new(path)
attributes = environment.attributes_for(pathname)
- if pathname.absolute?
+ if pathname.to_s =~ /^\//
pathname
elsif content_type = options[:content_type]

3 comments on commit b0013a4

@jonleighton

This is not cross-platform, and has caused a bug with using Rails 3.1.2 on Windows: rails/rails#3679

@josh
Contributor
josh commented on b0013a4 Nov 18, 2011

Fucking C: drives. I'll revert this.

@jonleighton

Can you do a 2.1.1 point release please? Rails 3.1.2 depends on sprockets 2.1.X. Thanks.

Please sign in to comment.