sparehand 0.0.1

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.
@@ -0,0 +1,18 @@
1
+ require 'fileutils'
2
+
3
+ class << File
4
+ def safe_modify original
5
+ path = File.dirname(original)
6
+ temp_name = '.' + File.basename(original) + '.tmp'
7
+ temp_path = File.join(path, temp_name)
8
+
9
+ File.open(original) do |input|
10
+ File.open(temp_path, 'w') do |output|
11
+ yield input, output
12
+ end
13
+ end
14
+
15
+ File.delete original
16
+ File.rename temp_path, original
17
+ end
18
+ end
@@ -0,0 +1,9 @@
1
+ module Sparehand #:nodoc:
2
+ module VERSION #:nodoc:
3
+ MAJOR = 0
4
+ MINOR = 0
5
+ TINY = 1
6
+
7
+ STRING = [MAJOR, MINOR, TINY].join('.')
8
+ end
9
+ end