readymade 0.3.5 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f6af81b9c83a1dad8f64ead23ebe956ffe8341308c3acef6211a9c76fa5df5fb
4
- data.tar.gz: d6cda3a6863ce1330df753de6e6fd51c8f0005e05b0aa8d10534b59eb5b6104f
3
+ metadata.gz: a99833ca151368c750c36d51cdd6be713210f846b1cdd78b2ba533b188fa3d63
4
+ data.tar.gz: f65962b9ddfebc091f7f799825e7db62e579ee8ad14c3f86afeae782f3f2692b
5
5
  SHA512:
6
- metadata.gz: 7f05bc204146596fd641f742d6ee2738dfc8db887ddb35c1588f1a1aa1639f80fc334920333206e2392999ea7c01f9db42c585b356ec33cfa9ec528cec0249f2
7
- data.tar.gz: 1d7196a1c79a79169bcf865406dca0aa8bdfcfb07d7e659616fe2563260b3dbfcc95ed8f19c3f43eca7242e7acd573648629a90cce803495474b2289cc408d19
6
+ metadata.gz: aefb0039b18326b3c8b47b77a8259f8957adf897bfbce727d14e2c2498652539c49ef271d1ff7281fd911e7c43577f9f2eb5c3c65f5827a6dc43f1c6a2556c7e
7
+ data.tar.gz: 328f459c616399fab211b04db587ef586caf0a79a030850d14bf1b23b66e1a49944c881b656ebff0118b8bdf7c1be8d2aa98e5a7ef4a21bb15edd4dfe9b4d7f6
data/CHANGELOG.md CHANGED
@@ -1,7 +1,15 @@
1
1
  Changelog
2
2
  All notable changes to this project will be documented in this file.
3
3
 
4
- ## [0.4.0] - 2023-06-22
4
+ ## [0.3.7] - 2023-08-08
5
+
6
+ * Fix invalid behaviour of `call!` method
7
+
8
+ ## [0.3.6] - 2023-07-21
9
+
10
+ * Add `queue_as: :name` argument to `Readymade::BackgroundJob` to select queue name when using `.call_async(args.merge(queue_as: :my_queue))`
11
+
12
+ ## [0.3.5] - 2023-06-23
5
13
 
6
14
  * Add `.call!` method to `Readymade::Action` to raise an error if not success
7
15
  * Add `.call_async!` method to `Readymade::Action` to raise an error in background if not success
data/Gemfile.lock CHANGED
@@ -1,19 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- readymade (0.3.5)
4
+ readymade (0.3.7)
5
5
  activejob
6
6
  activemodel
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activejob (7.0.5)
12
- activesupport (= 7.0.5)
11
+ activejob (7.0.6)
12
+ activesupport (= 7.0.6)
13
13
  globalid (>= 0.3.6)
14
- activemodel (7.0.5)
15
- activesupport (= 7.0.5)
16
- activesupport (7.0.5)
14
+ activemodel (7.0.6)
15
+ activesupport (= 7.0.6)
16
+ activesupport (7.0.6)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
18
  i18n (>= 1.6, < 2)
19
19
  minitest (>= 5.1)
data/README.md CHANGED
@@ -146,6 +146,8 @@ class Orders::Actions::SendNotifications < Readymade::Action
146
146
  end
147
147
 
148
148
  Orders::Actions::SendNotifications.call_async(order: order)
149
+ Orders::Actions::SendNotifications.call_async!(order: order, queue_as: :my_queue) # job will be executed in 'my_queue'
150
+ # Important! Make sure your sidekiq configuration has 'my_queue' queue
149
151
  ```
150
152
 
151
153
 
@@ -184,6 +186,7 @@ class Orders::Actions::SendNotifications < Readymade::Action
184
186
  end
185
187
 
186
188
  Orders::Actions::SendNotifications.call_async!(order: order) # job will be failed
189
+
187
190
  ```
188
191
 
189
192
  ### Readymade::Operation
@@ -42,7 +42,9 @@ module Readymade
42
42
 
43
43
  def call; end
44
44
 
45
- def call!; end
45
+ def call!
46
+ call
47
+ end
46
48
 
47
49
  def call_async
48
50
  ::Readymade::BackgroundJob.perform_later(class_name: self.class.name, **args)
@@ -4,7 +4,7 @@ require 'active_job' unless defined?(::ActiveJob)
4
4
 
5
5
  module Readymade
6
6
  class BackgroundBangJob < ::ActiveJob::Base
7
- # queue_as :default
7
+ queue_as { self.arguments[0].fetch(:queue_as, :default) }
8
8
 
9
9
  def perform(**args)
10
10
  args.delete(:class_name).to_s.constantize.send(:call!, **args)
@@ -4,7 +4,7 @@ require 'active_job' unless defined?(::ActiveJob)
4
4
 
5
5
  module Readymade
6
6
  class BackgroundJob < ::ActiveJob::Base
7
- # queue_as :default
7
+ queue_as { self.arguments[0].fetch(:queue_as, :default) }
8
8
 
9
9
  def perform(**args)
10
10
  args.delete(:class_name).to_s.constantize.send(:call, **args)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Readymade
4
- VERSION = '0.3.5'
4
+ VERSION = '0.3.7'
5
5
  end
data/readymade.gemspec CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
 
19
19
  spec.metadata['homepage_uri'] = spec.homepage
20
20
  spec.metadata['source_code_uri'] = spec.homepage
21
- spec.metadata['changelog_uri'] = "#{spec.homepage}/CHANGELOG.md"
21
+ spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/master/CHANGELOG.md"
22
22
 
23
23
  # Specify which files should be added to the gem when it is released.
24
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: readymade
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - OrestF
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-23 00:00:00.000000000 Z
11
+ date: 2023-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: byebug
@@ -118,7 +118,7 @@ licenses:
118
118
  metadata:
119
119
  homepage_uri: https://github.com/OrestF/readymade
120
120
  source_code_uri: https://github.com/OrestF/readymade
121
- changelog_uri: https://github.com/OrestF/readymade/CHANGELOG.md
121
+ changelog_uri: https://github.com/OrestF/readymade/blob/master/CHANGELOG.md
122
122
  post_install_message:
123
123
  rdoc_options: []
124
124
  require_paths: