xssh 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +53 -5
- data/lib/xssh.rb +3 -3
- data/lib/xssh/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13f403b0876bf28535c2803a75085316fc9a6f0467e1ff405aaa784e542fdfbf
|
4
|
+
data.tar.gz: 1e3c70a7cff14dbae2bb33d6b6bf4190b91d5e46969f0b826dec6f768d70fe89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b420a7c7b3beb097f287fdcc8502e1d9816390475167399fabd0870321bbe59b859a70ae7db005012ce2f99fb89f3b9f70ea9175f207da147c551466a086349
|
7
|
+
data.tar.gz: 33ae8da552274926565ee54f19c38a66a1691ab8ca02a4b0b74e2b70880d804211733d07129461b39e06016cfa53afea2f946b558a04155aabeab36ce52f99cd
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,5 @@
|
|
1
1
|
# Xssh
|
2
2
|
|
3
|
-
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/xssh`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
6
|
-
|
7
3
|
## Installation
|
8
4
|
|
9
5
|
Add this line to your application's Gemfile:
|
@@ -22,7 +18,59 @@ Or install it yourself as:
|
|
22
18
|
|
23
19
|
## Usage
|
24
20
|
|
25
|
-
|
21
|
+
```
|
22
|
+
|
23
|
+
require 'xssh'
|
24
|
+
|
25
|
+
Xssh.configure do
|
26
|
+
source "centos7 'exsample-server', 'ssh://vagrant:vagrant@localhost', port: 2222"
|
27
|
+
template(type: :centos7) do
|
28
|
+
bind(:iplist) do
|
29
|
+
cmd('ifconfig')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
s = Xssh.get('exsample-server', log: 'test.log')
|
36
|
+
|
37
|
+
puts s.cmd('ls')
|
38
|
+
puts s.cmd('hostname')
|
39
|
+
puts s.iplist
|
40
|
+
s.close
|
41
|
+
|
42
|
+
|
43
|
+
#=> ==== output ls ====
|
44
|
+
#=> ls
|
45
|
+
#=> [vagrant@exsample-server ~]$
|
46
|
+
#=>
|
47
|
+
#=> ==== output hostname ====
|
48
|
+
#=> hostname
|
49
|
+
#=> exsample-server
|
50
|
+
#=> [vagrant@exsample-server ~]$
|
51
|
+
#=>
|
52
|
+
#=> ==== output ifconfig ====
|
53
|
+
#=> ifconfig
|
54
|
+
#=> enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
|
55
|
+
#=> inet 10.0.2.15 netmask 255.255.255.0 broadcast 10.0.2.255
|
56
|
+
#=> inet6 fe80::1f59:5849:f41f:7979 prefixlen 64 scopeid 0x20<link>
|
57
|
+
#=> ether 08:00:27:37:f8:46 txqueuelen 1000 (Ethernet)
|
58
|
+
#=> RX packets 777 bytes 99545 (97.2 KiB)
|
59
|
+
#=> RX errors 0 dropped 0 overruns 0 frame 0
|
60
|
+
#=> TX packets 565 bytes 114880 (112.1 KiB)
|
61
|
+
#=> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
62
|
+
#=>
|
63
|
+
#=> lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
|
64
|
+
#=> inet 127.0.0.1 netmask 255.0.0.0
|
65
|
+
#=> inet6 ::1 prefixlen 128 scopeid 0x10<host>
|
66
|
+
#=> loop txqueuelen 1 (Local Loopback)
|
67
|
+
#=> RX packets 68 bytes 5524 (5.3 KiB)
|
68
|
+
#=> RX errors 0 dropped 0 overruns 0 frame 0
|
69
|
+
#=> TX packets 68 bytes 5524 (5.3 KiB)
|
70
|
+
#=> TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
71
|
+
#=>
|
72
|
+
#=> [vagrant@exsample-server ~]$
|
73
|
+
```
|
26
74
|
|
27
75
|
## Development
|
28
76
|
|
data/lib/xssh.rb
CHANGED
@@ -74,9 +74,9 @@ module Xssh
|
|
74
74
|
|
75
75
|
templates = templates.map { |path| Dir.exist?(path) ? Dir.glob(File.join(path, '*.rb')) : path }.flatten
|
76
76
|
templates.each do |path|
|
77
|
-
name
|
78
|
-
text
|
79
|
-
template
|
77
|
+
name = File.basename(path, '.rb').scan(/\w+/).join('_').to_sym
|
78
|
+
text = IO.read(path)
|
79
|
+
template = factory.templates[name] || Template.new(name)
|
80
80
|
template.instance_eval(text)
|
81
81
|
|
82
82
|
factory.templates[name] = template
|
data/lib/xssh/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xssh
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ito.toshifumi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
149
|
- !ruby/object:Gem::Version
|
150
150
|
version: '0'
|
151
151
|
requirements: []
|
152
|
-
rubygems_version: 3.
|
152
|
+
rubygems_version: 3.0.3
|
153
153
|
signing_key:
|
154
154
|
specification_version: 4
|
155
155
|
summary: Multiple SSH logins
|