Skip to content
This repository was archived by the owner on Oct 31, 2023. It is now read-only.

Commit def7a17

Browse files
committed
make this place livable!
1 parent a4a945c commit def7a17

File tree

4 files changed

+105
-0
lines changed

4 files changed

+105
-0
lines changed

CHANGELOG.rdoc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
=== (unreleased)
2+
3+
* Initial release

Manifest

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CHANGELOG.rdoc
2+
lib/net/ssh/shell/process.rb
3+
lib/net/ssh/shell/subshell.rb
4+
lib/net/ssh/shell/version.rb
5+
lib/net/ssh/shell.rb
6+
Rakefile
7+
README.rdoc
8+
Manifest

README.rdoc

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
= Net::SSH::Shell
2+
3+
== DESCRIPTION:
4+
5+
Net::SSH::Shell is a library for interacting with stateful (e.g., interactive) shells on remote hosts. It hides (or tries to hide) the potentially complex Net::SSH state machines you'd otherwise need to write to interact with "su" and similar shells.
6+
7+
One of the significant benefits you get from this library versus using Net::SSH directly is that your shell is _stateful_. With Net::SSH, if you invoke "cd /" in one exec call, and "pwd" in another, the two are done in different shells so the directory change in the first has no effect on the working directory of the second. With Net::SSH::Shell, though, commands are all invoked via the _same_ shell, so changes in directory or additions to the environment all affect subsequent commands.
8+
9+
== FEATURES:
10+
11+
* Interact with login shells
12+
* Support for "subshell" environments, like "su" or "sudo bash"
13+
14+
== SYNOPSIS:
15+
16+
In a nutshell:
17+
18+
require 'net/ssh/shell'
19+
20+
Net::SSH::Start('host', 'user') do |ssh|
21+
ssh.shell do |sh|
22+
sh.execute "cd /usr/local"
23+
sh.execute "pwd"
24+
sh.execute "export FOO=bar"
25+
sh.execute "echo $FOO"
26+
end
27+
end
28+
29+
See Net::SSH::Shell for more documentation.
30+
31+
== REQUIREMENTS:
32+
33+
* net-ssh (version 2)
34+
35+
If you want to use any of the Rake tasks, you'll need:
36+
37+
* Echoe (for the Rakefile)
38+
39+
== INSTALL:
40+
41+
* gem install net-ssh-shell (might need sudo privileges)
42+
43+
== LICENSE:
44+
45+
(The MIT License)
46+
47+
Copyright (c) 2009 Jamis Buck <jamis@37signals.com>
48+
49+
Permission is hereby granted, free of charge, to any person obtaining
50+
a copy of this software and associated documentation files (the
51+
'Software'), to deal in the Software without restriction, including
52+
without limitation the rights to use, copy, modify, merge, publish,
53+
distribute, sublicense, and/or sell copies of the Software, and to
54+
permit persons to whom the Software is furnished to do so, subject to
55+
the following conditions:
56+
57+
The above copyright notice and this permission notice shall be
58+
included in all copies or substantial portions of the Software.
59+
60+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
61+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
62+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
63+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
64+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
65+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
66+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Rakefile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
require './lib/net/ssh/shell/version'
2+
3+
begin
4+
require 'echoe'
5+
rescue LoadError
6+
abort "You'll need to have `echoe' installed to use Net::SSH::Shell's Rakefile"
7+
end
8+
9+
version = Net::SSH::Shell::Version::STRING.dup
10+
if ENV['SNAPSHOT'].to_i == 1
11+
version << "." << Time.now.utc.strftime("%Y%m%d%H%M%S")
12+
end
13+
14+
Echoe.new('net-ssh-shell', version) do |p|
15+
p.changelog = "CHANGELOG.rdoc"
16+
17+
p.author = "Jamis Buck"
18+
p.email = "jamis@jamisbuck.org"
19+
p.summary = "A simple library to aid with stateful shell interactions"
20+
p.url = "http://net-ssh.rubyforge.org/shell"
21+
22+
p.dependencies = ["net-ssh >=2.0.9"]
23+
24+
p.need_zip = true
25+
p.include_rakefile = true
26+
27+
p.rdoc_pattern = /^(lib|README.rdoc|CHANGELOG.rdoc)/
28+
end

0 commit comments

Comments
 (0)