kujibiki 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: 1c15f84430bcdb50219d65e81cffccffc19a1241
4
- data.tar.gz: 0fc821e5eef9b1207e9b1894b83bfeceeb1d419d
3
+ metadata.gz: 0baf99db6191159260aaeceba7edd02fd7441b77
4
+ data.tar.gz: 14ada7b149034609388758a7e4e77393c8c39d2a
5
5
  SHA512:
6
- metadata.gz: e7d62ea5c513d06cb4f368d829b747dccfcfe630f9abcf00462791ea05608b8dc2501b0b14c6b0ec979512054312ae3fea25797e425e8b0427971bdba891d520
7
- data.tar.gz: ea9e2bd101d5c74f4d7e0960df60e6c70e65e09c51e893c5428e91542c0cc14c63c0a7293a2ee2fff9a2d45720b706bb5d13cfd3bce010f1a08373cc853a3b06
6
+ metadata.gz: 4b9a1e58e234cd2e7d730b6b8ce5ee21e08a42dbdc83d81abcc0375e87d2aa8b0ff32e8befe3168962ddf15f0ae90226361e13a49465406e1360970026a53cae
7
+ data.tar.gz: 92890a95bd72140405bdbbab6439f7ada412d68b59941c3d9a75a5ac4e1ea872eaca415b2ca91af2cd470f3ee4769fad13b23e65ac061c4b5b3f50d19505a821
@@ -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 larger than sample number(#{n})"
6
+ unless weight.select {|w| w > 0}.size >= n
7
+ raise ArgumentError, "weight size must be larger than or equal to 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.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kujibiki
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Naoki Shimizu
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2015-09-25 00:00:00.000000000 Z
11
+ date: 2015-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler