caze 0.2.0 → 0.2.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 +9 -1
- data/README.md +2 -2
- data/lib/caze.rb +4 -3
- data/lib/caze/version.rb +1 -1
- data/spec/caze_spec.rb +9 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43eeb61fade546b7defd563a4213927a4c2259e2
|
4
|
+
data.tar.gz: 77a3de82def4f7d885ff4f1195e24841f5887ccb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b61f32601639b4bec51770350468c58f49740327d2df99bf8d7b9ca9700cd4585a2952c864a8d449b4d0a4e73f2fdbe7e05aaf46c38f4d8544ac6785cc770648
|
7
|
+
data.tar.gz: e38452d8574ed90ad1a8a94c9adc63ad9af91f3b69c832ea0dd7ca0fffb1bb403b8ebc1a91eb387a5a128eeba4070414647ac8ca44ff3e9b654a1bf5248cb76c
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,13 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## [0.2.1] - 2016-02-29
|
7
|
+
|
8
|
+
### Change
|
9
|
+
|
10
|
+
- Change the way we raise the errors with the `raise_use_case_exception` option:
|
11
|
+
it does not instantiate the error again, but changes the parent class reference.
|
12
|
+
|
6
13
|
## [0.2.0] - 2016-01-07
|
7
14
|
|
8
15
|
### Change
|
@@ -36,7 +43,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
36
43
|
- Change main methods to define use cases and export them.
|
37
44
|
- Add more details about the API and how to use the lib at README.
|
38
45
|
|
39
|
-
[unreleased]: https://github.com/magnetis/caze/compare/v0.2.
|
46
|
+
[unreleased]: https://github.com/magnetis/caze/compare/v0.2.1...HEAD
|
47
|
+
[0.2.1]: https://github.com/magnetis/caze/compare/v0.2.0...v0.2.1
|
40
48
|
[0.2.0]: https://github.com/magnetis/caze/compare/v0.1.1...v0.2.0
|
41
49
|
[0.1.1]: https://github.com/magnetis/caze/compare/v0.1.0...v0.1.1
|
42
50
|
[0.1.0]: https://github.com/magnetis/caze/compare/v0.0.4...v0.1.0
|
data/README.md
CHANGED
data/lib/caze.rb
CHANGED
@@ -68,10 +68,11 @@ module Caze
|
|
68
68
|
|
69
69
|
error_class = use_case.const_set(demodulized_error_class, base_class)
|
70
70
|
|
71
|
-
|
72
|
-
|
71
|
+
error.define_singleton_method(:class) do
|
72
|
+
error_class
|
73
|
+
end
|
73
74
|
|
74
|
-
raise
|
75
|
+
raise error
|
75
76
|
end
|
76
77
|
end
|
77
78
|
end
|
data/lib/caze/version.rb
CHANGED
data/spec/caze_spec.rb
CHANGED
@@ -2,13 +2,19 @@ require 'spec_helper'
|
|
2
2
|
require 'caze'
|
3
3
|
|
4
4
|
describe Caze do
|
5
|
+
|
5
6
|
before do
|
6
7
|
# Removing constant definitions if they exist
|
7
8
|
# This avoids state to be permanent through tests
|
8
|
-
[:DummyUseCase,
|
9
|
+
[:DummyUseCase,
|
10
|
+
:DummyUseCaseWithParam,
|
11
|
+
:Dummy,
|
12
|
+
:DummyError,
|
13
|
+
:DummyUseCaseTest].each do |const|
|
9
14
|
Object.send(:remove_const, const) if Object.constants.include?(const)
|
10
15
|
end
|
11
16
|
|
17
|
+
class DummyError < StandardError; end
|
12
18
|
class DummyUseCase
|
13
19
|
include Caze
|
14
20
|
|
@@ -48,7 +54,7 @@ describe Caze do
|
|
48
54
|
export :the_question
|
49
55
|
|
50
56
|
def the_question
|
51
|
-
raise
|
57
|
+
raise DummyError.new("We don't know the question")
|
52
58
|
end
|
53
59
|
end
|
54
60
|
|
@@ -134,7 +140,7 @@ describe Caze do
|
|
134
140
|
it 'raises with the namespace of the use case' do
|
135
141
|
expect {
|
136
142
|
namespaced_use_case.the_question
|
137
|
-
}.to raise_error(DummyUseCaseTest::
|
143
|
+
}.to raise_error(DummyUseCaseTest::DummyError)
|
138
144
|
end
|
139
145
|
end
|
140
146
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caze
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philip Sampaio
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|