freshli-commons 0.6.1 → 0.6.4

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: d0441a6a6d0f50aabe59ba737953b8aede052fa3b05f38ec073224b35a47cdcf
4
- data.tar.gz: 5918030bf753e13c56d915be06b2de14d0658fb246904be370681e5d5184f3d5
3
+ metadata.gz: d95cfbbcfd1f22a42fd6d51c485eba7d06fe0a92a813df113de230a53983c9b8
4
+ data.tar.gz: 87fd47d927a2c0a9eadd6d9a2f1fea52ddeca1e825fad10c7f5237b0b7da5472
5
5
  SHA512:
6
- metadata.gz: 31a2935147ee357fe9cc9bd371176649eb371161c5976eaeb5ee8f9002c3ec92d71ac8cb11b4c7684927127e9837530ce8e729fde73c2ad5b70ae64b4169ac5e
7
- data.tar.gz: 8b735a2e8b99f484c289e9024b0a561e253dd425dbb639e56914103c7e98361c0d1b6cd0f84208062af2afe390bfbf7d747c7d89a0fd0ce6d28a4071906e47f6
6
+ metadata.gz: 999ee8589980e249c8c6f7eb8f0abd35979dc6c9b5401de2276542f8dade867f140bf608f4c55b10ca16799abe69f66b81ee3e19ab426af70e947005069fa66f
7
+ data.tar.gz: fe6e596e37061fae93c278aff9b7d2974e365f65cd15751a9261f18618d7ddde8a584b3d92547d4af3661679ec268fe0dac5c87fcbb5c08e7296fed1a5118529
data/.semver CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 6
4
- :patch: 1
4
+ :patch: 4
5
5
  :special: ''
6
6
  :metadata: ''
@@ -1,12 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'open3'
4
+ require 'mkmf'
4
5
 
5
6
  module Corgibytes
6
7
  module Freshli
7
8
  module Commons
8
9
  # Contains utility methods for executing commands and working with their output.
9
10
  module Execute
11
+
12
+ def msbuild_dll_path
13
+ dotnet_exe_path = File.realpath(find_executable('dotnet'))
14
+ dotnet_dir = File.dirname(dotnet_exe_path)
15
+ sdk_dir = File.join(dotnet_dir, 'sdk', Dir.children(File.join(dotnet_dir, 'sdk')).max)
16
+ result = File.join(sdk_dir, 'MSBuild.dll')
17
+ result = result.gsub('/', '\\') if Gem.win_platform?
18
+ result
19
+ end
20
+
21
+ def null_output_target
22
+ Gem.win_platform? ? '\\\\.\\nul' : '/dev/null'
23
+ end
24
+
10
25
  def enable_dotnet_command_colors
11
26
  ENV['DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION'] = 'true'
12
27
  end
@@ -31,7 +46,7 @@ module Corgibytes
31
46
  end
32
47
  end
33
48
 
34
- BUFFER_LEN = 128
49
+ BUFFER_LEN = 8
35
50
 
36
51
  def fill_buffer_from_stream(stream, buffer)
37
52
  # loop through reading data until there is an EOF (value is nil)
@@ -89,10 +104,6 @@ module Corgibytes
89
104
  end
90
105
  exit_status
91
106
  end
92
-
93
- def null_output_target
94
- Gem.win_platform? ? 'NUL:' : '/dev/null'
95
- end
96
107
  end
97
108
  end
98
109
  end
@@ -19,9 +19,13 @@ module Corgibytes
19
19
  socket4 = Socket.new(Socket::Constants::AF_INET, Socket::Constants::SOCK_STREAM, 0)
20
20
  socket4.bind(Socket.pack_sockaddr_in(port, '0.0.0.0'))
21
21
 
22
- # bind to a socket using both ipv4 and ipv6
23
- socket6 = Socket.new(Socket::Constants::AF_INET6, Socket::Constants::SOCK_STREAM, 0)
24
- socket6.bind(Socket.pack_sockaddr_in(port, '::'))
22
+ begin
23
+ # bind to a socket using both ipv4 and ipv6
24
+ socket6 = Socket.new(Socket::Constants::AF_INET6, Socket::Constants::SOCK_STREAM, 0)
25
+ socket6.bind(Socket.pack_sockaddr_in(port, '::'))
26
+ rescue Errno::EADDRINUSE
27
+ # if ipv6 is not available, then just use ipv4
28
+ end
25
29
 
26
30
  @test_services[port] = { v4: socket4, v6: socket6 }
27
31
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freshli-commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - M. Scott Ford
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-25 00:00:00.000000000 Z
11
+ date: 2023-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba