dry-effects 0.4.0 → 0.4.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: 4689f958a2a85578e4e0a3bd536ab47c85537df6782a4e48c9c306c425c7b968
4
- data.tar.gz: bbcbd08b72281a805c47ea40c75250aedbc755b667e33d9839f51bbb6b7a4658
3
+ metadata.gz: '019d3a5a4ceac14c0bf1fc045315034746b2076f82e17c8cd43d1e4d15453a73'
4
+ data.tar.gz: 7c6bc85d0688ff60a98152a50f0bd27e2ee7cbd45379a33be51584bfad456c3e
5
5
  SHA512:
6
- metadata.gz: 1d9a9ec37dff625b770b21a24a10c4ae663bea543b5c9924dc9b4280cfb234b69639dcf82947e53842577aba8a7e93911db938054efa73800480c3ae27185ae5
7
- data.tar.gz: 844c22f024a56801cf5e351f2e1540d353e570ee7e5b26b94e94e53467605d122408444c32a196fd6c9b773c4d7cdfaaff8c0051d8ca39f4a7c4729d7fa58916
6
+ metadata.gz: 8a900139589cf38dcdacb469021826ade7e435a9229243ae9392b76fc0cfcca6762ef48373e5a2d7b4a16f7ae51cb769c7f1de1559c92c14d8bdd3725def5932
7
+ data.tar.gz: 91d5e392c86b9a91b5bef272914d4a647790606716de5722d4cccd555584bdfb33e7cdaa6fb653ffa870b33f21481fa4a057babf85131077d9a85cca65b25c6d
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.1
4
+
5
+
6
+ ### Changed
7
+
8
+ - Workaround for a clash with Object#with (@tallica + @flash-gordon)
9
+
10
+ [Compare v0.4.0...main](https://github.com/dry-rb/dry-effects/compare/v0.4.0...main)
11
+
3
12
  ## 0.4.0
4
13
 
5
14
 
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2015-2022 dry-rb team
3
+ Copyright (c) 2015-2023 dry-rb team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of
6
6
  this software and associated documentation files (the "Software"), to deal in
data/README.md CHANGED
@@ -1,29 +1,21 @@
1
1
  <!--- this file is synced from dry-rb/template-gem project -->
2
2
  [gem]: https://rubygems.org/gems/dry-effects
3
3
  [actions]: https://github.com/dry-rb/dry-effects/actions
4
- [codacy]: https://www.codacy.com/gh/dry-rb/dry-effects
5
- [chat]: https://dry-rb.zulipchat.com
6
- [inchpages]: http://inch-ci.org/github/dry-rb/dry-effects
7
4
 
8
- # dry-effects [![Join the chat at https://dry-rb.zulipchat.com](https://img.shields.io/badge/dry--rb-join%20chat-%23346b7a.svg)][chat]
9
-
10
- [![Gem Version](https://badge.fury.io/rb/dry-effects.svg)][gem]
11
- [![CI Status](https://github.com/dry-rb/dry-effects/workflows/ci/badge.svg)][actions]
12
- [![Codacy Badge](https://api.codacy.com/project/badge/Grade/158a8a584a3845eba4a67a71ad540210)][codacy]
13
- [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/158a8a584a3845eba4a67a71ad540210)][codacy]
14
- [![Inline docs](http://inch-ci.org/github/dry-rb/dry-effects.svg?branch=main)][inchpages]
5
+ # dry-effects [![Gem Version](https://badge.fury.io/rb/dry-effects.svg)][gem] [![CI Status](https://github.com/dry-rb/dry-effects/workflows/ci/badge.svg)][actions]
15
6
 
16
7
  ## Links
17
8
 
18
9
  * [User documentation](https://dry-rb.org/gems/dry-effects)
19
10
  * [API documentation](http://rubydoc.info/gems/dry-effects)
11
+ * [Forum](https://discourse.dry-rb.org)
20
12
 
21
13
  ## Supported Ruby versions
22
14
 
23
15
  This library officially supports the following Ruby versions:
24
16
 
25
- * MRI `>= 2.7.0`
26
- * jruby `>= 9.3` (postponed until 2.7 is supported)
17
+ * MRI `>= 3.0.0`
18
+ * jruby `>= 9.4` (not tested on CI)
27
19
 
28
20
  ## License
29
21
 
data/dry-effects.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.metadata["source_code_uri"] = "https://github.com/dry-rb/dry-effects"
27
27
  spec.metadata["bug_tracker_uri"] = "https://github.com/dry-rb/dry-effects/issues"
28
28
 
29
- spec.required_ruby_version = ">= 2.7.0"
29
+ spec.required_ruby_version = ">= 3.0.0"
30
30
 
31
31
  # to update dependencies edit project.yml
32
32
  spec.add_runtime_dependency "concurrent-ruby", "~> 1.0"
@@ -6,7 +6,7 @@ module Dry
6
6
  class Resolve < ::Module
7
7
  DependencyNameInvalid = ::Class.new(StandardError)
8
8
 
9
- VALID_NAME = /([a-z_][a-zA-Z_0-9]*)$/.freeze
9
+ VALID_NAME = /([a-z_][a-zA-Z_0-9]*)$/
10
10
 
11
11
  Resolve = Effect.new(type: :resolve)
12
12
 
@@ -2,12 +2,18 @@
2
2
 
3
3
  require "active_support/tagged_logging"
4
4
 
5
- ActiveSupport::TaggedLogging::Formatter.prepend(Module.new {
6
- def current_tags
7
- thread_key = @thread_key ||= "activesupport_tagged_logging_tags:#{object_id}"
8
- unless Thread.current.thread_variable_get(thread_key)
9
- Thread.current.thread_variable_set(thread_key, [])
5
+ begin
6
+ require "active_support/isolated_execution_state"
7
+
8
+ # it's not needed when state is already isolated
9
+ rescue LoadError
10
+ ActiveSupport::TaggedLogging::Formatter.prepend(Module.new {
11
+ def current_tags
12
+ thread_key = @thread_key ||= "activesupport_tagged_logging_tags:#{object_id}"
13
+ unless Thread.current.thread_variable_get(thread_key)
14
+ Thread.current.thread_variable_set(thread_key, [])
15
+ end
16
+ Thread.current.thread_variable_get(thread_key)
10
17
  end
11
- Thread.current.thread_variable_get(thread_key)
12
- end
13
- })
18
+ })
19
+ end
@@ -5,7 +5,7 @@ require "dry/auto_inject"
5
5
  require "dry/auto_inject/version"
6
6
 
7
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"
8
+ raise "dry-effects requires dry-auto_inject >= 0.10.0"
9
9
  end
10
10
 
11
11
  module Dry
@@ -64,9 +64,15 @@ module Dry
64
64
 
65
65
  # @api private
66
66
  def self.extended(base)
67
- base.extend(::Dry::Initializer)
68
- base.extend(DefineWithHook)
69
- base.include(InstanceMethods)
67
+ base.module_eval do
68
+ if method_defined?(:with)
69
+ undef_method(:with)
70
+ end
71
+
72
+ extend(::Dry::Initializer)
73
+ extend(DefineWithHook)
74
+ include(InstanceMethods)
75
+ end
70
76
  end
71
77
 
72
78
  # @api private
@@ -7,7 +7,7 @@ module Dry
7
7
  DEFAULT_RANDOM = ::Random
8
8
  DEFAULT = -> _ { DEFAULT_RANDOM.rand }
9
9
 
10
- DEFAULT_RANGE = (0.0...1.0).freeze
10
+ DEFAULT_RANGE = (0.0...1.0)
11
11
 
12
12
  def rand(range_or_limit = nil)
13
13
  range_or_limit ||= DEFAULT_RANGE
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Dry
4
4
  module Effects
5
- VERSION = "0.4.0"
5
+ VERSION = "0.4.1"
6
6
  end
7
7
  end
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.4.0
4
+ version: 0.4.1
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-11-07 00:00:00.000000000 Z
11
+ date: 2024-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -211,14 +211,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
211
211
  requirements:
212
212
  - - ">="
213
213
  - !ruby/object:Gem::Version
214
- version: 2.7.0
214
+ version: 3.0.0
215
215
  required_rubygems_version: !ruby/object:Gem::Requirement
216
216
  requirements:
217
217
  - - ">="
218
218
  - !ruby/object:Gem::Version
219
219
  version: '0'
220
220
  requirements: []
221
- rubygems_version: 3.1.6
221
+ rubygems_version: 3.3.26
222
222
  signing_key:
223
223
  specification_version: 4
224
224
  summary: Algebraic effects