shenanigans 1.0.17 → 1.0.18

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
  SHA256:
3
- metadata.gz: 4bf657b492952b90375dafac6f9da8ff48b9bfdfa505406bf710b18c1b3a1002
4
- data.tar.gz: 94d563bc10fb0aaed7efe2bdec61432ff4d5e5999515de7e2a57bc79b3729f3e
3
+ metadata.gz: 2b77d114be718ddbf0ec79c50bfa217ef64049a2c4e8faeb7459f50d96e89571
4
+ data.tar.gz: 177ff03601eb1ed56c8d27321f434fe2f7d061893bfedb8006e9fe967dc73908
5
5
  SHA512:
6
- metadata.gz: b7fdeb35c9ebbea5aab5fbb7ff7c9c9ab65bd2153360eb43f8d4b1b708d9a1d3b6657c25c1984e678aff27f136987f04b7a06c988f2e236cbcd5a2f610b80d9a
7
- data.tar.gz: d7d84a4f230d9db2b41d471278c7ef28c2a7212be8116f918e3e34a32524665893c02ec76cb3b78752c58f40fb766737ebadbf588eb10241d1d8120d1d96c4da
6
+ metadata.gz: 0fa1a23f8c5e6c515037e89465902901cd119e76ad365fe249abe98e6a5ca4a9ec81b15f92835d20e2d2f9f345bbc5bf12f878b1cf76b9b694adba6a7b799d86
7
+ data.tar.gz: 930fd68a7e5230fc7d2c5a1b66db4f0c1fd22d8da68bd93fd1bb66b76290790fbbeeae3e8a7476e8a134ddeab39ff182fa674f04477a9fe300aba210ee9fbb3f
@@ -1,14 +1,14 @@
1
1
  class Array
2
- # Similar to +reduce+/+inject+, but also returns intermediate values. Has the
3
- # same interface as +reduce+/+inject+, so an initial value, an operator or
4
- # both can be supplied. This method may eventually be moved to the
2
+ # Similar to +reduce+/+inject+, but also returns intermediate values. Has the
3
+ # same interface as +reduce+/+inject+, so an initial value, an operator or
4
+ # both can be supplied. This method may eventually be moved to the
5
5
  # +Enumerable+ module.
6
6
  #
7
7
  # @example Symbol argument
8
8
  # a = (1..4).to_a
9
- # a.reductions(:+) #=> 10
9
+ # a.reductions(:+) #=> [1, 3, 6, 10]
10
10
  # @example Initial value and symbol argument
11
- # a.reductions(50, :+) #=> 60
11
+ # a.reductions(50, :+) #=> [50, 51, 53, 56, 60]
12
12
  # @example Block argument
13
13
  # %w(a b c).reductions { |s1, s2| s1+s2 } #=> ["a", "ab", "abc"]
14
14
  def reductions(*args, &block)
@@ -1,3 +1,4 @@
1
1
  require_relative "array/caret"
2
2
  require_relative "array/random_subarray"
3
+ require_relative "array/reductions"
3
4
  require_relative "array/zip_with"
@@ -3,7 +3,7 @@ class Integer
3
3
  # @example
4
4
  # 3.divisble_by(0) #=> false
5
5
  # 3.divisble_by(2) #=> false
6
- # 9.divisble_bu(3) #=> true
6
+ # 9.divisble_by(3) #=> true
7
7
  def divisible_by(n)
8
8
  return false if n.zero?
9
9
 
@@ -4,7 +4,7 @@ module Kernel
4
4
  #
5
5
  # @example Composing symbols
6
6
  # ["foo bar", "baz qux"].map(&fn(:split, :last)) #=> ["bar", "qux"]
7
- # @example Composing symbplds and lambdas
7
+ # @example Composing symbols and lambdas
8
8
  # (1..3).map(&fn(:next, -> x { x * x }, -> x { x.to_f / 2 } ))
9
9
  # #=> [2.0, 4.5, 8.0]
10
10
  def fn(*funs)
@@ -21,6 +21,4 @@ class Module
21
21
  end
22
22
  nil # like attr_accessor
23
23
  end
24
-
25
- private :private_accessor
26
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shenanigans
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.17
4
+ version: 1.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Kohl