dry-effects 0.3.1 → 0.4.0

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: abc06cbff85f6545a5b05ebeb778737a316fadf9222c9e98c015e05a91e16cdf
4
- data.tar.gz: 7023b7bc8b4807c957f561706f9cd8215cc181cf37de06ae218ec48fac48f9da
3
+ metadata.gz: 4689f958a2a85578e4e0a3bd536ab47c85537df6782a4e48c9c306c425c7b968
4
+ data.tar.gz: bbcbd08b72281a805c47ea40c75250aedbc755b667e33d9839f51bbb6b7a4658
5
5
  SHA512:
6
- metadata.gz: f240e7f7cf989b27dc384bf2ec84f6a2b021c8f9b76694167a493140d4beb0dfed96fcad700681154362b2cb8569051baf07e849993d8744b91ec24443ba32af
7
- data.tar.gz: 60185bafd1a5f68a771c9bcd971412ca09e4cf5b81da8ea659706b713b1a55a67989ae4f59d8ae1c57adbf006731416a3f9e4c78254637a73e7a24ccd03c7203
6
+ metadata.gz: 1d9a9ec37dff625b770b21a24a10c4ae663bea543b5c9924dc9b4280cfb234b69639dcf82947e53842577aba8a7e93911db938054efa73800480c3ae27185ae5
7
+ data.tar.gz: 844c22f024a56801cf5e351f2e1540d353e570ee7e5b26b94e94e53467605d122408444c32a196fd6c9b773c4d7cdfaaff8c0051d8ca39f4a7c4729d7fa58916
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  <!--- DO NOT EDIT THIS FILE - IT'S AUTOMATICALLY GENERATED VIA DEVTOOLS --->
2
2
 
