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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 35d38673f50ede6ee4e40b4b5f3a9af338fe9043
4
- data.tar.gz: 79d1458bad105daedf9f2e9d1989e3b83f91e1f4
3
+ metadata.gz: aed6fb6b3421e03b7283d85d58363aadd40df3d0
4
+ data.tar.gz: be163f1e2d7eaa80c5ddd38d3c3ca7bb19c9c687
5
5
  SHA512:
6
- metadata.gz: 90379ceaee1e8952f837caf41b396626ce291a92756344c1109d34e939541cb7b690bff5acd63f39317bfa79d4b63d7ee610a44fb41f43c69517cbeb6a83693c
7
- data.tar.gz: '0439af015b1ea18995e59fc696008d49c862a5920c683ab7460b50eb8630c27a6099836f31a89827ca232dc54798a7caaa48b3cfd73b2160e62e17d6f3859d39'
6
+ metadata.gz: 16cfac9804a9dff5a4c909efe95d04d4968748bc8b566eb1dc7784413bcb7af4a14bc13e63b2bfca5025416d3105d03b4478154828dd6ffb72fe85ed3d26beb0
7
+ data.tar.gz: da7ca39779d182867d30497b99a5775ad3ff10891034de63b6d25a0dd4147b2f099a598b1afff853fe17074b2544989c5dd2812369abc9b5928d9d66607d1bbb
@@ -1,4 +1,7 @@
1
1
  # yield_self
2
2
 
3
+ ## v0.2.0
4
+ - Add support for `then` as an alias for `yield_self`.
5
+
3
6
  ## v0.1.0
4
7
  - Initial version
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 [coming](https://bugs.ruby-lang.org/issues/6721) in Ruby 2.5
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
@@ -4,4 +4,6 @@ module YieldSelf
4
4
  def yield_self
5
5
  yield(self)
6
6
  end
7
+
8
+ alias_method :then, :yield_self
7
9
  end
@@ -1,3 +1,3 @@
1
1
  module YieldSelf
2
- VERSION = "0.1.0".freeze
2
+ VERSION = "0.2.0".freeze
3
3
  end
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.1.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: 2017-10-14 00:00:00.000000000 Z
11
+ date: 2018-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler