shell_commands 1.0.1 → 1.1.0
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/Rakefile +1 -1
- data/lib/shell_commands/shell_command.rb +7 -5
- data/lib/shell_commands/shell_command_failure.rb +2 -3
- data/shell_commands.gemspec +1 -1
- metadata +2 -2
data/Rakefile
CHANGED
@@ -15,7 +15,7 @@ require 'jeweler'
|
|
15
15
|
Jeweler::Tasks.new do |gem|
|
16
16
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
17
|
gem.name = "shell_commands"
|
18
|
-
gem.version = "1.0
|
18
|
+
gem.version = "1.1.0"
|
19
19
|
gem.homepage = "http://github.com/phildebus/shell_commands"
|
20
20
|
gem.license = "MIT"
|
21
21
|
gem.summary = %Q{Simple gem used to manage calling shell commands from ruby}
|
@@ -15,23 +15,25 @@ class ShellCommand
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def self.raw_do_command(command)
|
18
|
-
|
18
|
+
result = %x[#{command} 2>&1]
|
19
19
|
while not $?.exited? do
|
20
20
|
end
|
21
|
-
|
21
|
+
|
22
|
+
@@last_result = {
|
22
23
|
:command => command,
|
23
|
-
:result =>
|
24
|
+
:result => result,
|
24
25
|
:success => $?.success?
|
25
26
|
}
|
27
|
+
@@results << @@last_result
|
26
28
|
return $?.success?
|
27
29
|
end
|
28
30
|
|
29
31
|
def self.do_command(command)
|
30
32
|
if !raw_do_command(command)
|
31
33
|
if @@error_proc.nil?
|
32
|
-
raise ShellCommandFailure.new(@@last_result
|
34
|
+
raise ShellCommandFailure.new(@@last_result)
|
33
35
|
else
|
34
|
-
@@error_proc.call(@@last_result
|
36
|
+
@@error_proc.call(@@last_result)
|
35
37
|
end
|
36
38
|
return false
|
37
39
|
end
|
data/shell_commands.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shell_commands
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -125,7 +125,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
125
125
|
version: '0'
|
126
126
|
segments:
|
127
127
|
- 0
|
128
|
-
hash:
|
128
|
+
hash: 465872943
|
129
129
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
130
|
none: false
|
131
131
|
requirements:
|