lib/roadie/filesystem_provider.rb in roadie-4.0.0 vs lib/roadie/filesystem_provider.rb in roadie-5.0.0

- old
+ new

@@ -30,17 +30,27 @@ file_path = build_file_path(name) if File.exist? file_path Stylesheet.new file_path, File.read(file_path) else basename = File.basename file_path - raise CssNotFound.new(basename, %{#{file_path} does not exist. (Original name was "#{name}")}, self) + raise CssNotFound.new( + css_name: basename, + message: %{#{file_path} does not exist. (Original name was "#{name}")}, + provider: self + ) end end - def to_s() inspect end - def inspect() "#<#{self.class} #@path>" end + def to_s + inspect + end + def inspect + "#<#{self.class} #{@path}>" + end + private + def build_file_path(name) raise InsecurePathError, name if name.include?("..") File.join(@path, name[/^([^?]+)/]) end end