Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a useful save! method.

  • Loading branch information...
commit 2c012c02f89ab5101b73946a6511c1d7f1eed357 1 parent c19eb37
@wilg wilg authored committed
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/mini_exiftool.rb
View
10 lib/mini_exiftool.rb
@@ -184,6 +184,16 @@ def save
all_ok
end
+ def save!
+ unless save
+ err = []
+ self.errors.each do |key, value|
+ err << "(#{key}) #{value}"
+ end
+ raise "MiniExiftool couldn't save. The following errors occurred: #{err.empty? ? "None" : err.join(", ")}"
+ end
+ end
+
# Returns a hash of the original loaded values of the MiniExiftool
# instance.
def to_hash
Please sign in to comment.
Something went wrong with that request. Please try again.