lib/har/archive.rb in har-0.0.2 vs lib/har/archive.rb in har-0.0.3
- old
+ new
@@ -8,9 +8,22 @@
def self.from_file(path)
from_string File.read(path), path
end
+ def self.by_merging(hars)
+ hars = hars.dup
+
+ result = hars.shift
+ result = from_file(result) unless result.kind_of? self
+
+ hars.each do |har|
+ result.merge! har.kind_of?(self) ? har : from_file(har)
+ end
+
+ result
+ end
+
attr_reader :uri
def initialize(input, uri = nil)
@data = input
@uri = uri