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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d8f00bf065bb847338cd02ef7580cd737de4ffe01dbbbb72d4cc8dde8738699a
4
- data.tar.gz: 7606a3ce9ae3d4beb07a25a114e180f5dfd5fdd074ae11129dfd74bccba735bb
3
+ metadata.gz: 13f403b0876bf28535c2803a75085316fc9a6f0467e1ff405aaa784e542fdfbf
4
+ data.tar.gz: 1e3c70a7cff14dbae2bb33d6b6bf4190b91d5e46969f0b826dec6f768d70fe89
5
5
  SHA512:
6
- metadata.gz: db7cfff9fae3731aaee8620e778930559e82ccf18eb388616803f9538f8da9f63711dfd8f90a7f96402936fac83bd37cc229bf10944197f7c5d23ad2814c5335
7
- data.tar.gz: 2aa211dc8d3151b96e7b029bbbc35c03cf6273f3eadc0d69ad8441b45ae238d8784c8f6e300b3fc4640d468b8cd75069e9ef797f602d56942a339a724bd9efec
6
+ metadata.gz: 8b420a7c7b3beb097f287fdcc8502e1d9816390475167399fabd0870321bbe59b859a70ae7db005012ce2f99fb89f3b9f70ea9175f207da147c551466a086349
7
+ data.tar.gz: 33ae8da552274926565ee54f19c38a66a1691ab8ca02a4b0b74e2b70880d804211733d07129461b39e06016cfa53afea2f946b558a04155aabeab36ce52f99cd
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xssh (0.1.0)
4
+ xssh (0.1.1)
5
5
  bcrypt_pbkdf
6
6
  ed25519
7
7
  net-ssh
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
- TODO: Write usage instructions here
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
 
@@ -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 ||= File.basename(path, '.rb').scan(/\w+/).join('_').to_sym
78
- text = IO.read(path)
79
- template = factory.templates[name] || Template.new(name)
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
@@ -1,3 +1,3 @@
1
1
  module Xssh
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
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.0
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-10 00:00:00.000000000 Z
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.1.2
152
+ rubygems_version: 3.0.3
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: Multiple SSH logins