dry-monads 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: 2d763397f947c61f8b46fa0997e72b24b0c6b896
4
- data.tar.gz: 99c80e46741e351e19f107dd71c01e8a7a66beaf
3
+ metadata.gz: 613808228df63dd17a3199ed374ed227b5286340
4
+ data.tar.gz: df17cfd8dafdee56feb611a0acae4dca01c6a17c
5
5
  SHA512:
6
- metadata.gz: 134d7bc216b65df0b1ed974fc68d04521ec1766c527848c4df473057ae5175e42447cee84073e69b44d4fe3a8a9399918ffb8c7119d6eb65abf0f7aa873d521c
7
- data.tar.gz: b25676d21087677f2a2276b0e09abb3e672ce0d12f4c50aeee88c72afa8aff0d4e6df70ace29efc00b699094b94fe44f14753063d3f63bc2653bc8c50839d5d5
6
+ metadata.gz: be3207f4e98696f3f4abc2f9b72d3c912198a1581492a9190c6d6388d86613484b6577db46138e2725cf2e6bdf078150ba8185586a1d0a8e66e4d528ab6c163d
7
+ data.tar.gz: 5349bf6489ed7ec11b1300858e74a321ec963a7475465560a49318200286632fad5c06dda39e525cf6d7f5d05d3ce56bf5af776dd23543bb7bb123d8f3d066a4
@@ -1,3 +1,11 @@
1
+ # v0.3.1 2017-03-18
2
+
3
+ ## Fixed
4
+
5
+ * Fixed unexpected coercing to `Hash` on `.bind` call (flash-gordon)
6
+
7
+ [Compare v0.3.1...v0.3.0](https://github.com/dry-rb/dry-monads/compare/v0.3.0...v0.3.1)
8
+
1
9
  # v0.3.0 2017-03-16
2
10
 
3
11
  ## Added
@@ -27,6 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ['lib']
28
28
  spec.required_ruby_version = ">= 2.1.0"
29
29
  spec.add_dependency 'dry-equalizer'
30
+ spec.add_dependency 'dry-core'
30
31
 
31
32
  spec.add_development_dependency 'bundler'
32
33
  spec.add_development_dependency 'rake'
@@ -1,7 +1,11 @@
1
+ require 'dry/core/constants'
2
+
1
3
  module Dry
2
4
  module Monads
3
5
  module RightBiased
4
6
  module Right
7
+ include Dry::Core::Constants
8
+
5
9
  attr_reader :value
6
10
 
7
11
  # Calls the passed in Proc object with value stored in self
@@ -19,8 +23,13 @@ module Dry
19
23
  # to this object along with the internal value
20
24
  # @return [Object] result of calling proc or block on the internal value
21
25
  def bind(*args, **kwargs)
22
- vargs, vkwargs = destructure(value)
23
- kw = kwargs.empty? && vkwargs.empty? ? [] : [kwargs.merge(vkwargs)]
26
+ if args.empty? && !kwargs.empty?
27
+ vargs, vkwargs = destructure(value)
28
+ kw = [kwargs.merge(vkwargs)]
29
+ else
30
+ vargs = [value]
31
+ kw = kwargs.empty? ? EMPTY_ARRAY : [kwargs]
32
+ end
24
33
 
25
34
  if block_given?
26
35
  yield(*vargs, *args, *kw)
@@ -1,5 +1,5 @@
1
1
  module Dry
2
2
  module Monads
3
- VERSION = '0.3.0'.freeze
3
+ VERSION = '0.3.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dry-monads
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikita Shilnikov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-03-16 00:00:00.000000000 Z
11
+ date: 2017-03-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-equalizer
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: dry-core
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement