lib/checkm/entry.rb in checkm-0.1.0 vs lib/checkm/entry.rb in checkm-0.1.1
- old
+ new
@@ -5,12 +5,10 @@
return file_or_path if file_or_path.is_a? Entry
options = args.delete(:options) || {}
path = options[:path] || Dir.pwd
- return Checkm::Entry.new(file_or_path, options) if file_or_path.is_a? Array or file_or_path.is_a? Hash
-
file = file_or_path if file.is_a? File
file ||= File.open(File.expand_path(file_or_path, path))
args[:sourcefileorurl] = File.expand_path(file.path).gsub(path + "/", '') if file.respond_to? :path
args[:alg] ||= 'md5'
@@ -20,9 +18,10 @@
Checkm::Entry.new(args, options)
end
attr_reader :values
+ attr_reader :fields
def initialize source, options = {}
@fields = options[:fields] || Manifest::BASE_FIELDS
@path = options[:path]
@path ||= Dir.pwd