xiaodao_mega_lotto 0.1.0 → 0.2.0
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 +4 -4
- data/Gemfile.lock +1 -1
- data/bin/xiaodao_mega_lotto +6 -0
- data/lib/xiaodao_mega_lotto/configuration.rb +9 -0
- data/lib/xiaodao_mega_lotto/drawing.rb +9 -2
- data/lib/xiaodao_mega_lotto/version.rb +1 -1
- data/lib/xiaodao_mega_lotto.rb +16 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20548d192952412eee588c5152efde9faea24d07
|
4
|
+
data.tar.gz: 9e9d1b87fbd9f82738e90b12971cbfaa7753ac01
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79745a959d1e0fb50d321bd039a749d9adc9222c85a0b61c7196aec2870adc248eb846a36cb494b909d6da017eeb11b82b7e12b1e1579eb28822c58204873f44
|
7
|
+
data.tar.gz: 3bde553cf7808693db9969480111aa4cb90212243f52efa82f71aa7cf222aba4d8979850b88f464b1c6e59b3c281b35a3e873c376c0ea5afc4c84939956e13fb
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,18 @@
|
|
1
1
|
module XiaodaoMegaLotto
|
2
2
|
class Drawing
|
3
|
+
attr_accessor :config
|
4
|
+
|
5
|
+
def initialize(config = Configuration.new)
|
6
|
+
@config = config
|
7
|
+
end
|
8
|
+
|
3
9
|
def draw
|
4
|
-
|
10
|
+
@config.drawing_count.times.map { single_draw }
|
5
11
|
end
|
12
|
+
|
6
13
|
private
|
7
14
|
def single_draw
|
8
|
-
|
15
|
+
rand(0...60)
|
9
16
|
end
|
10
17
|
end
|
11
18
|
end
|
data/lib/xiaodao_mega_lotto.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "xiaodao_mega_lotto/version"
|
2
|
+
require "xiaodao_mega_lotto/configuration"
|
2
3
|
require "xiaodao_mega_lotto/drawing"
|
3
4
|
begin
|
4
5
|
require "pry"
|
@@ -6,4 +7,19 @@ rescue LoadError
|
|
6
7
|
end
|
7
8
|
|
8
9
|
module XiaodaoMegaLotto
|
10
|
+
class << self
|
11
|
+
attr_accessor :configuration
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.configuration
|
15
|
+
@configuration ||= Configuration.new
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.reset
|
19
|
+
@configuration = Configuration.new
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.configure
|
23
|
+
yield(configuration)
|
24
|
+
end
|
9
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xiaodao_mega_lotto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- liupc-ubuntu
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,7 +83,9 @@ files:
|
|
83
83
|
- Rakefile
|
84
84
|
- bin/console
|
85
85
|
- bin/setup
|
86
|
+
- bin/xiaodao_mega_lotto
|
86
87
|
- lib/xiaodao_mega_lotto.rb
|
88
|
+
- lib/xiaodao_mega_lotto/configuration.rb
|
87
89
|
- lib/xiaodao_mega_lotto/drawing.rb
|
88
90
|
- lib/xiaodao_mega_lotto/version.rb
|
89
91
|
- xiaodao_mega_lotto.gemspec
|