foobara-resque-connector 0.0.2 → 0.1.1

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: 9db89ef290a5f48de2dc4cd46856e245cee7478d76e9549320b67b40f691385e
4
- data.tar.gz: e6a24e0c21b9def2cd06d12bffdfb2a68e20fd403f8f97877bee31dd2d434c0b
3
+ metadata.gz: a70a33de2c555d75cd9c2a5ec7ff8d869eef52747c92f78c85aa0715bc7e8f1b
4
+ data.tar.gz: 13b9b8eeffb0b10683783531f7a144a3dc922e512e0de0a16d0b5525bdc645ae
5
5
  SHA512:
6
- metadata.gz: 0b776dd7686a4af58ed067f2fe02ad6a43fee9f9b3401ef50abf4d8d3d01f582cb1407bc97927c21b14cf68fc56b0d9f3efad4356d40a63c78e3442d7b988861
7
- data.tar.gz: 3d4f3f3547031ea37d4fbdcad7e990e95baddb0191964632bd2ad5b84921edc1728b098d1b7a3c5d0dac0a7729a4397d7315374c8ee2fd18b5211727aebdd21d
6
+ metadata.gz: 343f567541807ca64e9421e000ef7590008faf5cdf00ee7e351bf1b6551aed02626fd0c60a360ffa0b66d6163004a0120a6434e0702f15816c46840e4ea96a7d
7
+ data.tar.gz: 47b3935a8584b696f73bf2ba195923e4c1538b403ae975f85b473107f0ec83c9ec29a8ea73958a39db2af18149944b7e6211e32c873497dfbb188bcb2b23e200
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.1.1] - 2026-10-24
2
+
3
+ - Fix some annoying deprecation warnings and require a newer foobara version
4
+
5
+ ## [0.1.0] - 2025-08-22
6
+
7
+ - Mark as compatible with Foobara 0.1.0
8
+
1
9
  ## [0.0.2] - 2025-01-07
2
10
 
3
11
  - Bump Ruby to 3.4.1
@@ -7,6 +7,8 @@ module Foobara
7
7
  module ResqueConnector
8
8
  class << self
9
9
  def reset_all
10
+ Foobara.raise_if_production!
11
+
10
12
  if CommandConnectors::ResqueConnector.instance_variable_defined?(:@all)
11
13
  CommandConnectors::ResqueConnector.all.clear
12
14
  end
@@ -19,3 +21,4 @@ module Foobara
19
21
  end
20
22
 
21
23
  Foobara::Util.require_directory("#{__dir__}/../../src")
24
+ Foobara.project "resque_connector", project_path: "#{__dir__}/../../"
data/src/command_job.rb CHANGED
@@ -6,14 +6,14 @@ module Foobara
6
6
  def perform(job_data)
7
7
  job_data = job_data.transform_keys(&:to_sym)
8
8
 
9
- allowed_keys = %i[command_name inputs connector_name]
9
+ allowed_keys = [:command_name, :inputs, :connector_name]
10
10
 
11
11
  invalid_keys = job_data.keys - allowed_keys
12
12
 
13
13
  if invalid_keys.any?
14
- # :nocov:
14
+ # simplecov:disable
15
15
  raise ArgumentError, "Invalid keys: #{invalid_keys.join(", ")}"
16
- # :nocov:
16
+ # simplecov:enable
17
17
  end
18
18
 
19
19
  command_name = job_data[:command_name]
@@ -5,11 +5,11 @@ module Foobara
5
5
  attr_accessor :command_class
6
6
 
7
7
  def initialize(command_class)
8
- # :nocov:
8
+ # simplecov:disable
9
9
  self.command_class = command_class
10
10
 
11
11
  super("No command found for #{command_class}")
12
- # :nocov:
12
+ # simplecov:enable
13
13
  end
14
14
  end
15
15
 
@@ -24,9 +24,9 @@ module Foobara
24
24
  name = instance.name
