foobara-http-command-connector 0.0.25 → 0.0.26
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/CHANGELOG.md +4 -0
- data/src/http/request.rb +0 -8
- data/src/http/request_mutators/set_input_to_proc_result.rb +4 -0
- data/src/http.rb +19 -11
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29aa9d3315dc94a20e2799a25609724d6c07116d468c0187618916ecb294f424
|
4
|
+
data.tar.gz: a04bbdca1ed113eb63589e437ce5262e2c483704601473f2665fcfe660c2740b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f3860ea8fa74eec452c33bd8065a3ffae94227ea5123103c1354b4547307060139a9a62badeb9eb33c49b300d281dd70aab9e45f21a9589d6e12cc8920c78a2
|
7
|
+
data.tar.gz: 5c5e6ad45a9d9af5e732121d1cda3433a0d98a7f2ae1765fa62a2de61e18824c6fef07e02c802034ef040ad7c756b5c60caa55c493d30bfc0216ce29fdd03f8c
|
data/CHANGELOG.md
CHANGED
data/src/http/request.rb
CHANGED
@@ -113,14 +113,6 @@ module Foobara
|
|
113
113
|
path
|
114
114
|
end
|
115
115
|
end
|
116
|
-
|
117
|
-
def set_response_header(name, value)
|
118
|
-
name = name.to_s
|
119
|
-
name = name.downcase
|
120
|
-
|
121
|
-
self.response_headers ||= {}
|
122
|
-
self.response_headers = response_headers.merge(name => value)
|
123
|
-
end
|
124
116
|
end
|
125
117
|
end
|
126
118
|
end
|
data/src/http.rb
CHANGED
@@ -58,24 +58,28 @@ module Foobara
|
|
58
58
|
super(*, prefix:, **)
|
59
59
|
end
|
60
60
|
|
61
|
-
def
|
61
|
+
def request_to_command_class(request)
|
62
62
|
if request.method == "OPTIONS"
|
63
|
-
|
63
|
+
Foobara::CommandConnectors::Http::Commands::GetOptions
|
64
|
+
else
|
65
|
+
super.tap do |command_class|
|
66
|
+
if request.action == "help"
|
67
|
+
command_class.serializers = [Commands::Help::ResultSerializer]
|
68
|
+
end
|
69
|
+
end
|
64
70
|
end
|
71
|
+
end
|
65
72
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
73
|
+
def request_to_command_inputs(request)
|
74
|
+
if request.method == "OPTIONS"
|
75
|
+
{ request: }
|
76
|
+
else
|
77
|
+
super
|
71
78
|
end
|
72
|
-
|
73
|
-
command
|
74
79
|
end
|
75
80
|
|
76
81
|
def set_response_status(response)
|
77
|
-
|
78
|
-
outcome = command.outcome
|
82
|
+
outcome = response.outcome
|
79
83
|
|
80
84
|
response.status = if outcome.success?
|
81
85
|
200
|
@@ -124,6 +128,10 @@ module Foobara
|
|
124
128
|
end
|
125
129
|
end
|
126
130
|
|
131
|
+
if request.action == "help"
|
132
|
+
response_headers = (response_headers || {}).merge("content-type" => "text/html")
|
133
|
+
end
|
134
|
+
|
127
135
|
if response_headers
|
128
136
|
static_headers.merge(response_headers)
|
129
137
|
else
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foobara-http-command-connector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-05-
|
10
|
+
date: 2025-05-03 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: foobara
|
@@ -15,14 +15,14 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 0.0.
|
18
|
+
version: 0.0.116
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - "~>"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: 0.0.
|
25
|
+
version: 0.0.116
|
26
26
|
email:
|
27
27
|
- azimux@gmail.com
|
28
28
|
executables: []
|