buildaemon 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: f03accc86fe7245e519955f6120121feec029b8b1687e32ab9e572339d0b91b1
4
- data.tar.gz: 428d8d352b3344e68a6d4706fff3478a4e914adb1fcd2c2f7040b11210f63afb
3
+ metadata.gz: 8ef0227a7f55fab1921d1d87ee290d57e61b628c5f0628bd2e4c65a8a21f5001
4
+ data.tar.gz: cdbe6c3b80e574b9753bd60341f458b4ac8f16956f2cd8fe9ddc6ec191f9ba6f
5
5
  SHA512:
6
- metadata.gz: 16966b550671cbbccf6e3dc9db184ed251cb25f80786c7347cc27b49ecd41e33fd8c08dd9e50435109faa058c5ff022b003ad8a1e672392a95e51a89354f4ec6
7
- data.tar.gz: 271157280733325920409a2b7a924abe5c7f16a0095b8b8850c6f277a49720b723fd5773779cdfa07897abc60edb53343a4e3215695cebf1788ad838def23a2e
6
+ metadata.gz: bb2a2436764cfae5fdf4bab4becf52dfb280a66ebab8eaa26bba25ed0f9230701027aa1d4ccc7ef1eb5fe971e544f655f33d62fe28eeda2afed0963ee624cbe2
7
+ data.tar.gz: 4aaa4e3b9d634654109ebe48b78b0d265a74c47eef99146a21b295814ff776a1584805435408170d3d53f30d3d5a2aff334e327d3357a0ed9247125db60d9bf8
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Buildaemon
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
data/lib/buildaemon.rb CHANGED
@@ -28,28 +28,31 @@ module Buildaemon
28
28
  def self.ToColorString(colorCode, string)
29
29
  "\e[#{colorCode}m#{string}\e[0m"
30
30
  end
31
-
32
- def self.Print(ground, color, string)
33
- print Terminal.ToColorString(ground + color, string)
34
- end
35
-
36
- def self.Puts(ground, color, string)
37
- puts Terminal.ToColorString(ground + color, string)
38
- end
39
31
  end
40
32
 
41
33
  def self.Execute(command)
42
34
  timestamp = DateTime.now.strftime("%y/%m/%d %H:%M:%S")
43
- Terminal.Puts(Terminal::Ground::Foreground, Terminal::Color::Green, "[#{timestamp}] $ #{command}")
35
+ puts Terminal.ToColorString(Terminal::Ground::Foreground + Terminal::Color::Green, "[#{timestamp}] $ #{command}")
44
36
  Open3.popen3(command){|i, o, e, w|
45
37
  i.close
46
- o.each{|line| STDOUT.puts line.toutf8}
47
- e.each{|line| STDERR.puts line.toutf8}
48
- exitStatus = w.value.exitstatus
38
+ threads = [
39
+ Thread.new{
40
+ while (line = o.gets) do
41
+ STDOUT.puts line.toutf8
42
+ end
43
+ },
44
+ Thread.new{
45
+ while (line = e.gets) do
46
+ STDERR.puts line.toutf8
47
+ end
48
+ }
49
+ ].each{|thread| thread.join}
50
+ status = w.value
51
+ exitCode = status.exitstatus.nil? ? status.termsig : status.exitstatus
49
52
  if block_given?
50
- yield(exitStatus)
51
- elsif exitStatus != 0
52
- exit(exitStatus)
53
+ yield(status)
54
+ elsif exitCode != 0
55
+ exit(exitCode)
53
56
  end
54
57
  }
55
58
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: buildaemon
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
  - mskz-3110
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-24 00:00:00.000000000 Z
11
+ date: 2024-06-05 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Multiplatform build script.
14
14
  email:
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  requirements: []
49
- rubygems_version: 3.5.7
49
+ rubygems_version: 3.5.10
50
50
  signing_key:
51
51
  specification_version: 4
52
52
  summary: Multiplatform build script.