lib/ffprober/parsers/file.rb in ffprober-0.5.1 vs lib/ffprober/parsers/file.rb in ffprober-0.5.2
- old
+ new
@@ -1,18 +1,20 @@
+# frozen_string_literal: true
+
module Ffprober
module Parsers
- class File
- def initialize(file_to_parse, exec=Ffprober::Ffmpeg::Exec.new)
+ class FileParser
+ def initialize(file_to_parse, exec = Ffprober::Ffmpeg::Exec.new)
unless ::File.exist?(file_to_parse)
- fail ArgumentError.new("File not found #{file_to_parse}")
+ raise ArgumentError, "File not found #{file_to_parse}"
end
@file_to_parse = file_to_parse
@exec = exec
end
def load
- Ffprober::Parsers::Json.new(@exec.json_output(@file_to_parse))
+ JsonParser.new(@exec.json_output(@file_to_parse))
end
end
end
end