xlogin 0.11.9 → 0.11.11

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: 523b5807afae2b2175f43b09e7c05c00d0d5497dc0d639b517b2284081fd1bb9
4
- data.tar.gz: e8fdb5028df03bb6c91f21164e2f350db7d1f225c257f8d736a17694ce33561a
3
+ metadata.gz: d6dae2d182fa540c1ede9d1bb18eef34307a333b5f9981de501491824e576c62
4
+ data.tar.gz: 5a35f8146697e899a1b406083b99b35e4ff2e5e217e8d3ec8116d230b0e80aed
5
5
  SHA512:
6
- metadata.gz: 12dcd547fc39f2f46300b4effc16653234444e172cc021c23fc6bd543088dd2d3cfe54a232f7f4b0fe8960d9cb646627143d58b8b6fed389ef1a222c8af5daa6
7
- data.tar.gz: e2e1ac68aa439389b97ad59c230a6eb673971ce914fb99070a712b6d96ef82b245a7ee6012b77378b55e53d7bf8706a804a438de52e0c5fa371902138131d409
6
+ metadata.gz: bfba33b9fd36cb0725c4adc94ba2b300085aa115eff051694969ca3e46943fe4c8b2f2d6d653bfeb9cbd72e9c7fc8f423b23310cdfa9729c3d4c7a9dc110f0b6
7
+ data.tar.gz: b1b6ef3733cd9dd2cbb8396bfd71e43b7063fdd59c605672f1b92295d43a9a0137a1eb457b9401c2599c90a695678e184a445cc10d4686eec4ebcc6bcbb462f7
@@ -21,6 +21,21 @@ module Xlogin
21
21
  end
22
22
 
23
23
  end
24
+
25
+ def printf(fp, text)
26
+ time = Time.now.iso8601
27
+ lines = text.lines
28
+ lines.pop if lines[-1] == "\n"
29
+
30
+ lines = lines.map do |line|
31
+ str = time
32
+ str << " #{name}" if Rake.application.options.always_multitask
33
+ str << " |#{line.gsub(/^\s*[\r\n]+/, '')}"
34
+ end
35
+
36
+ fp.print "\n"
37
+ fp.print lines.join("\n")
38
+ end
24
39
  end
25
40
 
26
41
  attr_reader :name
@@ -84,22 +99,13 @@ module Xlogin
84
99
  @runner.call(session)
85
100
  session.close rescue nil
86
101
 
87
- printf($stdout, buffer.string) if !silent && Rake.application.options.always_multitask
102
+ RakeTask.printf($stdout, buffer.string) if !silent && Rake.application.options.always_multitask
88
103
  rescue => e
89
- printf($stderr, buffer.string) if !silent && Rake.application.options.always_multitask
90
- printf($stderr, "[ERROR] #{e}\n")
104
+ RakeTask.printf($stderr, buffer.string) if !silent && Rake.application.options.always_multitask
105
+ RakeTask.printf($stderr, "ERROR - #{e}\n")
91
106
 
92
107
  @@graceful_shutdown = true if fail_on_error
93
108
  end
94
109
 
95
- def printf(fp, text)
96
- time = Time.now.iso8601
97
- text.each_line do |line|
98
- fp.print "#{time} "
99
- fp.print "#{name}\t" if Rake.application.options.always_multitask
100
- fp.print "|#{line.chomp.gsub(/^\s*\r/, '')}\n"
101
- end
102
- end
103
-
104
110
  end
105
111
  end
@@ -1,3 +1,3 @@
1
1
  module Xlogin
2
- VERSION = "0.11.9"
2
+ VERSION = "0.11.11"
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.11.9
4
+ version: 0.11.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - haccht
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-15 00:00:00.000000000 Z
11
+ date: 2019-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-telnet