bendy 0.2.2 → 0.2.3

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: 4356802a28c6c5c7fecb0196c9ab9df22cc21aba
4
- data.tar.gz: 8f101ff996b8de7bcee10a54988e3c4bc0b1bf68
3
+ metadata.gz: 112813b4db4e44430d77d0e63ffc665af0631cb5
4
+ data.tar.gz: 375b6985f76d99f0f9fd6f9603caff68fe8eca40
5
5
  SHA512:
6
- metadata.gz: cd6a3800b271f272f48037a2d297592297c7d2e300280973e1318148ee3226f35932e2762b1940cab54a0c825b6f3794508100de2bcd5ec458f178e5579854df
7
- data.tar.gz: 15bc96aee9ee8213a02b0768d7b36cd3283e768bec794f3dc0c3f8433e215dccf158797fa6f04e9f488c60c5161e018c1d390ea4c3d12a73f06e1104620aa4fd
6
+ metadata.gz: e94fbb1e395310ff7083209d1d907dacd742c98b9e81e776ffef2eb0a8d02068e4982172b68f635d0eacda976b91d9771d7803fbf82c4e6015853b5b38296ae6
7
+ data.tar.gz: 9c2eb3ae3d6903c07fd1ae7ca56c4b9607cebed81f09150a0577899bebc09eb3ab60b521092add1d989b0a6d8e7dd73576722a9f471113558dad64f76eea8c1f
@@ -1,5 +1,5 @@
1
1
  ##
2
- # We're using refinements to *freedom patch* `Array` in a safe way.
2
+ # We're using refinements to _freedom patch_ Array in a safe way.
3
3
 
4
4
  module Bendy
5
5
 
@@ -7,7 +7,7 @@ module Bendy
7
7
  refine Array do
8
8
 
9
9
  ##
10
- # `tails` produces all sub-arrays by successively dropping leading
10
+ # +tails+ produces all sub-arrays by successively dropping leading
11
11
  # elements:
12
12
  #
13
13
  # [1, 2, 3].tails
@@ -18,7 +18,7 @@ module Bendy
18
18
  end
19
19
 
20
20
  ##
21
- # `inits` produces all sub-arrays by successively taking leading
21
+ # +inits+ produces all sub-arrays by successively taking leading
22
22
  # elements:
23
23
  #
24
24
  # [1, 2, 3].tails
@@ -6,13 +6,19 @@ module Bendy
6
6
  module Logical
7
7
 
8
8
  ##
9
+ # call-seq:
10
+ # implies(antecedent) { consequent } #=> true or consequent
11
+ #
9
12
  # Material implication
10
- # `implies` is the common case where if the first thing is true, then pay
11
- # attention to the second thing. But if the first thing is false then the
12
- # whole thing is true: `implies(foo){foo[:bar]}`
13
+ #
14
+ # +implies+ is the common case where if the first thing is true
15
+ # (antecedent), then pay attention to the second thing (consequent). But
16
+ # if the first thing is false then the whole thing is true:
17
+ #
18
+ # implies(foo){foo[:bar]}
13
19
 
14
- def implies(p)
15
- !!p ? yield : true
20
+ def implies(antecedent)
21
+ !!antecedent ? yield : true
16
22
  end
17
23
  end
18
24
  end
@@ -2,13 +2,17 @@ module Bendy
2
2
  refine Object do
3
3
 
4
4
  ##
5
- # `try` acts like a normal method call, unless it is being called
6
- # on a nil object, in which case it returns nil:
5
+ # call-seq:
6
+ # try(:some_method) #=> result of method or nil
7
7
  #
8
- # nil.try(:to_i) # => nil
9
- # "10".try(:to_i) # => 10
8
+ # +try+ acts like a normal method call, unless it is being called
9
+ # on a +nil+ object, in which case it returns +nil+:
10
10
  #
11
- # Copied pretty much verbatim from ActiveSupport: https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/try.rb
11
+ # nil.try(:to_i) # => nil
12
+ # "10".try(:to_i) # => 10
13
+ #
14
+ # Copied pretty much verbatim from ActiveSupport:
15
+ # https://github.com/rails/rails/blob/master/activesupport/lib/active_support/core_ext/object/try.rb
12
16
 
13
17
  def try(*a, &b)
14
18
  if a.empty? && block_given?
@@ -1,3 +1,3 @@
1
1
  module Bendy
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bendy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wilson