piped_ruby 0.0.1 → 0.1.0

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: c8cf484b015b502fda1ebe09ebe689199fa4bd1a
4
- data.tar.gz: 1d62fe61ff80bb2ce296526539f420d2d9c06f4d
3
+ metadata.gz: 005c1764bc7845f7f02b2828042107818c715627
4
+ data.tar.gz: 07a97f6a1b1dfdeb7079a9ae1aeac0e76d75aba9
5
5
  SHA512:
6
- metadata.gz: 74c8ef75d5ac7e81c1822fd6fe64df32545d64735fa0ea2c8bbc8c31c99f566c9c263976f5cd91b0cdf20fb2b25c61c3a524a4fdbe1f21013c8e86f2dd34f1af
7
- data.tar.gz: 4942d0acd328ee013df66f5bb1657cd8f8e24ee4714a55fcd9b7b3a7d33509560bc805775f3c93c174e8d6b29967ef490d8262f1b67e34b5558ea2fd05ee4486
6
+ metadata.gz: 8ae57b57993db4e0f843c252698a348230d962a8429e092d1639da3e541acd746088f49e81c82094b40cb876eb3adadf1d3051f90afad9d67476572d2f45158c
7
+ data.tar.gz: d01316c53748dc6461dd503efa5ef36ad8f9d8f4d7c336f929df0399f63e5e6c4c0001e2827f87b674c6785967a4005dfe0a823a9ef436a0237cfa7885da445c
data/README.md CHANGED
@@ -39,7 +39,7 @@ Print max element of a given array:
39
39
  array = [1, 3, 2, 5]
40
40
  -> { array }.| { |e| e.length == 4 ? e.push(4) : e }
41
41
  .| { |e| e.max }
42
- .| { |e| puts e } # Prints: 5
42
+ .| { |e| puts e } # 5
43
43
  ```
44
44
 
45
45
  Making some fun with strings:
@@ -55,7 +55,7 @@ end
55
55
  .| { |e| e * 21 }
56
56
  .| { |e| Foo.answer(e) }
57
57
  .| { |e| e + ' :-)' }
58
- .| { |e| puts(e) } # Prints: So the answer of the life, the universe and everything is... 42! :-)"
58
+ .| { |e| puts(e) } # So the answer of the life, the universe and everything is... 42! :-)"
59
59
  ```
60
60
 
61
61
 
data/bin/console CHANGED
@@ -1,14 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "piped_ruby"
3
+ require 'bundler/setup'
4
+ require 'piped_ruby'
5
+ require 'irb'
5
6
 
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
7
  IRB.start
@@ -1,3 +1,3 @@
1
1
  module PipedRuby
2
- VERSION = '0.0.1'
2
+ VERSION = '0.1.0'
3
3
  end
data/lib/piped_ruby.rb CHANGED
@@ -8,6 +8,10 @@ module PipedRuby
8
8
  chained.piped = chained.call(piped)
9
9
  chained
10
10
  end
11
+
12
+ def unwrap
13
+ piped || call
14
+ end
11
15
  end
12
16
 
13
17
  Proc.send :include, PipedRuby
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piped_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tiago Guedes
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-31 00:00:00.000000000 Z
11
+ date: 2016-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler