quickstep 0.1.1 → 0.2.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: cab46143829bdc0368de1f306e07de41bd5baa18fea35d3e63a923939b00b622
4
- data.tar.gz: 9d5ce7cf8a42f5646043b063b2a7088231d000810a2c7a9c3a49c97c425c62d5
3
+ metadata.gz: 1921569838eeeb54a7d482488972ed1723f0b39c4e2c43a709194f320f5b7b90
4
+ data.tar.gz: 9c8bb36b5860a95ef3d4e92bc70d7a85defd161367cc64e091f6c61ee6e32a19
5
5
  SHA512:
6
- metadata.gz: 0ecd3c0af49c519c71d362ab25a10f900f46cbde092172faf30fc54e1f2009061cd8d222faa37a1dae7407260d1c91705c5528d4d17e2515b4a9ab796e3d99ad
7
- data.tar.gz: 54469aa1c84096a97e18e80125b48a114c11a8e2893763ba555e55575128d2e75d12b5d529cbea09fcaf3490250ca474787d029ea009a53486db809f0c00d851
6
+ metadata.gz: 075d2119df7d6a9bc939bb7d6606c28323b3f5d5dc92dfc5e2b49073e1f284292b7be6352a5729c8ec1daa23546231c4388ad9e1086f7baa0e179dc41546c177
7
+ data.tar.gz: 4361eb8d5636ed9d4cc88648fe081acd205d87cd0fccf3f9096da46a5e145df43b25f58086bc07ac4ee839adf38330f8d7d1c4d61c282de6ce2fddf3682514d2
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # Quickstep
5
5
 
6
- QQuickstep is a lightweight business operation tool inspired by [dry-operation](https://github.com/dry-rb/dry-operation). It provides a structured way to execute multi-step operations with built-in success and failure handling.
6
+ Quickstep is a lightweight business operation tool inspired by [dry-operation](https://github.com/dry-rb/dry-operation). It provides a structured way to execute multi-step operations with built-in success and failure handling.
7
7
 
8
8
  ## Installation
9
9
 
@@ -47,8 +47,9 @@ class MyOperation
47
47
  end
48
48
  end
49
49
 
50
- operation = MyOperation.new
51
- result = operation.call(valid: true, value: 5)
50
+ result = MyOperation.new.call(valid: true, value: 5)
51
+ # or
52
+ # result = MyOperation.call(valid: true, value: 5)
52
53
 
53
54
  if result.success?
54
55
  puts "Success: #{result.value}"
@@ -42,11 +42,11 @@ module Quickstep
42
42
  end
43
43
  end
44
44
 
45
- def Success(value)
45
+ def Success(value = :ok)
46
46
  Success.new(value)
47
47
  end
48
48
 
49
- def Failure(value)
49
+ def Failure(value = :error)
50
50
  Failure.new(value)
51
51
  end
52
52
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Quickstep
4
- VERSION = '0.1.1'
4
+ VERSION = '0.2.1'
5
5
  end
data/lib/quickstep.rb CHANGED
@@ -8,6 +8,7 @@ module Quickstep
8
8
 
9
9
  def self.included(base)
10
10
  base.extend(ClassMethods)
11
+ base.prepend(InstanceMethods)
11
12
  end
12
13
 
13
14
  module ClassMethods
@@ -18,6 +19,14 @@ module Quickstep
18
19
  end
19
20
  end
20
21
 
22
+ module InstanceMethods
23
+ def call(*args)
24
+ catch :halt do
25
+ super
26
+ end
27
+ end
28
+ end
29
+
21
30
  def step(result)
22
31
  if result.success?
23
32
  result
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quickstep
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Korepanov
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-04-01 00:00:00.000000000 Z
10
+ date: 2025-05-30 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: |2
13
13
  Quickstep provides a structured way to execute multi-step business operations with built-in success and