foobara-rails-command-connector 0.0.5 → 0.1.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: e3d2c6b110dd56102f9e679cf724b2afbdb9a1c9b0ffe9c7f558d45a5292b404
4
- data.tar.gz: 9b7b9c53655efbe0ff2f105d1dc5570ac4fb928de260f7d93800a6f1f2382b38
3
+ metadata.gz: bde36872401e745312b31c25be27ba26af9cd50817c4e01a9fbac4b6a557282c
4
+ data.tar.gz: 58444eac91b29bfe332d6e04ed6b4d606d93613bbfb7c269df18415214698fe5
5
5
  SHA512:
6
- metadata.gz: 04151ec8cc378ffee81ed8830b8c4a9e4ed1698bc2d34d4cebb5fff34a90398a3aee4ca19dc6e5ed09ab736367c09112c1d1ce3064a11a09f95f2510de839ea8
7
- data.tar.gz: 0cbbdca2302eb49b115ee785649685563597e450b980e89ff10c0f9921e5ac24168a06724ac89b7e5e5e487e87e714aa18707ddb090757a71ec566e71be3ff0e
6
+ metadata.gz: 6975fa7814bdc845582bf6af03f6a9b66ae7707cbea1832b4942e999be79d1897f874860c526f083e653bcc343d12547dbb0811fabd6f0a91d7882fbac440862
7
+ data.tar.gz: 3533866dc1a68629d556785a39314368e6bc1e5ba6e3b09c95dc983dd244215bbc487b930c2152d658b483029b47a4b1a743f9f335f6472aec6e593eaa8a9985
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.1.0] - 2025-08-22
2
+
3
+ - Mark as compatible with newer versions of foobara-rack-connector
4
+
5
+ ## [0.0.6] - 2025-03-28
6
+
7
+ - Add support for manipulating cookies
8
+
1
9
  ## [0.0.5] - 2025-01-28
2
10
 
3
11
  - Fix problem preventing routes without any args
@@ -1,4 +1,6 @@
1
1
  class Foobara::RailsController < ApplicationController
2
+ include ActionController::Cookies
3
+
2
4
  before_action :run_and_set_foobara_response
3
5
 
4
6
  def run
@@ -27,6 +29,20 @@ class Foobara::RailsController < ApplicationController
27
29
  response.set_header(key, value)
28
30
  end
29
31
 
32
+ foobara_response.cookies&.each do |cookie|
33
+ cookie_hash = { value: cookie.value }
34
+
35
+ cookie_hash[:path] = cookie.path if cookie.path
36
+ cookie_hash[:httponly] = cookie.httponly if cookie.httponly
37
+ cookie_hash[:secure] = cookie.secure if cookie.secure
38
+ cookie_hash[:same_site] = cookie.same_site if cookie.same_site
39
+ cookie_hash[:domain] = cookie.domain if cookie.domain
40
+ cookie_hash[:expires] = cookie.expires if cookie.expires
41
+ cookie_hash[:max_age] = cookie.max_age if cookie.max_age
42
+
43
+ cookies[cookie.name] = cookie_hash
44
+ end
45
+
30
46
  format = if response.content_type == "application/json"
31
47
  :json
32
48
  else
@@ -7,7 +7,7 @@ module Foobara
7
7
  class << self
8
8
  # TODO: push this up the stack
9
9
  def supported_actions
10
- %i[run help describe list manifest]
10
+ [:run, :help, :describe, :list, :manifest]
11
11
  end
12
12
  end
13
13
 
@@ -42,9 +42,9 @@ module Foobara
42
42
  Rails.application.routes.draw do
43
43
  connector.supported_actions.each do |action|
44
44
  match "#{prefix}/#{action}/*args", to: "foobara/rails##{action}",
45
- via: %i[get post patch put delete]
45
+ via: [:get, :post, :patch, :put, :delete]
46
46
  match "#{prefix}/#{action}", to: "foobara/rails##{action}",
47
- via: %i[get post patch put delete],
47
+ via: [:get, :post, :patch, :put, :delete],
48
48
  defaults: { args: "" }
49
49
  end
50
50
  end
metadata CHANGED
@@ -1,28 +1,54 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-rails-command-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-28 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: foobara
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: 0.1.1
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.0
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: 0.1.1
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: 2.0.0
12
32
  - !ruby/object:Gem::Dependency
13
33
  name: foobara-rack-connector
14
34
  requirement: !ruby/object:Gem::Requirement
15
35
  requirements:
16
36
  - - ">="
17
37
  - !ruby/object:Gem::Version
18
- version: '0'
38
+ version: 0.1.0
39
+ - - "<"
40
+ - !ruby/object:Gem::Version
41
+ version: 2.0.0
19
42
  type: :runtime
20
43
  prerelease: false
21
44
  version_requirements: !ruby/object:Gem::Requirement
22
45
  requirements:
23
46
  - - ">="
24
47
  - !ruby/object:Gem::Version
25
- version: '0'
48
+ version: 0.1.0
49
+ - - "<"
50
+ - !ruby/object:Gem::Version
51
+ version: 2.0.0
26
52
  email:
27
53
  - azimux@gmail.com
28
54
  executables: []
@@ -60,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
60
86
  - !ruby/object:Gem::Version
61
87
  version: '0'
62
88
  requirements: []
63
- rubygems_version: 3.6.2
89
+ rubygems_version: 3.6.9
64
90
  specification_version: 4
65
91
  summary: Exposes Foobara commands through Rails router
66
92
  test_files: []