xlogin 0.16.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aae85b41321af336f469aa967987f88912d22087748c6b646adb699688c0b17f
4
- data.tar.gz: 26dcf9ed1c173bc43d247ab1a1339c8df0586c9734ea0679f5dd5e7fd70bd83a
3
+ metadata.gz: 2be71cfa9759e1335b4d8fb3e7c4716d0659c16fa9bc029ecfd0f27df345fea9
4
+ data.tar.gz: aa0573d7f09586135a5f95bf5c64febe48436d174ec52233604fd1ed182cc9b1
5
5
  SHA512:
6
- metadata.gz: f7eeeecc2b10c5bb0a6bbca0ba80a7b71611cb04733d59271370641930c391aa604bdd06ca96cfbbfad05b32a745d62869688a3e703330a1742f7bab5df5c59c
7
- data.tar.gz: a27419c164f9387f8633fa7610c7507d5febd8f9ae1d1d3eb77bf2ab6b04a96133c83e40265192927432b92994c02c3c8386b1088882fc5679041aea9d6f9134
6
+ metadata.gz: 7741a7cdb6aa44f52ebad609ef4ecba0fa8308834ff27f548565ed865045ca73808de07526d669ce9ddc89d174c4dd07513634d45f7b5b4e52a64c3e8804a5dc
7
+ data.tar.gz: bbfc0ab5da188614ab3364653bbf15a8ea924cf4504435f02a8433b0a3b97cc7b1dfc4e62742971360bca812bb1fc4406196cb7ba440cd1690badcfbcb1e9f6b
@@ -10,16 +10,18 @@ module Xlogin
10
10
  class << self
11
11
  include Rake::DSL
12
12
 
13
- def generate(*patterns, **opts, &block)
14
- description = Rake.application.last_description
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 unless opts[:all] == false
18
+ task 'all' => hostnames
18
19
  hostnames.each do |hostname|
19
- desc "#{description} with #{hostname}"
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, **opt)
101
- print(text + "\n", **opt)
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, **opt)
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{ |line| "#{name}\t|#{line}" }.join if Rake.application.options.always_multitask
109
- text = text.colorize(**opt)
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
 
@@ -1,3 +1,3 @@
1
1
  module Xlogin
2
- VERSION = "0.16.0"
2
+ VERSION = "0.16.1"
3
3
  end
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.0
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-04-21 00:00:00.000000000 Z
11
+ date: 2021-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-telnet