pipeable 0.0.1 → 0.1.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 +5 -5
- checksums.yaml.gz.sig +0 -0
- data/LICENSE.adoc +134 -0
- data/README.adoc +574 -0
- data/lib/pipeable/composable.rb +12 -0
- data/lib/pipeable/pipe.rb +16 -0
- data/lib/pipeable/stepable.rb +51 -0
- data/lib/pipeable/steps/abstract.rb +25 -0
- data/lib/pipeable/steps/as.rb +12 -0
- data/lib/pipeable/steps/bind.rb +10 -0
- data/lib/pipeable/steps/check.rb +30 -0
- data/lib/pipeable/steps/container.rb +26 -0
- data/lib/pipeable/steps/fmap.rb +10 -0
- data/lib/pipeable/steps/insert.rb +27 -0
- data/lib/pipeable/steps/map.rb +10 -0
- data/lib/pipeable/steps/merge.rb +27 -0
- data/lib/pipeable/steps/or.rb +10 -0
- data/lib/pipeable/steps/tee.rb +22 -0
- data/lib/pipeable/steps/to.rb +27 -0
- data/lib/pipeable/steps/try.rb +23 -0
- data/lib/pipeable/steps/use.rb +19 -0
- data/lib/pipeable/steps/validate.rb +28 -0
- data/lib/pipeable.rb +16 -3
- data/pipeable.gemspec +30 -18
- data.tar.gz.sig +0 -0
- metadata +121 -49
- metadata.gz.sig +0 -0
- data/.gitignore +0 -17
- data/.travis.yml +0 -1
- data/Gemfile +0 -5
- data/LICENSE.txt +0 -22
- data/README.md +0 -46
- data/Rakefile +0 -1
- data/lib/pipeable/version.rb +0 -3
- data/spec/pipeable_spec.rb +0 -27
- data/spec/spec_helper.rb +0 -11
data/lib/pipeable/version.rb
DELETED
data/spec/pipeable_spec.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'ostruct'
|
3
|
-
|
4
|
-
# Monkey Patch it in
|
5
|
-
class Object
|
6
|
-
include Pipeable
|
7
|
-
end
|
8
|
-
|
9
|
-
describe 'Pipeable' do
|
10
|
-
context 'When used with an Integer' do
|
11
|
-
it 'returns 100 when piped multiple times' do
|
12
|
-
value = 1.pipe { |v| v * 10 }.pipe { |v| v * 10 }
|
13
|
-
|
14
|
-
expect(value).to eq(100)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
context 'When used with a Person' do
|
19
|
-
let(:person) { OpenStruct.new(name: 'brandon', foo: true, bar: true, baz: true)}
|
20
|
-
|
21
|
-
it 'returns true with conditionals' do
|
22
|
-
value = person.pipe { |me| me.foo && me.bar && me.baz }
|
23
|
-
|
24
|
-
expect(value).to be_true
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|