kujibiki 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cab22e58229dacf20c0de344d1bcc53f895ded8a
4
- data.tar.gz: 389cfcaf1e7f7aafcadbf6a062f1a4c3afc90e7b
3
+ metadata.gz: 1c15f84430bcdb50219d65e81cffccffc19a1241
4
+ data.tar.gz: 0fc821e5eef9b1207e9b1894b83bfeceeb1d419d
5
5
  SHA512:
6
- metadata.gz: 2c0734d81809d1190876e0c5635b07d9462b62143b323742afcf923899b6676a56023b5d397eab950f85e1476addd12fb6adfb98d219adbc398cd0e5dcecb597
7
- data.tar.gz: 51215a7e3ffa5cb2ed88fc4dc1ae5a115d09d0961da9b0ec34bbe86957a5fb6d4cfa30642cb665cdc4c50b15c9c499a8af584675e2a0580884d527e2611a9158
6
+ metadata.gz: e7d62ea5c513d06cb4f368d829b747dccfcfe630f9abcf00462791ea05608b8dc2501b0b14c6b0ec979512054312ae3fea25797e425e8b0427971bdba891d520
7
+ data.tar.gz: ea9e2bd101d5c74f4d7e0960df60e6c70e65e09c51e893c5428e91542c0cc14c63c0a7293a2ee2fff9a2d45720b706bb5d13cfd3bce010f1a08373cc853a3b06
@@ -3,8 +3,8 @@ class Array
3
3
  def sample(n = 1, random: nil, weight: nil)
4
4
  return _sample(n, random: random) unless weight
5
5
 
6
- unless weight.select {|w| w > 0}.size == n
7
- raise ArgumentError, "weight size must be equal to sample number(#{n})"
6
+ unless weight.select {|w| w > 0}.size > n
7
+ raise ArgumentError, "weight size must be larger than sample number(#{n})"
8
8
  end
9
9
 
10
10
  sum = weight.inject(0.0, :+)
@@ -1,3 +1,3 @@
1
1
  module Kujibiki
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kujibiki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naoki Shimizu