xlogin 0.16.0 → 0.16.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/lib/xlogin/rake_task.rb +16 -9
- data/lib/xlogin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2be71cfa9759e1335b4d8fb3e7c4716d0659c16fa9bc029ecfd0f27df345fea9
|
4
|
+
data.tar.gz: aa0573d7f09586135a5f95bf5c64febe48436d174ec52233604fd1ed182cc9b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7741a7cdb6aa44f52ebad609ef4ecba0fa8308834ff27f548565ed865045ca73808de07526d669ce9ddc89d174c4dd07513634d45f7b5b4e52a64c3e8804a5dc
|
7
|
+
data.tar.gz: bbfc0ab5da188614ab3364653bbf15a8ea924cf4504435f02a8433b0a3b97cc7b1dfc4e62742971360bca812bb1fc4406196cb7ba440cd1690badcfbcb1e9f6b
|
data/lib/xlogin/rake_task.rb
CHANGED
@@ -10,16 +10,18 @@ module Xlogin
|
|
10
10
|
class << self
|
11
11
|
include Rake::DSL
|
12
12
|
|
13
|
-
def
|
14
|
-
|
13
|
+
def all(*patterns, &block)
|
14
|
+
patterns = patterns.empty? ? ENV['target'] : patterns
|
15
15
|
hostnames = Xlogin.list(*patterns).map{ |e| e[:name] }
|
16
|
+
description = Rake.application.last_description
|
16
17
|
|
17
|
-
task 'all' => hostnames
|
18
|
+
task 'all' => hostnames
|
18
19
|
hostnames.each do |hostname|
|
19
|
-
desc "#{description}
|
20
|
+
desc "#{description} - #{hostname}" if description
|
20
21
|
RakeTask.new(hostname, &block)
|
21
22
|
end
|
22
23
|
end
|
24
|
+
alias_method :generate, :all
|
23
25
|
|
24
26
|
def shutdown!
|
25
27
|
@stop = true
|
@@ -97,16 +99,21 @@ module Xlogin
|
|
97
99
|
session.close rescue nil
|
98
100
|
end
|
99
101
|
|
100
|
-
def puts(text, **
|
101
|
-
|
102
|
+
def puts(text, **opts)
|
103
|
+
return text.each { |e| puts(e, **opts) } if text.kind_of?(Array)
|
104
|
+
|
105
|
+
text = text.to_s
|
106
|
+
text = text + "\n" unless text[-1] == "\n"
|
107
|
+
print(text, **opts)
|
102
108
|
end
|
103
109
|
|
104
|
-
def print(text, **
|
110
|
+
def print(text, **opts)
|
111
|
+
text = text.to_s
|
105
112
|
return if text.empty?
|
106
113
|
|
107
114
|
text = text.gsub("\r", '')
|
108
|
-
text = text.lines.map{ |
|
109
|
-
text = text.colorize(**
|
115
|
+
text = text.lines.map{ |text| "#{name}\t|#{text}" }.join if Rake.application.options.always_multitask
|
116
|
+
text = text.colorize(**opts)
|
110
117
|
$stdout.print(text)
|
111
118
|
end
|
112
119
|
|
data/lib/xlogin/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xlogin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- haccht
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-telnet
|