lib/sane.rb in rogerdpack-sane-0.1.5 vs lib/sane.rb in rogerdpack-sane-0.1.6
- old
+ new
@@ -1,7 +1,7 @@
-require 'require_all' # require_all, require_rel gem
-require_rel 'enumerable-extra' # for #map(:symbol)
+require 'require_all' # require_all, require_rel
+require_rel 'sane_ruby' # for enumerable extra #map(:symbol)
# require 'facets/file' ===>
class File
# Writes the given data to the given path and closes the file. This is
@@ -15,12 +15,16 @@
File.open(path, "wb") do |file|
return file.write(data)
end
end unless self.respond_to?(:write)
-end
+ def self.binread(path)
+ File.open(path, "rb") do |file|
+ return file.read
+ end
+ end unless self.respond_to?(:binread)
-
+end
class Object
# a helper for collection.include?
def in? collection