whynot 0.0.1 → 0.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2805cf30caf36339a31c98f04015c3b9320c59c0
4
- data.tar.gz: a4268d7121e118202ea06c2ffa019ecbf6459183
3
+ metadata.gz: 8a7aab06d6e91516c7f3974a2ca852c691b3b831
4
+ data.tar.gz: af8d8625952b3bdf6ea6a679ce4b3bc8fe7d317b
5
5
  SHA512:
6
- metadata.gz: 5c98735aebb774cff0e49269bf6cf7e7eaa8a22dfe05a7460ffe1a258735d85d55cea6a5af59b007877ac01def6be908a569e8a148dc83116302612383a0ee0c
7
- data.tar.gz: fc58ba0ddb3cf6095da34b6f06b4dfc916c1d2a213d9bd7681478da9461775a1cd1611a8507584e1f0480c68a0398dc151e2cbaaed40d9d1532c9416d9bd137d
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
- TODO: Write a gem description
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
- TODO: Write usage instructions here
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
 
@@ -1,3 +1,3 @@
1
1
  module Whynot
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/whynot.rb CHANGED
@@ -10,4 +10,15 @@ module Kernel
10
10
  yield
11
11
  end
12
12
  end
13
+
14
+ def mostly(&block)
15
+ unless rand(3) == 1
16
+ yield
17
+ end
18
+ end
19
+ def occasionally(&block)
20
+ if rand(5) == 1
21
+ yield
22
+ end
23
+ end
13
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whynot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lewis