gretl 1.0.3 → 1.0.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 +4 -4
- data/lib/gretl.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1656965332fced86693ad3f2c07fdd3ddf9a7456ee6985109813e5d92226523f
|
|
4
|
+
data.tar.gz: d5c7cc8aac92b0d20d7da86f7b0e258e336445fa38cbf78e4560b3a54d5fe4d3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fa39a4f95613e614c4ea3ba13eed47d9a5ce770fba0416f3ed8b2718bebcdab2b72f7acd24d715eead4a112a8d70609ad78a797169b55f5ca2fa969126609db4
|
|
7
|
+
data.tar.gz: 664e92a0787ac6c3b81421372475234f904346c71862b862f09653ac173383de5d403382552add34518c9d76cbb023696c99a9b9403c8330c37195e110029097
|
data/lib/gretl.rb
CHANGED
|
@@ -129,6 +129,22 @@ module Gretl
|
|
|
129
129
|
raise "Port matching #{query.inspect} did not become active within #{timeout}s"
|
|
130
130
|
end
|
|
131
131
|
|
|
132
|
+
def add(port, name: nil, cmd: nil, group: nil, cwd: nil)
|
|
133
|
+
Gretl._ensure_daemon
|
|
134
|
+
uri = URI("#{Gretl::BASE}/ports")
|
|
135
|
+
body = { port: port }
|
|
136
|
+
body[:name] = name if name
|
|
137
|
+
body[:cmd] = cmd if cmd
|
|
138
|
+
body[:group] = group if group
|
|
139
|
+
body[:cwd] = cwd if cwd
|
|
140
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
141
|
+
req = Net::HTTP::Post.new(uri, "Content-Type" => "application/json")
|
|
142
|
+
req.body = body.to_json
|
|
143
|
+
res = http.request(req)
|
|
144
|
+
data = JSON.parse(res.body, symbolize_names: true)
|
|
145
|
+
Gretl::PortInfo.new(**data.slice(*Gretl::PortInfo.members))
|
|
146
|
+
end
|
|
147
|
+
|
|
132
148
|
def wait_for_inactive(query, timeout: 30, interval: 0.5)
|
|
133
149
|
deadline = Time.now + timeout
|
|
134
150
|
while Time.now < deadline
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gretl
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gretl
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-05-
|
|
11
|
+
date: 2026-05-15 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description:
|
|
14
14
|
email:
|