errant 0.1.0 → 0.1.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
  SHA1:
3
- metadata.gz: 5cf9bea1f6e820bc615f1f19022b2737c38282a5
4
- data.tar.gz: 4946860065de094c97ffc01d13dc9d41777bb19f
3
+ metadata.gz: fadc5fce8f288ff4f7d5a67bd3857e7bcf85623c
4
+ data.tar.gz: d2db0b25e710994c9dd44a71a9489bd95924763b
5
5
  SHA512:
6
- metadata.gz: f017a3b8672dbf979864a69633ba3eaf4343c40e42c6db1af0c69eb81ac854a48a0d2b23763129d9e57d70dd58801eccc45b003960988c80e94c9a03377a9031
7
- data.tar.gz: f1f7955c190a4fac7a504a88a5099271864f480490aaea9309e692c52bc674154349595a53e478eee79feab6b6449e40e9c65306c96038d2a0509c2d92330c05
6
+ metadata.gz: 01822a235c8b75a11e4756bb00289757d88128ee8622169b2c8ef37fda2e086c92e9de1f8c19c6816a03cff50dbfdb9260e48c262972c650175bb51911977c27
7
+ data.tar.gz: 7f9ae1f650665ae6a8bda03bcb7ebda7575d92755964364283fe2411e6319719880560f5745183cb5aac7e4bfd19055f2418f93b9e5f0cea5d8e164fe956be76
@@ -1,9 +1,10 @@
1
1
  module Errant
2
2
  class Failure < Result
3
- attr_reader :value
3
+ attr_reader :exceptions, :value
4
4
 
5
- def initialize(value)
6
- @value = value
5
+ def initialize(value, exc = Result::DEFAULT_EXCEPTIONS)
6
+ @value = value
7
+ @exceptions = exc
7
8
  end
8
9
 
9
10
  def method_missing(name, *args, &block)
@@ -42,8 +43,8 @@ class Failure < Result
42
43
  signal
43
44
  end
44
45
 
45
- def self.[](value)
46
- Failure.new(value)
46
+ def self.[](value, exc = Result::DEFAULT_EXCEPTIONS)
47
+ Failure.new(value, exc)
47
48
  end
48
49
 
49
50
  private
@@ -12,7 +12,7 @@ class Success < Result
12
12
  res = __enumerable_value.send(enumerable_method, *args, &block)
13
13
  res.respond_to?(:each) ? __copy[res.first] : __copy[res]
14
14
  rescue *exceptions => e
15
- Failure[e]
15
+ Failure[e, exceptions]
16
16
  rescue FailureSignal => signal
17
17
  signal.failure
18
18
  end
@@ -1,3 +1,3 @@
1
1
  module Errant
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: errant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Hyde
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-12-28 00:00:00.000000000 Z
11
+ date: 2015-12-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler