dancroak-webster 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/webster.rb +0 -2
- metadata +1 -2
- data/lib/open_safely.rb +0 -15
data/VERSION.yml
CHANGED
data/lib/webster.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dancroak-webster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dan Croak
|
@@ -25,7 +25,6 @@ files:
|
|
25
25
|
- Rakefile
|
26
26
|
- README.textile
|
27
27
|
- VERSION.yml
|
28
|
-
- lib/open_safely.rb
|
29
28
|
- lib/webster.rb
|
30
29
|
- lib/words
|
31
30
|
- test/webster_test.rb
|
data/lib/open_safely.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
require 'tempfile'
|
3
|
-
|
4
|
-
class File
|
5
|
-
def File.open_safely(path)
|
6
|
-
result, temp_path = nil, nil
|
7
|
-
Tempfile.open("#{$0}-#{path.hash}") do |file|
|
8
|
-
result = yield file
|
9
|
-
temp_path = file.path
|
10
|
-
end
|
11
|
-
FileUtils.move temp_path, path
|
12
|
-
result
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|