daytona 0.161.0 → 0.162.0

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: 57ce6010f76c0fba0fb31863fcc3c59dcfdd79a2e76ad6da3d42c15d862639cd
4
- data.tar.gz: a1de147b7e41d679c476a63a764a72c916fb615e84aee0964b426cdbb7f8b971
3
+ metadata.gz: 6438205c2f0a51d6a42f26622f5788e1f782817016a7279c546fd6e5f5f56230
4
+ data.tar.gz: e890cafc75745dffe19ddb005266268aae7913b9fef00367131851b0e932639b
5
5
  SHA512:
6
- metadata.gz: 4b4a1fc5c9e2c3467158b4388bc27031b3e173c2e1ef613b11c1e2c1038e76fdcdb03f0cca184b357fe4c37ce080cdf2ab34f9bfabdc94eff93cc29242161947
7
- data.tar.gz: c755eca08259c903c9296124438fd1e244c2101b7f9317d1606e100609a80a8ab95625c24d1e35154c338bef803ca559223960a3c38f968365b5e9d20e48ce77
6
+ metadata.gz: e935fc087a7a1ae74571a58ffc862e8007f9328601574fcf595cedcd3da19951a68d269de314bd1d3cce4b3dddaf73a2a9947967a9aea1521aa11686adaab571
7
+ data.tar.gz: b4b3c19344b98ed59a3115e2c44a8917ddeead371d709380669b26a83b63cd00ca60d616bc6095c1b05b8156e441ac91064ba70b4bbfbb51ebedef0168179e57
data/README.md CHANGED
@@ -185,4 +185,4 @@ completions = lsp_server.completions(
185
185
 
186
186
  ## Contributing
187
187
 
188
- Daytona is Open Source under the [Apache License 2.0](https://github.com/daytonaio/daytona/blob/main/libs/sdk-ruby/LICENSE), and is the [copyright of its contributors](https://github.com/daytonaio/daytona/blob/main/NOTICE). If you would like to contribute to the software, read the Developer Certificate of Origin Version 1.1 (https://developercertificate.org/). Afterwards, navigate to the [contributing guide](/CONTRIBUTING.md) to get started.
188
+ Daytona is Open Source under the [Apache License 2.0](https://github.com/daytonaio/daytona/blob/main/libs/sdk-ruby/LICENSE), and is the [copyright of its contributors](https://github.com/daytonaio/daytona/blob/main/NOTICE). If you would like to contribute to the software, read the Developer Certificate of Origin Version 1.1 (https://developercertificate.org/). Afterwards, navigate to the [contributing guide](../../CONTRIBUTING.md) to get started.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Daytona
4
4
  module Sdk
5
- VERSION = '0.161.0'
5
+ VERSION = '0.162.0'
6
6
  end
7
7
  end
data/lib/daytona/util.rb CHANGED
@@ -4,25 +4,52 @@ require 'net/http'
4
4
 
5
5
  module Daytona
6
6
  module Util
7
- def self.demux(line) # rubocop:disable Metrics/MethodLength
8
- stdout = ''.dup
9
- stderr = ''.dup
10
-
11
- until line.empty?
12
- buff = line.start_with?(STDOUT_PREFIX) ? stdout : stderr
13
- line = line[3..]
14
-
15
- end_index = [
16
- line.index(STDOUT_PREFIX),
17
- line.index(STDERR_PREFIX)
18
- ].compact.min || line.length
19
- data = line[...end_index]
20
- buff << data
21
-
22
- line = line[end_index..]
7
+ STDOUT_PREFIX = "\x01\x01\01"
8
+ private_constant :STDOUT_PREFIX
9
+
10
+ STDERR_PREFIX = "\x02\x02\02"
11
+ private_constant :STDERR_PREFIX
12
+
13
+ PREFIX_LEN = STDOUT_PREFIX.bytesize
14
+ private_constant :PREFIX_LEN
15
+
16
+ def self.demux(line)
17
+ out_parts = []
18
+ err_parts = []
19
+ state = nil
20
+ pos = 0
21
+
22
+ while pos < line.bytesize
23
+ si = line.index(STDOUT_PREFIX, pos)
24
+ ei = line.index(STDERR_PREFIX, pos)
25
+
26
+ if si && (ei.nil? || si < ei)
27
+ next_idx = si
28
+ next_state = :stdout
29
+ elsif ei
30
+ next_idx = ei
31
+ next_state = :stderr
32
+ else
33
+ case state
34
+ when :stdout then out_parts << line[pos..]
35
+ when :stderr then err_parts << line[pos..]
36
+ end
37
+ break
38
+ end
39
+
40
+ if pos < next_idx
41
+ chunk = line[pos...next_idx]
42
+ case state
43
+ when :stdout then out_parts << chunk
44
+ when :stderr then err_parts << chunk
45
+ end
46
+ end
47
+
48
+ state = next_state
49
+ pos = next_idx + PREFIX_LEN
23
50
  end
24
51
 
25
- [stdout, stderr]
52
+ [out_parts.join, err_parts.join]
26
53
  end
27
54
 
28
55
  # @param uri [URI]
@@ -46,11 +73,5 @@ module Daytona
46
73
  Sdk.logger.debug("Async stream (#{uri}) timeout: #{e.inspect}")
47
74
  end
48
75
  end
49
-
50
- STDOUT_PREFIX = "\x01\x01\01"
51
- private_constant :STDOUT_PREFIX
52
-
53
- STDERR_PREFIX = "\x02\x02\02"
54
- private_constant :STDERR_PREFIX
55
76
  end
56
77
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daytona
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.161.0
4
+ version: 0.162.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daytona Platforms Inc.
@@ -85,28 +85,28 @@ dependencies:
85
85
  requirements:
86
86
  - - '='
87
87
  - !ruby/object:Gem::Version
88
- version: 0.161.0
88
+ version: 0.162.0
89
89
  type: :runtime
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - '='
94
94
  - !ruby/object:Gem::Version
95
- version: 0.161.0
95
+ version: 0.162.0
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: daytona_toolbox_api_client
98
98
  requirement: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - '='
101
101
  - !ruby/object:Gem::Version
102
- version: 0.161.0
102
+ version: 0.162.0
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - '='
108
108
  - !ruby/object:Gem::Version
109
- version: 0.161.0
109
+ version: 0.162.0
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: dotenv
112
112
  requirement: !ruby/object:Gem::Requirement