deterministic 0.15.2 → 0.15.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70b4013b20820efd41949d10c8bcb0706b514d12
|
4
|
+
data.tar.gz: cdb7071c05a8001af91c10212a67eceede5106cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30b231a3e818e90d9f49fc5b9932adafe969ccfe8e645cabda707f2e5a13b50efd0e2f07916accb82c53f64e5dd592d85aa2075d21b1859a598c56a7ed9ba91b
|
7
|
+
data.tar.gz: b81e77b351c2fb48c5debfc979db451e5f021bd7cf3d240d101e867e0ae6e9c65ceeb3dd285f88f7332fce58c68db8d0c906dd1734c16c229ba80964c6336de2
|
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# Deterministic
|
2
|
+
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/pzol/deterministic?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
2
3
|
|
3
4
|
[![Gem Version](https://badge.fury.io/rb/deterministic.png)](http://badge.fury.io/rb/deterministic)
|
4
5
|
|
data/lib/deterministic/option.rb
CHANGED
@@ -11,7 +11,7 @@ module Deterministic
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def any?(expr)
|
14
|
-
to_option(expr) { expr.nil? ||
|
14
|
+
to_option(expr) { expr.nil? || (expr.respond_to?(:empty?) && expr.empty?) }
|
15
15
|
end
|
16
16
|
|
17
17
|
def to_option(expr, &predicate)
|
@@ -49,6 +49,8 @@ module Deterministic
|
|
49
49
|
is_a? Option::None
|
50
50
|
end
|
51
51
|
|
52
|
+
alias :empty? :none?
|
53
|
+
|
52
54
|
def value_or(n)
|
53
55
|
match {
|
54
56
|
Some(s) { s }
|
data/lib/deterministic/result.rb
CHANGED
@@ -117,6 +117,7 @@ describe Deterministic::Option do
|
|
117
117
|
expect(described_class.any?({})).to be_none
|
118
118
|
expect(described_class.any?([1])).to eq Some([1])
|
119
119
|
expect(described_class.any?({foo: 1})).to eq Some({foo: 1})
|
120
|
+
expect(described_class.any?(1)).to eq Some(1)
|
120
121
|
end
|
121
122
|
|
122
123
|
it "try!" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deterministic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Zolnierek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|