whynot 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +20 -2
- data/lib/whynot/version.rb +1 -1
- data/lib/whynot.rb +11 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a7aab06d6e91516c7f3974a2ca852c691b3b831
|
4
|
+
data.tar.gz: af8d8625952b3bdf6ea6a679ce4b3bc8fe7d317b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27b7ad396b75bc31678faf22e3723ec586d8e5b0f32ae51565c9993ce17f029b2deb0b04ebc16435be6718a162e8f87b0ef512f59bb923bbd5616847a998127b
|
7
|
+
data.tar.gz: 518119dbb5a3cde677a07a46285dca44ae2df66d19eb2dad2dc1a567a39d79446fe848b65e2429e6c89528682a6666c153361670f369978a27c89e4f261ed6f7
|
data/README.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/whynot.svg)](http://badge.fury.io/rb/whynot)
|
2
|
+
|
1
3
|
# Whynot
|
2
4
|
|
3
|
-
|
5
|
+
Why not?
|
4
6
|
|
5
7
|
## Installation
|
6
8
|
|
@@ -18,7 +20,23 @@ Or install it yourself as:
|
|
18
20
|
|
19
21
|
## Usage
|
20
22
|
|
21
|
-
|
23
|
+
`require 'whynot'`
|
24
|
+
|
25
|
+
Then you can become less confident about your code working. Whynot adds
|
26
|
+
`Kernel#maybe`, which takes a block, like so:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
maybe do |x,y|
|
30
|
+
x,y = 1,2
|
31
|
+
x+y
|
32
|
+
end
|
33
|
+
```
|
34
|
+
|
35
|
+
Sometimes it'll return 3, and sometimes `nil`. Because, why not?
|
36
|
+
|
37
|
+
If you would like your code to mostly or occasionally work, you use
|
38
|
+
`Kernel#mostly` and `Kernel#occasionally`, respectively.
|
39
|
+
|
22
40
|
|
23
41
|
## Contributing
|
24
42
|
|
data/lib/whynot/version.rb
CHANGED
data/lib/whynot.rb
CHANGED