screwcap 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/lib/screwcap/runner.rb +10 -14
- data/lib/screwcap.rb +1 -1
- data/screwcap.gemspec +1 -1
- data/tasks/rspec.rake +1 -0
- metadata +4 -4
data/Rakefile
CHANGED
@@ -11,7 +11,7 @@ Hoe.plugin :newgem
|
|
11
11
|
# Generate all the Rake tasks
|
12
12
|
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
13
13
|
$hoe = Hoe.spec 'screwcap' do
|
14
|
-
self.version = '0.6.
|
14
|
+
self.version = '0.6.2'
|
15
15
|
self.developer 'Grant Ammons', 'grant@pipelinedeals.com'
|
16
16
|
self.rubyforge_name = self.name # TODO this is default value
|
17
17
|
self.extra_deps = [['net-ssh','>= 2.0.23'],['net-ssh-gateway','>=1.0.1'], ['net-scp','>=1.0.4']]
|
data/lib/screwcap/runner.rb
CHANGED
@@ -5,7 +5,7 @@ class Runner
|
|
5
5
|
def self.execute! options
|
6
6
|
@@silent = options[:silent]
|
7
7
|
begin
|
8
|
-
_log "\
|
8
|
+
_log "\nExecuting task named #{options[:name]} on #{options[:server].name}..\n", :color => :blue
|
9
9
|
options[:server].__with_connection_for(options[:address]) do |ssh|
|
10
10
|
options[:commands].each do |command|
|
11
11
|
ret = run_command(command, ssh, options)
|
@@ -14,10 +14,8 @@ class Runner
|
|
14
14
|
end
|
15
15
|
rescue Net::SSH::AuthenticationFailed => e
|
16
16
|
raise Net::SSH::AuthenticationFailed, "Authentication failed for server named #{server.name}. Please check your authentication credentials."
|
17
|
-
#rescue Exception => e
|
18
|
-
# _errorlog " F: (#{options[:address]}): #{e}", :color => :red
|
19
17
|
ensure
|
20
|
-
_log "
|
18
|
+
_log "\nComplete\n", :color => :blue
|
21
19
|
end
|
22
20
|
options[:commands] # for tests
|
23
21
|
end
|
@@ -45,29 +43,27 @@ class Runner
|
|
45
43
|
|
46
44
|
def self.run_command(command, ssh, options)
|
47
45
|
if command[:type] == :remote
|
48
|
-
_log " I: (#{options[:address]}): #{command[:command]}\n", :color => :green
|
49
46
|
stdout, stderr, exit_code, exit_signal = ssh_exec! ssh, command[:command]
|
50
47
|
command[:stdout] = stdout
|
51
48
|
command[:stderr] = stderr
|
52
49
|
command[:exit_code] = exit_code
|
53
|
-
|
54
|
-
|
55
|
-
|
50
|
+
if exit_code == 0
|
51
|
+
_log(".", :color => :green)
|
52
|
+
else
|
53
|
+
_errorlog("\n E: (#{options[:address]}): #{command[:command]} return exit code: #{exit_code}\n", :color => :red) if exit_code != 0
|
54
|
+
end
|
56
55
|
return exit_code
|
57
56
|
elsif command[:type] == :local
|
58
57
|
ret = `#{command[:command]}`
|
59
58
|
command[:stdout] = ret
|
60
59
|
if $?.to_i == 0
|
61
|
-
_log
|
62
|
-
_log " O: (local): #{ret}\n", :color => :blue
|
60
|
+
_log(".", :color => :green)
|
63
61
|
else
|
64
|
-
|
65
|
-
_errorlog " O: (local): #{ret}\n", :color => :red
|
66
|
-
_errorlog(" E: (local): #{command[:command]} return exit code: #{$?}\n", :color => :red) if $? != 0
|
62
|
+
_errorlog("\n E: (local): #{command[:command]} return exit code: #{$?}\n", :color => :red) if $? != 0
|
67
63
|
end
|
68
64
|
return $?
|
69
65
|
elsif command[:type] == :scp
|
70
|
-
|
66
|
+
putc "."
|
71
67
|
options[:server].__upload_to!(options[:address], command[:local], command[:remote])
|
72
68
|
|
73
69
|
# this will need to be improved to allow for :onfailure
|
data/lib/screwcap.rb
CHANGED
data/screwcap.gemspec
CHANGED
data/tasks/rspec.rake
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: screwcap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 2
|
10
|
+
version: 0.6.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Grant Ammons
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-02-26 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|