frag 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -0
- data/lib/frag/app.rb +3 -1
- data/lib/frag/version.rb +1 -1
- data/test/unit/test_app.rb +10 -2
- metadata +3 -3
data/CHANGELOG
CHANGED
data/lib/frag/app.rb
CHANGED
@@ -120,7 +120,9 @@ module Frag
|
|
120
120
|
File.file?(input_path) or
|
121
121
|
return error "not a file: #{input_path}"
|
122
122
|
File.readable?(input_path) or
|
123
|
-
return error "cannot
|
123
|
+
return error "cannot read file: #{input_path}"
|
124
|
+
File.writable?(input_path) or
|
125
|
+
return error "cannot write file: #{input_path}"
|
124
126
|
tempfile = nil
|
125
127
|
success = nil
|
126
128
|
open(input_path) do |input|
|
data/lib/frag/version.rb
CHANGED
data/test/unit/test_app.rb
CHANGED
@@ -592,10 +592,18 @@ describe Frag::App do
|
|
592
592
|
|
593
593
|
it "prints an error if an input file is not readable" do
|
594
594
|
write_file 'input', ''
|
595
|
-
File.chmod
|
595
|
+
File.chmod 0300, 'input'
|
596
596
|
frag('input').must_equal 1
|
597
597
|
output.string.must_equal ''
|
598
|
-
error.string.must_match /cannot
|
598
|
+
error.string.must_match /cannot read file.*input/
|
599
|
+
end
|
600
|
+
|
601
|
+
it "prints an error if an input file is not writable" do
|
602
|
+
write_file 'input', ''
|
603
|
+
File.chmod 0500, 'input'
|
604
|
+
frag('input').must_equal 1
|
605
|
+
output.string.must_equal ''
|
606
|
+
error.string.must_match /cannot write file.*input/
|
599
607
|
end
|
600
608
|
|
601
609
|
it "prints an error if an input file is not a file" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: frag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -64,7 +64,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
64
64
|
version: '0'
|
65
65
|
segments:
|
66
66
|
- 0
|
67
|
-
hash: -
|
67
|
+
hash: -3732901048616748446
|
68
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
69
|
none: false
|
70
70
|
requirements:
|
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
73
|
version: '0'
|
74
74
|
segments:
|
75
75
|
- 0
|
76
|
-
hash: -
|
76
|
+
hash: -3732901048616748446
|
77
77
|
requirements: []
|
78
78
|
rubyforge_project:
|
79
79
|
rubygems_version: 1.8.24
|