3
+ ## 0.4.0
4
+
5
+
6
+ ### Changed
7
+
8
+ - This version is compatible with recently released dry-rb dependencies (@flash-gordon)
9
+
10
+ [Compare v0.3.1...main](https://github.com/dry-rb/dry-effects/compare/v0.3.1...main)
11
+
3
12
  ## 0.3.1 2022-10-17
4
13
 
5
14
 
data/dry-effects.gemspec CHANGED
@@ -30,10 +30,10 @@ Gem::Specification.new do |spec|
30
30
 
31
31
  # to update dependencies edit project.yml
32
32
  spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
33
- spec.add_runtime_dependency "dry-container", "~> 0.7", ">= 0.7.2"
34
- spec.add_runtime_dependency "dry-core", "~> 0.9", ">= 0.9"
35
- spec.add_runtime_dependency "dry-inflector", "~> 0.1", ">= 0.1.2"
33
+ spec.add_runtime_dependency "dry-core", "~> 1.0"
34
+ spec.add_runtime_dependency "dry-inflector", "~> 1.0"
36
35
  spec.add_runtime_dependency "dry-initializer", "~> 3.0"
36
+ spec.add_runtime_dependency "zeitwerk", "~> 2.6"
37
37
 
38
38
  spec.add_development_dependency "bundler"
39
39
  spec.add_development_dependency "rake"
@@ -3,8 +3,6 @@
3
3
  module Dry
4
4
  module Effects
5
5
  module Constructors
6
- extend self
7
-
8
6
  # @api public
9
7
  def CurrentTime(**kwargs)
10
8
  if kwargs.empty?
@@ -33,6 +31,8 @@ module Dry
33
31
  def Write(scope, value)
34
32
  Effects::State::State.new(type: :state, name: :write, scope: scope, payload: [value])
35
33
  end
34
+
35
+ instance_methods(false).each { module_function(_1) }
36
36
  end
37
37
  end
38
38
  end
@@ -3,7 +3,7 @@
3
3
  module Dry
4
4
  module Effects
5
5
  class Container
6
- include ::Dry::Container::Mixin
6
+ include Core::Container::Mixin
7
7
  end
8
8
  end
9
9
  end
@@ -19,7 +19,7 @@ module Dry
19
19
 
20
20
  super(
21
21
  Undefined.default(message) {
22
- "Effect #{effect.inspect} not handled. "\
22
+ "Effect #{effect.inspect} not handled. " \
23
23
  "Effects must be wrapped with corresponding handlers"
24
24
  }
25
25
  )
@@ -31,7 +31,7 @@ module Dry
31
31
  # @api private
32
32
  class MissingStateError < UnhandledEffectError
33
33
  def initialize(effect)
34
- message = "Value of +#{effect.scope}+ is not set, "\
34
+ message = "Value of +#{effect.scope}+ is not set, " \
35
35
  "you need to provide value with an effect handler"
36
36
 
37
37
  super(effect, message)
@@ -45,8 +45,8 @@ module Dry
45
45
  include Error
46
46
 
47
47
  def initialize(effect)
48
- message = "+#{effect.scope}+ is not defined, you need to assign it first "\
49
- "by using a writer, passing initial value to the handler, or "\
48
+ message = "+#{effect.scope}+ is not defined, you need to assign it first " \
49
+ "by using a writer, passing initial value to the handler, or " \
50
50
  "providing a fallback value"
51
51
 
52
52
  super(message)
@@ -1,12 +1,17 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "concurrent/map"
4
- require "dry/auto_inject/strategies/constructor"
4
+ require "dry/auto_inject"
5
+ require "dry/auto_inject/version"
6
+
7
+ if Gem::Version.new(Dry::AutoInject::VERSION) < Gem::Version.new("0.10.0")
8
+ raise RuntimeError, "dry-effects requires dry-auto_inject >= 0.10.0"
9
+ end
5
10
 
6
11
  module Dry
7
12
  module Effects
8
13
  class DryAutoEffectsStrategies
9
- extend ::Dry::Container::Mixin
14
+ extend Core::Container::Mixin
10
15
 
11
16
  class Base < AutoInject::Strategies::Constructor
12
17
  private
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module Effects
5
- VERSION = "0.3.1"
5
+ VERSION = "0.4.0"
6
6
  end
7
7
  end
data/lib/dry/effects.rb CHANGED
@@ -4,7 +4,6 @@ require "zeitwerk"
4
4
  require "concurrent/map"
5
5
 
6
6
  require "dry/core"
7
- require "dry/container"
8
7
  require "dry/inflector"
9
8
  require "dry/initializer"
10
9
 
@@ -35,7 +34,7 @@ module Dry
35
34
  loader.ignore(
36
35
  "#{root}/dry-effects.rb",
37
36
  "#{root}/dry/effects/{all,error,extensions,inflector,initializer,version}.rb",
38
- "#{root}/dry/effects/extensions/**/*.rb",
37
+ "#{root}/dry/effects/extensions/**/*.rb"
39
38
  )
40
39
  end
41
40
  end
data/lib/dry-effects.rb CHANGED
@@ -1 +1,3 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "dry/effects"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-effects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikita Shilnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-10-17 00:00:00.000000000 Z
11
+ date: 2022-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -25,79 +25,61 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: dry-container
28
+ name: dry-core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.7'
34
- - - ">="
35
- - !ruby/object:Gem::Version
36
- version: 0.7.2
33
+ version: '1.0'
37
34
  type: :runtime
38
35
  prerelease: false
39
36
  version_requirements: !ruby/object:Gem::Requirement
40
37
  requirements:
41
38
  - - "~>"
42
39
  - !ruby/object:Gem::Version
43
- version: '0.7'
44
- - - ">="
45
- - !ruby/object:Gem::Version
46
- version: 0.7.2
40
+ version: '1.0'
47
41
  - !ruby/object:Gem::Dependency
48
- name: dry-core
42
+ name: dry-inflector
49
43
  requirement: !ruby/object:Gem::Requirement
50
44
  requirements:
51
45
  - - "~>"
52
46
  - !ruby/object:Gem::Version
53
- version: '0.9'
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: '0.9'
47
+ version: '1.0'
57
48
  type: :runtime
58
49
  prerelease: false
59
50
  version_requirements: !ruby/object:Gem::Requirement
60
51
  requirements:
61
52
  - - "~>"
62
53
  - !ruby/object:Gem::Version
63
- version: '0.9'
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: '0.9'
54
+ version: '1.0'
67
55
  - !ruby/object:Gem::Dependency
68
- name: dry-inflector
56
+ name: dry-initializer
69
57
  requirement: !ruby/object:Gem::Requirement
70
58
  requirements:
71
59
  - - "~>"
72
60
  - !ruby/object:Gem::Version
73
- version: '0.1'
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- version: 0.1.2
61
+ version: '3.0'
77
62
  type: :runtime
78
63
  prerelease: false
79
64
  version_requirements: !ruby/object:Gem::Requirement
80
65
  requirements:
81
66
  - - "~>"
82
67
  - !ruby/object:Gem::Version
83
- version: '0.1'
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- version: 0.1.2
68
+ version: '3.0'
87
69
  - !ruby/object:Gem::Dependency
88
- name: dry-initializer
70
+ name: zeitwerk
89
71
  requirement: !ruby/object:Gem::Requirement
90
72
  requirements:
91
73
  - - "~>"
92
74
  - !ruby/object:Gem::Version
93
- version: '3.0'
75
+ version: '2.6'
94
76
  type: :runtime
95
77
  prerelease: false
96
78
  version_requirements: !ruby/object:Gem::Requirement
97
79
  requirements:
98
80
  - - "~>"
99
81
  - !ruby/object:Gem::Version
100
- version: '3.0'
82
+ version: '2.6'
101
83
  - !ruby/object:Gem::Dependency
102
84
  name: bundler
103
85
  requirement: !ruby/object:Gem::Requirement