tapdance 0.1.0 → 0.1.1
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 +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +7 -1
- data/README.md +24 -2
- data/lib/tapdance/version.rb +1 -1
- data/tapdance.gemspec +7 -0
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50ba0bae0af886f261c5a89e2bd64aca5d059e2a
|
4
|
+
data.tar.gz: 6509fe672e7e7478fea37a6eaaa0930bb979b85c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e9cef9d376a37473170933e79f12455552aaaa582b15244fc3217cc5d852bbfb05e020346cb7dfea097d93548d6dbab0f4c14b543906dd5cc5851cff8601a1c
|
7
|
+
data.tar.gz: b4d97514c6e053ae4b64b3445f1c4b701f91dddf9e024e2f5fd0bfc91b617bddec7be794c62f0b43c90d82ab29138cb449b64ce765f36167738c2f887d78b95c
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -4,7 +4,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
4
4
|
|
5
5
|
## [Unreleased][unreleased]
|
6
6
|
|
7
|
-
## 0.
|
7
|
+
## 0.1.1 - 2017-04-03
|
8
|
+
### Added
|
9
|
+
- Nothing really. I just updated the gemspec as an experiment to test the new
|
10
|
+
RubyGems.org changelog_uri metadata parsing so that this changelog can be linked
|
11
|
+
to from the RubyGems.org version page.
|
12
|
+
|
13
|
+
## 0.1.0 - 2014-05-05
|
8
14
|
### Added
|
9
15
|
- A most clever monkey patch.
|
10
16
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Tapdance
|
1
|
+
# Tapdance [![Gem Version][rubygems-image]][rubygems] [![Dependencies][gemnasium-image]][gemnasium] [![Code Climate][codeclimate-image]][codeclimate] [![License][license-image]][license]
|
2
2
|
|
3
3
|
Tapdance makes `Object#tap` dance with `nil`.
|
4
4
|
|
@@ -8,6 +8,15 @@ I mean it totally dances around `nil` and doesn't execute a block argument
|
|
8
8
|
passed to `nil#tap` so that you don't have to check for `nil` inside of the
|
9
9
|
block passed to `tap`.
|
10
10
|
|
11
|
+
It looks like this:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
nil.tap do |yoda|
|
15
|
+
yoda.dance!
|
16
|
+
end
|
17
|
+
=> nil
|
18
|
+
```
|
19
|
+
|
11
20
|
## Is this a good idea?
|
12
21
|
|
13
22
|
Nope.
|
@@ -59,7 +68,7 @@ To avoid this:
|
|
59
68
|
```ruby
|
60
69
|
jedi = nil
|
61
70
|
jedi.tap do |yoda|
|
62
|
-
yoda.
|
71
|
+
yoda.height = 1
|
63
72
|
end
|
64
73
|
NoMethodError: undefined method `height=' for nil:NilClass
|
65
74
|
```
|
@@ -67,12 +76,17 @@ NoMethodError: undefined method `height=' for nil:NilClass
|
|
67
76
|
You can now write this instead:
|
68
77
|
|
69
78
|
```ruby
|
79
|
+
require "tapdance"
|
70
80
|
jedi = nil
|
71
81
|
jedi.tap do |yoda|
|
72
82
|
yoda.height = 1
|
73
83
|
end
|
84
|
+
=> nil
|
74
85
|
```
|
75
86
|
|
87
|
+
Yep, there's no `height` method on `yoda`. Probably because `yoda` is `nil` and
|
88
|
+
it would be weird if nothingness had a height, wouldn't it?
|
89
|
+
|
76
90
|
## Development
|
77
91
|
|
78
92
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
|
@@ -88,3 +102,11 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
88
102
|
5. Create a new Pull Request
|
89
103
|
|
90
104
|
[activesupport-try]: http://api.rubyonrails.org/classes/Object.html#method-i-try
|
105
|
+
[rubygems-image]: https://img.shields.io/gem/v/tapdance.svg
|
106
|
+
[rubygems]: https://rubygems.org/gems/tapdance
|
107
|
+
[gemnasium-image]: https://img.shields.io/gemnasium/olivierlacan/tapdance.svg
|
108
|
+
[gemnasium]: https://gemnasium/olivierlacan/tapdance
|
109
|
+
[codeclimate-image]: https://codeclimate.com/github/olivierlacan/tapdance/badges/gpa.svg
|
110
|
+
[codeclimate]: https://codeclimate.com/github/olivierlacan/tapdance
|
111
|
+
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg
|
112
|
+
[license]: https://github.com/olivierlacan/tapdance/blob/master/LICENSE.txt
|
data/lib/tapdance/version.rb
CHANGED
data/tapdance.gemspec
CHANGED
@@ -14,6 +14,13 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = "http://github.com/olivierlacan/tapdance"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
+
spec.metadata = {
|
18
|
+
"homepage_uri" => "https://github.com/olivierlacan/tapdance",
|
19
|
+
"changelog_uri" => "https://github.com/olivierlacan/tapdance/blob/master/CHANGELOG.md",
|
20
|
+
"source_code_uri" => "https://github.com/olivierlacan/tapdance",
|
21
|
+
"bug_tracker_uri" => "https://github.com/olivierlacan/tapdance/issues"
|
22
|
+
}
|
23
|
+
|
17
24
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
25
|
spec.bindir = "exe"
|
19
26
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tapdance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olivier Lacan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -64,7 +64,11 @@ files:
|
|
64
64
|
homepage: http://github.com/olivierlacan/tapdance
|
65
65
|
licenses:
|
66
66
|
- MIT
|
67
|
-
metadata:
|
67
|
+
metadata:
|
68
|
+
homepage_uri: https://github.com/olivierlacan/tapdance
|
69
|
+
changelog_uri: https://github.com/olivierlacan/tapdance/blob/master/CHANGELOG.md
|
70
|
+
source_code_uri: https://github.com/olivierlacan/tapdance
|
71
|
+
bug_tracker_uri: https://github.com/olivierlacan/tapdance/issues
|
68
72
|
post_install_message:
|
69
73
|
rdoc_options: []
|
70
74
|
require_paths:
|
@@ -81,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
85
|
version: '0'
|
82
86
|
requirements: []
|
83
87
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.
|
88
|
+
rubygems_version: 2.6.8
|
85
89
|
signing_key:
|
86
90
|
specification_version: 4
|
87
91
|
summary: Make tap dance on nil
|