diff --git a/lib/sprockets/base.rb b/lib/sprockets/base.rb index a5cfc24ae..bf94d6602 100644 --- a/lib/sprockets/base.rb +++ b/lib/sprockets/base.rb @@ -149,7 +149,7 @@ def find_asset(path, options = {}) logical_path = path pathname = Pathname.new(path) - if pathname.to_s =~ /^\// + if pathname.absolute? return unless stat(pathname) logical_path = attributes_for(pathname).logical_path else diff --git a/lib/sprockets/context.rb b/lib/sprockets/context.rb index 7e6034545..1b5cbc9e2 100644 --- a/lib/sprockets/context.rb +++ b/lib/sprockets/context.rb @@ -78,7 +78,7 @@ def resolve(path, options = {}, &block) pathname = Pathname.new(path) attributes = environment.attributes_for(pathname) - if pathname.to_s =~ /^\// + if pathname.absolute? pathname elsif content_type = options[:content_type]