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 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.1"
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
- @@last_result = %x[#{command} 2>&1]
18
+ result = %x[#{command} 2>&1]
19
19
  while not $?.exited? do
20
20
  end
21
- @@results << {
21
+
22
+ @@last_result = {
22
23
  :command => command,
23
- :result => @@last_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, command)
34
+ raise ShellCommandFailure.new(@@last_result)
33
35
  else
34
- @@error_proc.call(@@last_result, command)
36
+ @@error_proc.call(@@last_result)
35
37
  end
36
38
  return false
37
39
  end
@@ -1,7 +1,6 @@
1
1
  class ShellCommandFailure < StandardError
2
- attr_accessor :result, :command
3
- def initialize(result, command)
2
+ attr_accessor :result
3
+ def initialize(result)
4
4
  @result = result
5
- @command = command
6
5
  end
7
6
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "shell_commands"
8
- s.version = "1.0.1"
8
+ s.version = "1.1.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["phildebus"]
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.1
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: -364707441
128
+ hash: 465872943
129
129
  required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  none: false
131
131
  requirements: