yield_self 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +4 -2
- data/lib/yield_self.rb +2 -0
- data/lib/yield_self/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aed6fb6b3421e03b7283d85d58363aadd40df3d0
|
4
|
+
data.tar.gz: be163f1e2d7eaa80c5ddd38d3c3ca7bb19c9c687
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16cfac9804a9dff5a4c909efe95d04d4968748bc8b566eb1dc7784413bcb7af4a14bc13e63b2bfca5025416d3105d03b4478154828dd6ffb72fe85ed3d26beb0
|
7
|
+
data.tar.gz: da7ca39779d182867d30497b99a5775ad3ff10891034de63b6d25a0dd4147b2f099a598b1afff853fe17074b2544989c5dd2812369abc9b5928d9d66607d1bbb
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
# yield_self
|
2
2
|
|
3
|
-
This gem implements the `Object#yield_self` method that is
|
4
|
-
for earlier versions of ruby.
|
3
|
+
This gem implements the `Object#yield_self` method that is in Ruby 2.5
|
4
|
+
for earlier versions of Ruby. The `#then` alias that is [coming](https://bugs.ruby-lang.org/issues/14594)
|
5
|
+
in Ruby 2.6 is also supported.
|
5
6
|
|
6
7
|
`#yield_self` is like `#tap` but returns the result of the block instead of `self`:
|
7
8
|
|
8
9
|
```ruby
|
9
10
|
42.tap { |num| num.to_s } #=> 42
|
10
11
|
42.yield_self { |num| num.to_s } #=> "42"
|
12
|
+
42.then { |num| num.to_s } #=> "42"
|
11
13
|
```
|
12
14
|
|
13
15
|
## Installation
|
data/lib/yield_self.rb
CHANGED
data/lib/yield_self/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yield_self
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Perkins
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|