pipeable 0.0.1 → 0.2.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.
data/README.md DELETED
@@ -1,46 +0,0 @@
1
- # Pipeable
2
-
3
- A play at Unix Piping in Ruby for kicks. It helps to break up some more exotic logic and chaining.
4
-
5
- It can be used to play with a value in a method chain and return whatever you want out of the block. Personally I'm
6
- still toying with how it can be used and working to find clever tricks with it.
7
-
8
- _That being said, this is a 5 minute hack. You've been warned._
9
-
10
- Piping is simple, we take the object and put a pipe on it:
11
- ```ruby
12
- 1.pipe { |x| "#{x} is great!" }
13
- # => '1 is great!'
14
- ```
15
-
16
- How do you get going with pipe?
17
- ```ruby
18
- include Pipeable
19
- ```
20
- ...and your object is ready to go!
21
-
22
- ## Installation
23
-
24
- Add this line to your application's Gemfile:
25
-
26
- gem 'pipeable'
27
-
28
- And then execute:
29
-
30
- $ bundle
31
-
32
- Or install it yourself as:
33
-
34
- $ gem install pipeable
35
-
36
- ## Usage
37
-
38
- Slap a pipe on the end of it!
39
-
40
- ## Contributing
41
-
42
- 1. Fork it ( http://github.com/baweaver/pipeable/fork )
43
- 2. Create your feature branch (`git checkout -b my-new-feature`)
44
- 3. Commit your changes (`git commit -am 'Add some feature'`)
45
- 4. Push to the branch (`git push origin my-new-feature`)
46
- 5. Create new Pull Request
data/Rakefile DELETED
@@ -1 +0,0 @@
1
- require "bundler/gem_tasks"
@@ -1,3 +0,0 @@
1
- module Pipeable
2
- VERSION = "0.0.1"
3
- end
@@ -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
data/spec/spec_helper.rb DELETED
@@ -1,11 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler/setup'
3
-
4
- require 'pipeable'
5
-
6
- require 'coveralls'
7
- Coveralls.wear!
8
-
9
- RSpec.configure do |config|
10
- # some (optional) config here
11
- end