net-ssh-simple 1.5.4 → 1.5.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -13
- data/lib/net/ssh/simple.rb +27 -7
- data/lib/net/ssh/simple/version.rb +1 -1
- data/net-ssh-simple.gemspec +1 -1
- data/spec/net-ssh-simple.rb +3 -1
- metadata +18 -18
data/Rakefile
CHANGED
@@ -7,25 +7,14 @@ task :default => :test
|
|
7
7
|
|
8
8
|
RSpec::Core::RakeTask.new("test:spec") do |t|
|
9
9
|
t.pattern = 'spec/*.rb'
|
10
|
-
t.
|
11
|
-
t.rspec_opts = '-b -c -f progress --tag ~benchmark'
|
10
|
+
t.rspec_opts = '--fail-fast -b -c -f progress --tag ~benchmark'
|
12
11
|
end
|
13
12
|
|
14
13
|
RSpec::Core::RakeTask.new("test:benchmark") do |t|
|
15
14
|
t.pattern = 'spec/*.rb'
|
16
|
-
t.rcov = false
|
17
15
|
t.rspec_opts = '-b -c -f documentation --tag benchmark'
|
18
16
|
end
|
19
17
|
|
20
|
-
|
21
|
-
namespace :test do
|
22
|
-
task :coverage do
|
23
|
-
require 'cover_me'
|
24
|
-
CoverMe.complete!
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
18
|
desc 'Run full test suite'
|
29
|
-
task :test => [ 'test:spec'
|
30
|
-
|
19
|
+
task :test => [ 'test:spec' ]
|
31
20
|
|
data/lib/net/ssh/simple.rb
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
require 'net/ssh/simple/version'
|
24
24
|
require 'blockenspiel'
|
25
|
-
require 'hashie'
|
25
|
+
require 'hashie/dash'
|
26
26
|
require 'timeout'
|
27
27
|
require 'net/ssh'
|
28
28
|
require 'net/scp'
|
@@ -598,7 +598,7 @@ module Net
|
|
598
598
|
|
599
599
|
|
600
600
|
private
|
601
|
-
EXTRA_OPTS = [:operation_timeout, :close_timeout, :keepalive_interval]
|
601
|
+
EXTRA_OPTS = [:operation_timeout, :close_timeout, :keepalive_interval, :scp_src, :scp_dst]
|
602
602
|
|
603
603
|
def with_session(host, opts={}, &block)
|
604
604
|
opts[:timeout] ||= 60
|
@@ -641,15 +641,15 @@ module Net
|
|
641
641
|
end
|
642
642
|
|
643
643
|
def scp(mode, host, src, dst, opts={}, &block)
|
644
|
+
opts[:scp_src] = src
|
645
|
+
opts[:scp_dst] = dst
|
644
646
|
@result = Result.new(
|
645
647
|
{ :op => :scp, :host => host, :opts => opts, :cmd => :scp_dl,
|
646
|
-
:last_event_at => Time.new, :start_at => Time.new,
|
647
|
-
:src => src, :dst => dst, :success => false
|
648
|
+
:last_event_at => Time.new, :start_at => Time.new, :success => false
|
648
649
|
} )
|
649
650
|
with_session(host, opts) do |session|
|
650
651
|
lt = 0
|
651
652
|
channel = session.scp.send(mode, src, dst) do |ch, name, sent, total|
|
652
|
-
@result[:name] ||= name
|
653
653
|
@result[:total] ||= total
|
654
654
|
@result[:sent] = sent
|
655
655
|
@result[:last_event_at] = Time.new
|
@@ -679,7 +679,7 @@ module Net
|
|
679
679
|
end
|
680
680
|
|
681
681
|
def to_s
|
682
|
-
"#{
|
682
|
+
"#{@wrapped} @ #{@result}"
|
683
683
|
end
|
684
684
|
end
|
685
685
|
|
@@ -700,10 +700,30 @@ module Net
|
|
700
700
|
# @attr [String] exit_code UNIX exit code (SSH only)
|
701
701
|
# @attr [Integer] total Size of requested file (in bytes, SCP only)
|
702
702
|
# @attr [Integer] sent Number of bytes transferred (SCP only)
|
703
|
+
# @attr [Hash] opts The options that the operation was parametrized with
|
704
|
+
# @attr [Exception] exception Exception that occurred during this operation (if any)
|
703
705
|
# @attr [String] exit_signal
|
704
706
|
# Only present if the remote command terminated due to a signal (SSH only)
|
705
707
|
#
|
706
|
-
class Result < Hashie::
|
708
|
+
class Result < Hashie::Dash
|
709
|
+
property :host
|
710
|
+
property :op
|
711
|
+
property :cmd
|
712
|
+
property :start_at
|
713
|
+
property :finish_at
|
714
|
+
property :last_keepalive_at
|
715
|
+
property :last_event_at
|
716
|
+
property :timed_out
|
717
|
+
property :stdout, :default => ''
|
718
|
+
property :stderr, :default => ''
|
719
|
+
property :success, :default => false
|
720
|
+
property :exit_code
|
721
|
+
property :total
|
722
|
+
property :sent
|
723
|
+
property :opts
|
724
|
+
property :exception
|
725
|
+
property :exit_signal
|
726
|
+
end
|
707
727
|
end
|
708
728
|
end
|
709
729
|
end
|
data/net-ssh-simple.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
|
21
21
|
s.add_development_dependency "rake", "~> 0.9.2.2"
|
22
22
|
s.add_development_dependency "rspec"
|
23
|
-
s.add_development_dependency "
|
23
|
+
s.add_development_dependency "simplecov"
|
24
24
|
|
25
25
|
s.files = `git ls-files`.split("\n")
|
26
26
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/spec/net-ssh-simple.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-ssh-simple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-10-09 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: net-ssh
|
16
|
-
requirement: &
|
16
|
+
requirement: &15723220 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.2.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *15723220
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: net-scp
|
27
|
-
requirement: &
|
27
|
+
requirement: &15722740 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.0.4
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *15722740
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: blockenspiel
|
38
|
-
requirement: &
|
38
|
+
requirement: &15722260 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.4.3
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *15722260
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: hashie
|
49
|
-
requirement: &
|
49
|
+
requirement: &15721660 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.1.0
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *15721660
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rake
|
60
|
-
requirement: &
|
60
|
+
requirement: &15721200 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.9.2.2
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *15721200
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rspec
|
71
|
-
requirement: &
|
71
|
+
requirement: &15720820 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *15720820
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
|
-
name:
|
82
|
-
requirement: &
|
81
|
+
name: simplecov
|
82
|
+
requirement: &15720220 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,7 +87,7 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *15720220
|
91
91
|
description: Net::SSH::Simple is a simple wrapper around Net::SSH and Net::SCP.
|
92
92
|
email:
|
93
93
|
- moe@busyloop.net
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
version: '0'
|
124
124
|
segments:
|
125
125
|
- 0
|
126
|
-
hash:
|
126
|
+
hash: 3891783157923390254
|
127
127
|
requirements: []
|
128
128
|
rubyforge_project:
|
129
129
|
rubygems_version: 1.8.10
|