ucasy 0.0.1 → 0.0.2

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: 17ebb25fba3f59ded4ef25011e7f2d43854619c775f9c2f2b2c3b64ac9bccd51
4
- data.tar.gz: 99d93a1383bc0ec0695cd432c6016b7fc80677b8f198188de12e87643b885efd
3
+ metadata.gz: 579a7ac4d3d222df1535dadf2352e99b69a72f41f2b33d70e748f11d9b562ff7
4
+ data.tar.gz: 825e8e267a7087611e29fa173b6b00477fcca240c4da7fe33151aeeafad72292
5
5
  SHA512:
6
- metadata.gz: a33b805568f830558b8fa1755794bf476dd14fb9b3153d9dda2ec8009abb89c4cf3758547f43f304b956c46e960c05bbc627ab155ee8b18aef809b14142ce39c
7
- data.tar.gz: 0152edaa9a8d096e02be2acabacf97500b9117ac6ce6f310cd218ca1074d8843d75baa5e8f6600e3894efdaf4dbed7a398b627cb222bd4f598050bd5b433f1e1
6
+ metadata.gz: c1f453e111862cc23389970856e7470d59941f5f2deb5a2606ef859efab9cd4d02ad2a7422b94acc2c63b54f3dca7e250dcb6526b16f2bb33cfcfb54388fecc2
7
+ data.tar.gz: 154209e11e77b21474c931812cda02a5cf3e9c8ea828bf99a529c334973daa668b25a8cabfed11dedea658c8ff4a4b03e596c4a8e11e2047ed72a8453be9522f
@@ -11,10 +11,10 @@ module Ucasy
11
11
  private
12
12
 
13
13
  def use_case_path
14
- Rails.root.join("app/#{GENERATOR_FOLDER_NAME}/use_case_base.rb")
14
+ Rails.root.join("app/#{generator_folder_name}/use_case_base.rb")
15
15
  end
16
16
 
17
- def GENERATOR_FOLDER_NAME
17
+ def generator_folder_name
18
18
  return Ucasy::GENERATOR_FOLDER_NAME if defined?(Ucasy::GENERATOR_FOLDER_NAME)
19
19
 
20
20
  Ucasy::DEFAULT_GENERATOR_FOLDER_NAME
data/lib/ucasy/base.rb CHANGED
@@ -3,6 +3,8 @@ require_relative "failure"
3
3
 
4
4
  module Ucasy
5
5
  class Base
6
+ include Ucasy::Callable
7
+
6
8
  class << self
7
9
  def call(context)
8
10
  new(context).perform
@@ -34,10 +36,6 @@ module Ucasy
34
36
  self
35
37
  end
36
38
 
37
- def call
38
- raise StandardError, "You must implement call method"
39
- end
40
-
41
39
  private
42
40
 
43
41
  attr_reader :context
@@ -0,0 +1,7 @@
1
+ module Ucasy
2
+ module Callable
3
+ def call
4
+ raise NotImplementedError, "You must implement call method"
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ module Ucasy
2
+ class KeywordBase
3
+ include Ucasy::Callable
4
+
5
+ def self.call(**)
6
+ new(**).call
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Ucasy
2
+ class PositionalBase
3
+ include Ucasy::Callable
4
+
5
+ def self.call(*)
6
+ new(*).call
7
+ end
8
+ end
9
+ end
data/lib/ucasy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ucasy
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/ucasy.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require_relative "ucasy/version"
2
+ require_relative "ucasy/callable"
2
3
  require_relative "ucasy/base"
3
4
  require_relative "ucasy/flow"
4
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ucasy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lavenda Software
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-05 00:00:00.000000000 Z
11
+ date: 2024-05-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -29,9 +29,12 @@ files:
29
29
  - lib/generators/ucasy/install/templates/use_case_base.rb
30
30
  - lib/ucasy.rb
31
31
  - lib/ucasy/base.rb
32
+ - lib/ucasy/callable.rb
32
33
  - lib/ucasy/context.rb
33
34
  - lib/ucasy/failure.rb
34
35
  - lib/ucasy/flow.rb
36
+ - lib/ucasy/keyword_base.rb
37
+ - lib/ucasy/positional_base.rb
35
38
  - lib/ucasy/version.rb
36
39
  - sig/ucasy/spec.rbs
37
40
  - ucasy.gemspec