ratchetcat-commander 1.0.3 → 1.0.5
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/History.txt +4 -0
- data/License.txt +1 -1
- data/Manifest.txt +2 -0
- data/{README.txt → README.rdoc} +3 -0
- data/config/hoe.rb +1 -1
- data/lib/commander.rb +9 -11
- data/test/test_commander.rb +0 -0
- metadata +5 -5
data/History.txt
CHANGED
data/License.txt
CHANGED
data/Manifest.txt
CHANGED
@@ -2,6 +2,7 @@ History.txt
|
|
2
2
|
License.txt
|
3
3
|
Manifest.txt
|
4
4
|
PostInstall.txt
|
5
|
+
README.rdoc
|
5
6
|
README.txt
|
6
7
|
Rakefile
|
7
8
|
commander.gemspec
|
@@ -17,6 +18,7 @@ tasks/deployment.rake
|
|
17
18
|
tasks/environment.rake
|
18
19
|
tasks/website.rake
|
19
20
|
test/test_commander.rb
|
21
|
+
test/test_commander_revised.rb
|
20
22
|
test/test_github_environment.rb
|
21
23
|
test/test_helper.rb
|
22
24
|
website/index.html
|
data/{README.txt → README.rdoc}
RENAMED
@@ -17,6 +17,9 @@ Commander uses the open4 gem and the ruby logger to accomplish these tasks.
|
|
17
17
|
Commander was originally intended for use in rake tasks launching multiple system commands. Program flow was varied based on the exit status or source of the output from these commands and Commander includes some convenience methods for handling such situations.
|
18
18
|
|
19
19
|
Setup:
|
20
|
+
|
21
|
+
require 'rubygems'
|
22
|
+
require 'commander'
|
20
23
|
|
21
24
|
log = Logger.new( STDOUT )
|
22
25
|
log.level = Logger::Warn
|
data/config/hoe.rb
CHANGED
@@ -38,7 +38,7 @@ VERS = Commander::VERSION::STRING + (REV ? ".#{REV}" : "")
|
|
38
38
|
RDOC_OPTS = ['--quiet', '--title', 'commander documentation',
|
39
39
|
"--opname", "index.html",
|
40
40
|
"--line-numbers",
|
41
|
-
"--main", "README",
|
41
|
+
"--main", "README.rdoc",
|
42
42
|
"--inline-source"]
|
43
43
|
|
44
44
|
class Hoe
|
data/lib/commander.rb
CHANGED
@@ -1,15 +1,13 @@
|
|
1
|
-
$:.unshift(File.dirname(__FILE__)) unless
|
2
|
-
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
|
3
|
-
|
4
1
|
require 'rubygems'
|
5
2
|
require 'open4'
|
3
|
+
require 'logger'
|
6
4
|
|
7
5
|
class Commander
|
8
6
|
|
9
7
|
module VERSION #:nodoc:
|
10
8
|
MAJOR = 1
|
11
9
|
MINOR = 0
|
12
|
-
TINY =
|
10
|
+
TINY = 5
|
13
11
|
|
14
12
|
STRING = [MAJOR, MINOR, TINY].join('.')
|
15
13
|
end
|
@@ -48,6 +46,12 @@ class Commander
|
|
48
46
|
end
|
49
47
|
end
|
50
48
|
|
49
|
+
class MockStatus
|
50
|
+
def exitstatus
|
51
|
+
1
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
51
55
|
attr_accessor :commands, :exit_status, :log
|
52
56
|
|
53
57
|
def initialize( logger )
|
@@ -73,13 +77,7 @@ class Commander
|
|
73
77
|
stderr_array = stderr.readlines
|
74
78
|
rescue Exception => err
|
75
79
|
# set status.exitstatus to 1 due to failure
|
76
|
-
status =
|
77
|
-
status.instance_eval do
|
78
|
-
def exitstatus
|
79
|
-
1
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
80
|
+
status = MockStatus.new()
|
83
81
|
stdout_array = []
|
84
82
|
stderr_array = [ err ]
|
85
83
|
end
|
data/test/test_commander.rb
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ratchetcat-commander
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Fuller
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
@@ -33,14 +33,14 @@ extra_rdoc_files:
|
|
33
33
|
- License.txt
|
34
34
|
- Manifest.txt
|
35
35
|
- PostInstall.txt
|
36
|
-
- README.
|
36
|
+
- README.rdoc
|
37
37
|
- website/index.txt
|
38
38
|
files:
|
39
39
|
- History.txt
|
40
40
|
- License.txt
|
41
41
|
- Manifest.txt
|
42
42
|
- PostInstall.txt
|
43
|
-
- README.
|
43
|
+
- README.rdoc
|
44
44
|
- Rakefile
|
45
45
|
- config/hoe.rb
|
46
46
|
- config/requirements.rb
|
@@ -65,7 +65,7 @@ homepage: http://github.com/ratchetcat/commander
|
|
65
65
|
post_install_message: ""
|
66
66
|
rdoc_options:
|
67
67
|
- --main
|
68
|
-
- README.
|
68
|
+
- README.rdoc
|
69
69
|
require_paths:
|
70
70
|
- lib
|
71
71
|
required_ruby_version: !ruby/object:Gem::Requirement
|