Skip to content

Commit

Permalink
Simple, faster, dumber absolute? check
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Oct 11, 2011
1 parent ed4b14a commit b0013a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/sprockets/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/sprockets/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit b0013a4

Please sign in to comment.