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 +4 -4
- data/CHANGELOG.md +8 -0
- data/dry-monads.gemspec +1 -0
- data/lib/dry/monads/right_biased.rb +11 -2
- data/lib/dry/monads/version.rb +1 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 613808228df63dd17a3199ed374ed227b5286340
|
4
|
+
data.tar.gz: df17cfd8dafdee56feb611a0acae4dca01c6a17c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be3207f4e98696f3f4abc2f9b72d3c912198a1581492a9190c6d6388d86613484b6577db46138e2725cf2e6bdf078150ba8185586a1d0a8e66e4d528ab6c163d
|
7
|
+
data.tar.gz: 5349bf6489ed7ec11b1300858e74a321ec963a7475465560a49318200286632fad5c06dda39e525cf6d7f5d05d3ce56bf5af776dd23543bb7bb123d8f3d066a4
|
data/CHANGELOG.md
CHANGED
data/dry-monads.gemspec
CHANGED
@@ -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
|
-
|
23
|
-
|
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)
|
data/lib/dry/monads/version.rb
CHANGED
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.
|
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-
|
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
|