bovem 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -19
- data/Gemfile.lock +1 -1
- data/lib/bovem/shell.rb +2 -2
- data/lib/bovem/version.rb +1 -1
- data/spec/bovem/shell_spec.rb +4 -4
- metadata +3 -3
data/.gitignore
CHANGED
@@ -1,20 +1,6 @@
|
|
1
|
-
|
2
|
-
*.rbc
|
3
|
-
.bundle
|
4
|
-
.config
|
5
|
-
coverage
|
6
|
-
lib/bundler/man
|
7
|
-
pkg
|
8
|
-
rdoc
|
9
|
-
spec/reports
|
10
|
-
|
11
|
-
# YARD artifacts
|
12
|
-
.yardoc
|
13
|
-
_yardoc
|
14
|
-
doc/
|
15
|
-
|
16
|
-
# RubyMine
|
17
|
-
.idea/
|
18
|
-
|
19
|
-
# Misc
|
1
|
+
Gemfile.lock
|
20
2
|
tester.rb
|
3
|
+
coverage/
|
4
|
+
pkg/
|
5
|
+
.idea/
|
6
|
+
.yardoc/
|
data/Gemfile.lock
CHANGED
data/lib/bovem/shell.rb
CHANGED
@@ -47,7 +47,7 @@ module Bovem
|
|
47
47
|
output = ""
|
48
48
|
|
49
49
|
self.console.info("Running command: {mark=bright}\"#{command}\"{/mark}...") if show_command
|
50
|
-
rv[:status] = ::Open4::
|
50
|
+
rv[:status] = ::Open4::popen4(command + " 2>&1") { |pid, stdin, stdout, stderr|
|
51
51
|
stdout.each_line do |line|
|
52
52
|
output << line
|
53
53
|
Kernel.print line if show_output
|
@@ -192,7 +192,7 @@ module Bovem
|
|
192
192
|
|
193
193
|
# Do operation
|
194
194
|
begin
|
195
|
-
FileUtils.send(operation == :move ? :
|
195
|
+
FileUtils.send(operation == :move ? :mv : :cp_r, src, dst, {:noop => false, :verbose => false})
|
196
196
|
rescue Errno::EACCES => e
|
197
197
|
if single then
|
198
198
|
@console.send(fatal ? :fatal : :error, "Cannot #{operation} file {mark=bright}#{src}{/mark} to non writable directory {mark=bright}#{dst_dir}{/mark}.")
|
data/lib/bovem/version.rb
CHANGED
data/spec/bovem/shell_spec.rb
CHANGED
@@ -52,7 +52,7 @@ describe Bovem::Shell do
|
|
52
52
|
|
53
53
|
it "should only execute a command" do
|
54
54
|
shell.console.should_not_receive("warn").with("Will run command: {mark=bright}\"echo OK\"{/mark}...")
|
55
|
-
::Open4.should_receive("
|
55
|
+
::Open4.should_receive("popen4").and_return(::OpenStruct.new(:exitstatus => 0))
|
56
56
|
shell.run("echo OK", nil, true, false)
|
57
57
|
end
|
58
58
|
|
@@ -226,7 +226,7 @@ describe Bovem::Shell do
|
|
226
226
|
|
227
227
|
it "should only print the list of files" do
|
228
228
|
FileUtils.should_not_receive(:cp_r)
|
229
|
-
FileUtils.should_not_receive(:
|
229
|
+
FileUtils.should_not_receive(:mv)
|
230
230
|
|
231
231
|
shell.console.should_receive(:warn).with("Will copy a file:")
|
232
232
|
expect(shell.copy_or_move(temp_file_1, temp_file_2, :copy, false)).to be_true
|
@@ -251,7 +251,7 @@ describe Bovem::Shell do
|
|
251
251
|
|
252
252
|
it "should complain about other exceptions" do
|
253
253
|
FileUtils.stub(:cp_r).and_raise(ArgumentError.new("ERROR"))
|
254
|
-
FileUtils.stub(:
|
254
|
+
FileUtils.stub(:mv).and_raise(ArgumentError.new("ERROR"))
|
255
255
|
File.open(temp_file_1, "w") {|f| f.write("OK") }
|
256
256
|
|
257
257
|
shell.console.should_receive(:error).with("Cannot copy file {mark=bright}#{temp_file_1}{/mark} to directory {mark=bright}#{File.dirname(temp_file_2)}{/mark} due to this error: [ArgumentError] ERROR.", "\n", 5)
|
@@ -264,7 +264,7 @@ describe Bovem::Shell do
|
|
264
264
|
describe "should exit when requested to" do
|
265
265
|
it "by calling :fatal" do
|
266
266
|
FileUtils.stub(:cp_r).and_raise(ArgumentError.new("ERROR"))
|
267
|
-
FileUtils.stub(:
|
267
|
+
FileUtils.stub(:mv).and_raise(ArgumentError.new("ERROR"))
|
268
268
|
|
269
269
|
File.open(temp_file_1, "w") {|f| f.write("OK") }
|
270
270
|
File.open(temp_file_2, "w") {|f| f.write("OK") }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bovem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -197,7 +197,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
197
197
|
version: '0'
|
198
198
|
segments:
|
199
199
|
- 0
|
200
|
-
hash: -
|
200
|
+
hash: -540981394964215808
|
201
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
202
202
|
none: false
|
203
203
|
requirements:
|
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
version: '0'
|
207
207
|
segments:
|
208
208
|
- 0
|
209
|
-
hash: -
|
209
|
+
hash: -540981394964215808
|
210
210
|
requirements: []
|
211
211
|
rubyforge_project: bovem
|
212
212
|
rubygems_version: 1.8.24
|