rogerdpack-sane 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/sane.rb +8 -2
- metadata +1 -1
data/lib/sane.rb
CHANGED
@@ -12,7 +12,7 @@ class File
|
|
12
12
|
# CREDIT: facets/Gavin Sinclair
|
13
13
|
|
14
14
|
def self.write(path, data)
|
15
|
-
File.open(path, "
|
15
|
+
File.open(path, "w") do |file|
|
16
16
|
return file.write(data)
|
17
17
|
end
|
18
18
|
end unless self.respond_to?(:write)
|
@@ -23,6 +23,12 @@ class File
|
|
23
23
|
end
|
24
24
|
end unless self.respond_to?(:binread)
|
25
25
|
|
26
|
+
def self.binwrite(path, data)
|
27
|
+
File.open(path, "wb") do |file|
|
28
|
+
return file.write(data)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
26
32
|
end
|
27
33
|
|
28
34
|
class Object
|
@@ -61,7 +67,7 @@ class Object
|
|
61
67
|
puts
|
62
68
|
end
|
63
69
|
|
64
|
-
def
|
70
|
+
def alias_h hash
|
65
71
|
hash.each_pair {|new, old|
|
66
72
|
alias_method new, old
|
67
73
|
}
|