25
25
 
26
26
  if all.key?(name)
27
- # :nocov:
27
+ # simplecov:disable
28
28
  raise "#{name} already registered"
29
- # :nocov:
29
+ # simplecov:enable
30
30
  end
31
31
 
32
32
  all[name] = instance
@@ -36,36 +36,15 @@ module Foobara
36
36
  name = name.to_sym if name
37
37
 
38
38
  unless all.key?(name)
39
- # :nocov:
39
+ # simplecov:disable
40
40
  raise "#{name} not registered"
41
- # :nocov:
41
+ # simplecov:enable
42
42
  end
43
43
 
44
44
  all[name]
45
45
  end
46
46
  end
47
47
 
48
- attr_accessor :name
49
-
50
- def initialize(*, name: nil, **, &)
51
- self.name = name.to_sym if name
52
-
53
- super(*, **, &)
54
- end
55
-
56
- # NOTE: inputs transformer in this context is not clear. Is it how we transform for writing the job to redis?
57
- # Or are we transforming what comes out of redis? It seems like redis serialize/redis deserialize would make
58
- # more sense here. It feels like these types of inputs_transformer helpers from connectors like http are not
59
- # universally meaningful.
60
- # It also feels like CommandClass.run_async would be a more intuitive interface.
61
- # This makes run_async feel like an "action" like "run" and "help". So maybe "actions" should be viewed
62
- # as methods on Org/Domain/Commands/Connector.
63
- # However, if it made a class, like SomeCommandAsync, then it could be exposed through other connectors
64
- # and be declared in depends_on calls and have proper possible errors for that operation.
65
- # But on the downside, it would appear in the domain's list of commands unless coming up with a clear way
66
- # to express that. A way could be found, though. So probably creating a command class is better.
67
- # And in this context maybe that should be the transformed command?
68
- # So TransformedCommand is connector specific? And some connectors might have no TransformedCommand?
69
48
  def connect(connectable, *, queue: nil, **, &)
70
49
  exposed_commands = super(connectable, *, **, &)
71
50
  exposed_commands = Util.array(exposed_commands)
@@ -96,9 +75,9 @@ module Foobara
96
75
  transformed_command_class = transformed_command_from_name(command_name)
97
76
 
98
77
  unless transformed_command_class
99
- # :nocov:
78
+ # simplecov:disable
100
79
  raise NoCommandFoundError, command_name
101
- # :nocov:
80
+ # simplecov:enable
102
81
  end
103
82
 
104
83
  job = { command_name: }
@@ -106,7 +85,6 @@ module Foobara
106
85
  job[:connector_name] = name unless name.nil?
107
86
 
108
87
  queue = command_name_to_queue[command_name]
109
-
110
88
  Resque.enqueue_to(queue, CommandJob, job)
111
89
  end
112
90
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-resque-connector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-07 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foobara
@@ -15,14 +15,20 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: '0'
18
+ version: 0.1.1
19
+ - - "<"
20
+ - !ruby/object:Gem::Version
21
+ version: 2.0.0
19
22
  type: :runtime
20
23
  prerelease: false
21
24
  version_requirements: !ruby/object:Gem::Requirement
22
25
  requirements:
23
26
  - - ">="
24
27
  - !ruby/object:Gem::Version
25
- version: '0'
28
+ version: 0.1.1
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: 2.0.0
26
32
  - !ruby/object:Gem::Dependency
27
33
  name: resque
28
34
  requirement: !ruby/object:Gem::Requirement
@@ -73,7 +79,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
79
  - !ruby/object:Gem::Version
74
80
  version: '0'
75
81
  requirements: []
76
- rubygems_version: 3.6.2
82
+ rubygems_version: 4.0.20
77
83
  specification_version: 4
78
84
  summary: Connects Foobara commands to Resque allowing them to be ran async
79
85
  test_files: []