trailblazer-operation 0.0.2 → 0.0.3
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 +4 -4
- data/.gitignore +17 -0
- data/CHANGES.md +4 -13
- data/lib/trailblazer/operation/result.rb +2 -1
- data/lib/trailblazer/operation/version.rb +1 -3
- data/test/gemfiles/Gemfile.ruby-1.9 +2 -0
- data/test/gemfiles/Gemfile.ruby-1.9.lock +2 -1
- data/test/result_test.rb +6 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 024692c54e2cd96083ce9646b34a081ca96fe0c4
|
4
|
+
data.tar.gz: 5c70e52676a9f29238e373ea327429a773e98bc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d58111c3bd7d8f78a867a36b25caedffb1fdd8b4fd0d8a1bd44451c5f5a2b1ead27aa917239e8b40a98bd73aad915592e5e4b26845a556cec5c45021287aff4b
|
7
|
+
data.tar.gz: 09e44c9e7fad270accfa3358a7010fc17aa09840668c8565eeab8b0ea02c23cf909d7e35281c331687eb03879f8fcbb1c441e66606fc8d31af1820e3fd834be6
|
data/.gitignore
ADDED
data/CHANGES.md
CHANGED
@@ -1,16 +1,7 @@
|
|
1
|
-
## 0.0.
|
2
|
-
|
3
|
-
* Works.
|
4
|
-
|
1
|
+
## 0.0.3
|
5
2
|
|
6
|
-
|
3
|
+
* Add `#inspect(slices)`.
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
res = Op.()
|
12
|
-
res.auth { redirect_to "/login" }
|
13
|
-
res.double ( flash[:error] = "Record exist" }
|
14
|
-
res.success { redirect_to res.model.path }
|
5
|
+
## 0.0.2
|
15
6
|
|
16
|
-
|
7
|
+
* Works.
|
@@ -16,7 +16,8 @@ class Trailblazer::Operation
|
|
16
16
|
end
|
17
17
|
|
18
18
|
# DISCUSS: the two methods below are more for testing.
|
19
|
-
def inspect
|
19
|
+
def inspect(*slices)
|
20
|
+
return "<Result:#{success?} #{slice(*slices).inspect} >" if slices.any?
|
20
21
|
"<Result:#{success?} #{@data.inspect} >"
|
21
22
|
end
|
22
23
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../../
|
3
3
|
specs:
|
4
|
-
trailblazer-operation (
|
4
|
+
trailblazer-operation (0.0.2)
|
5
5
|
declarative
|
6
6
|
pipetree (>= 0.0.4, < 0.1.0)
|
7
7
|
uber (>= 0.1.0, < 0.2.0)
|
@@ -21,6 +21,7 @@ PLATFORMS
|
|
21
21
|
|
22
22
|
DEPENDENCIES
|
23
23
|
bundler
|
24
|
+
declarative
|
24
25
|
minitest
|
25
26
|
rake
|
26
27
|
trailblazer-operation!
|
data/test/result_test.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
require "test_helper"
|
2
2
|
|
3
3
|
class ResultTest < Minitest::Spec
|
4
|
-
|
4
|
+
Result = Trailblazer::Operation::Result
|
5
|
+
let (:success) { Result.new(true, "x"=> String) }
|
5
6
|
it { success.success?.must_equal true }
|
6
7
|
it { success.failure?.must_equal false }
|
7
8
|
# it { success["success?"].must_equal true }
|
@@ -9,7 +10,11 @@ class ResultTest < Minitest::Spec
|
|
9
10
|
it { success["x"].must_equal String }
|
10
11
|
it { success["not-existant"].must_equal nil }
|
11
12
|
it { success.slice("x").must_equal [String] }
|
13
|
+
|
14
|
+
#---
|
15
|
+
# inspect
|
12
16
|
it { success.inspect.must_equal %{<Result:true {\"x\"=>String} >} }
|
17
|
+
it { Result.new(true, "x"=> true, "y"=>1, "z"=>2).inspect("z", "y").must_equal %{<Result:true [2, 1] >} }
|
13
18
|
|
14
19
|
class Create < Trailblazer::Operation
|
15
20
|
self.> ->(input, options) { input.call }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trailblazer-operation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Sutterer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: uber
|
@@ -113,6 +113,7 @@ executables: []
|
|
113
113
|
extensions: []
|
114
114
|
extra_rdoc_files: []
|
115
115
|
files:
|
116
|
+
- ".gitignore"
|
116
117
|
- ".travis.yml"
|
117
118
|
- CHANGES.md
|
118
119
|
- Gemfile
|