trailblazer-operation 0.0.2 → 0.0.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: f87d954977f1411476bf2e2e5dfb93eb611fa285
4
- data.tar.gz: 8faa3e771214751c0b5eca3c2546a24ef1ffe589
3
+ metadata.gz: 024692c54e2cd96083ce9646b34a081ca96fe0c4
4
+ data.tar.gz: 5c70e52676a9f29238e373ea327429a773e98bc0
5
5
  SHA512:
6
- metadata.gz: c401fdbdb86bee4af234a1a9cbc3cc08c7062dda7bc264eb2d899d3b8ee1ac463d8a3a0f76a9a9504e21ad7f3d4268d7cc74dadf2196910fdd2022923328f598
7
- data.tar.gz: 4faa6d2eef74f061c2125952b618ac6eda7aad652153e3550c0d645bcc42dab78b54b039fe898d9518c4aa27b6bcb1d910cc2b6586028d6b40ff7397a55e0ff2
6
+ metadata.gz: d58111c3bd7d8f78a867a36b25caedffb1fdd8b4fd0d8a1bd44451c5f5a2b1ead27aa917239e8b40a98bd73aad915592e5e4b26845a556cec5c45021287aff4b
7
+ data.tar.gz: 09e44c9e7fad270accfa3358a7010fc17aa09840668c8565eeab8b0ea02c23cf909d7e35281c331687eb03879f8fcbb1c441e66606fc8d31af1820e3fd834be6
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ lib/bundler/man
11
+ pkg
12
+ rdoc
13
+ spec/reports
14
+ test/tmp
15
+ test/version_tmp
16
+ tmp
17
+ /**/*.log
data/CHANGES.md CHANGED
@@ -1,16 +1,7 @@
1
- ## 0.0.2
2
-
3
- * Works.
4
-
1
+ ## 0.0.3
5
2
 
6
- ## TODO:
3
+ * Add `#inspect(slices)`.
7
4
 
8
- * test and assure it still works in ruby 1.9.
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
- endpoint: new layer for presentation/reaction
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,5 @@
1
1
  module Trailblazer
2
- # The Trailblazer-style operation.
3
- # Note that you don't have to use our "opinionated" version with result object, skills, etc.
4
2
  class Operation
5
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
6
4
  end
7
5
  end
@@ -1,2 +1,4 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec path: "../../"
3
+
4
+ gem "declarative"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ../../
3
3
  specs:
4
- trailblazer-operation (2.0.0)
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
- let (:success) { Trailblazer::Operation::Result.new(true, "x"=> String) }
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.2
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-10 00:00:00.000000000 Z
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