codequest_pipes 0.2.0 → 0.3.0
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/README.md +3 -4
- data/codequest_pipes.gemspec +2 -2
- data/lib/codequest_pipes/context.rb +9 -1
- data/lib/codequest_pipes/pipe.rb +1 -1
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8927148db159660b6ead2c27a563bad7549d0a09
|
4
|
+
data.tar.gz: 19984aa1944dcfeb4f25f98a4e094d7d7a30d726
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c21098b3a8f6a3c58fe20b811601a242a2cbec7804ddc238033d7098cd9b8dd37d4d51889329408e998f32c9f2a5dacc57d99af852ee3519c16f7171c1639e39
|
7
|
+
data.tar.gz: 42650f5652b26974040cda7f82db6860c09d69f616ecc3a2bf378947df5735e3304a5843023f09983373ab17c5825329655309e3728bbfc008807b15882bd328
|
data/README.md
CHANGED
@@ -4,11 +4,10 @@ Pipes provide a Unix-like way to chain business objects (interactors) in Ruby.
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
To start using Pipes, add the library to your Gemfile
|
8
|
-
not available on RubyGems.
|
7
|
+
To start using Pipes, add the library to your `Gemfile` and run `bundle install`.
|
9
8
|
|
10
9
|
```ruby
|
11
|
-
gem
|
10
|
+
gem 'codequest_pipes'
|
12
11
|
```
|
13
12
|
|
14
13
|
## High-level usage example
|
@@ -45,7 +44,7 @@ Note how we've only had to implement the `call` method for the magic to start ha
|
|
45
44
|
|
46
45
|
Each Pipe requires an instance `Pipes::Context` to be passed on `.call` invokation. It provides append-only data container for Pipes: you can add data to a context at any time using the `add` method but the same call will raise an error if you try to modify an existing key.
|
47
46
|
|
48
|
-
Made with
|
47
|
+
Made with ❤️ by [code quest](http://www.codequest.com)
|
49
48
|
|
50
49
|
|
51
50
|
|
data/codequest_pipes.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'codequest_pipes'
|
5
|
-
spec.version = '0.
|
5
|
+
spec.version = '0.3.0'
|
6
6
|
|
7
7
|
spec.author = 'codequest'
|
8
8
|
spec.email = 'hello@codequest.com'
|
@@ -14,6 +14,6 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.files = `git ls-files`.split($RS)
|
15
15
|
spec.test_files = spec.files.grep(/^spec/)
|
16
16
|
|
17
|
-
spec.add_development_dependency 'bundler', '>= 1.6.9'
|
17
|
+
spec.add_development_dependency 'bundler', '~> 1.6', '>= 1.6.9'
|
18
18
|
spec.add_development_dependency 'rake', '~> 10.3'
|
19
19
|
end
|
@@ -32,6 +32,14 @@ module Pipes
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
+
# Quietly fail the pipe, allowing the error to be saved and accessed from
|
36
|
+
# the Context.
|
37
|
+
#
|
38
|
+
# @param error [Any] Error to be set.
|
39
|
+
def halt(error = 'Execution stopped')
|
40
|
+
@error = error
|
41
|
+
end
|
42
|
+
|
35
43
|
# Explicitly fail the pipe, allowing the error to be saved and accessed from
|
36
44
|
# the Context.
|
37
45
|
#
|
@@ -39,7 +47,7 @@ module Pipes
|
|
39
47
|
#
|
40
48
|
# @raise [ExecutionTerminated]
|
41
49
|
def terminate(error)
|
42
|
-
|
50
|
+
halt(error)
|
43
51
|
fail ExecutionTerminated, error
|
44
52
|
end
|
45
53
|
|
data/lib/codequest_pipes/pipe.rb
CHANGED
metadata
CHANGED
@@ -1,19 +1,22 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codequest_pipes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- codequest
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.6'
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
22
|
version: 1.6.9
|
@@ -21,6 +24,9 @@ dependencies:
|
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.6'
|
24
30
|
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
32
|
version: 1.6.9
|