lotto 0.4.0 → 0.5.0

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: ac8e01e241857d917c0a09be0b01c92a25ab9d2836db5c098601a4ec73520643
4
- data.tar.gz: c0490dfd1aba3178ef67bcf5332b776ce09e673f7981f1b6fd3d7b9416e15946
3
+ metadata.gz: e3c86ed5eb80bc4ac4072c8f975dde62b91e013ac2b54168e85196fff6709f5c
4
+ data.tar.gz: 2369ef36070b4fde36139c5b861ee0ead0841b9ad8185d7ab8fd13fad8a40eef
5
5
  SHA512:
6
- metadata.gz: affea015f2fd18ef205f908c33f5a5c7e22999e9f0bfd1a2ea682c707b4acd85b60251efe0b3269fa88f3b394c1b5fa4f92e40e7148aa9348db856e6fa90e15b
7
- data.tar.gz: 8a388d28e5d2d9ba8bd260f282ea8bfc9380767d409badd669416560889ca2f4fd16b314e060ecddff8d6361be6817c22559b7011bf6de5d0a3aa7428890a99f
6
+ metadata.gz: b9e15215bf0ee1a57683834081ff6608c00a5225477131cac285b2ec5bdfe667b7de2b65e4d6699292166b5f5692e49d830d53699b165a0d7e3eb335e5c6398e
7
+ data.tar.gz: 32b4fd813f64cd84aaff7fe4ab5b1376cc9eaf57119fcdfb54fde3a87d40feb6a31be8db082ede01c53db24957fe0e2722b77564fcab9bf4ecf0b8eea023d9d9
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lotto (0.4.0)
4
+ lotto (0.5.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -8,7 +8,7 @@ A customizable lottery gem
8
8
  Add this line to your application's Gemfile:
9
9
 
10
10
  ```ruby
11
- gem 'lotto', '~> 0.4.0'
11
+ gem 'lotto', '~> 0.5.0'
12
12
  ```
13
13
 
14
14
  And then execute:
@@ -7,7 +7,9 @@ module Lotto
7
7
 
8
8
  def draw
9
9
  drawns = []
10
- @options[:pick].times{ drawns << pick(drawns) }
10
+ @options[:include].each{ |n| drawns << n } unless @options[:include].nil?
11
+ count = @options[:include] ? @options[:pick] - @options[:include].count : @options[:pick]
12
+ count.times{ drawns << pick(drawns) }
11
13
  drawns
12
14
  end
13
15
 
@@ -22,8 +24,10 @@ module Lotto
22
24
  end
23
25
 
24
26
  def basket
25
- return (1..@options[:of]).reject{ |n| @options[:exclude].include? n } unless @options[:exclude].nil?
26
- (1..@options[:of])
27
+ numbers = (1..@options[:of])
28
+ numbers = numbers.reject{ |n| @options[:include].include? n } unless @options[:include].nil?
29
+ numbers = numbers.reject{ |n| @options[:exclude].include? n } unless @options[:exclude].nil?
30
+ numbers
27
31
  end
28
32
  end
29
33
  end
@@ -1,3 +1,3 @@
1
1
  module Lotto
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lotto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Onur Kucukkece
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-03 00:00:00.000000000 Z
11
+ date: 2018-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler