mark_mega_lotto 0.0.4 → 0.1.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/bin/custom_string +8 -0
- data/bin/mark_mega_lotto +8 -0
- data/lib/mark_mega_lotto/configuration.rb +9 -0
- data/lib/mark_mega_lotto/drawing.rb +1 -1
- data/lib/mark_mega_lotto/version.rb +1 -1
- data/lib/mark_mega_lotto.rb +10 -1
- data/spec/mark_mega_lotto/configuration_spec.rb +20 -0
- data/spec/mark_mega_lotto/mark_mega_lotto_spec.rb +13 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5854d4690f7153e3b18794c01101c8d90a684d0f
|
4
|
+
data.tar.gz: b26a895c05f734aa040d15c994ed1696c6225d1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 098666e8e2fd7ae557971b1d680f7fcda84506207c98fb5f9bdfe135b915462f55f0c82eb29b37810a5c393a156d32d18fd80474c6eed02d8980da7725f0ce13
|
7
|
+
data.tar.gz: c605efa0866cef943e5da942db444f2ee2147f36c906ee2ef45c6365a9003a1acf984202c391b8b4fd4f34cdd770b09e46d27219ab0624dffc91beba7444931e
|
data/bin/custom_string
ADDED
data/bin/mark_mega_lotto
ADDED
data/lib/mark_mega_lotto.rb
CHANGED
@@ -1,7 +1,16 @@
|
|
1
1
|
require "mark_mega_lotto/version"
|
2
2
|
require "mark_mega_lotto/drawing"
|
3
3
|
require "mark_mega_lotto/core_ext"
|
4
|
+
require "mark_mega_lotto/configuration"
|
4
5
|
|
5
6
|
module MarkMegaLotto
|
6
|
-
|
7
|
+
class << self
|
8
|
+
def configuration
|
9
|
+
@configuration ||= Configuration.new
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.configure
|
14
|
+
yield configuration
|
15
|
+
end
|
7
16
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
module MarkMegaLotto
|
4
|
+
describe Configuration do
|
5
|
+
describe "#drawing_count" do
|
6
|
+
it "default value is 8" do
|
7
|
+
expect(Configuration.new.drawing_count).to eq 8
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "#drawing_count=" do
|
12
|
+
it "can set value" do
|
13
|
+
config = Configuration.new
|
14
|
+
config.drawing_count = 12
|
15
|
+
|
16
|
+
expect(config.drawing_count).to eq 12
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -25,5 +25,18 @@ module MarkMegaLotto
|
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
28
|
+
|
29
|
+
describe "can set the output count" do
|
30
|
+
before(:each) do
|
31
|
+
MarkMegaLotto.configure do |config|
|
32
|
+
config.drawing_count = 10
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
it "returns an array with 10 elements" do
|
37
|
+
drawing = MarkMegaLotto::Drawing.new.draw
|
38
|
+
expect(drawing.size).to eq 10
|
39
|
+
end
|
40
|
+
end
|
28
41
|
end
|
29
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mark_mega_lotto
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Chavez
|
@@ -55,7 +55,9 @@ dependencies:
|
|
55
55
|
description: gem sample
|
56
56
|
email:
|
57
57
|
- markchav3z@gmail.com
|
58
|
-
executables:
|
58
|
+
executables:
|
59
|
+
- custom_string
|
60
|
+
- mark_mega_lotto
|
59
61
|
extensions: []
|
60
62
|
extra_rdoc_files: []
|
61
63
|
files:
|
@@ -65,13 +67,17 @@ files:
|
|
65
67
|
- LICENSE.txt
|
66
68
|
- README.md
|
67
69
|
- Rakefile
|
70
|
+
- bin/custom_string
|
71
|
+
- bin/mark_mega_lotto
|
68
72
|
- lib/mark_mega_lotto.rb
|
73
|
+
- lib/mark_mega_lotto/configuration.rb
|
69
74
|
- lib/mark_mega_lotto/core_ext.rb
|
70
75
|
- lib/mark_mega_lotto/core_ext/array.rb
|
71
76
|
- lib/mark_mega_lotto/core_ext/string.rb
|
72
77
|
- lib/mark_mega_lotto/drawing.rb
|
73
78
|
- lib/mark_mega_lotto/version.rb
|
74
79
|
- mark_mega_lotto.gemspec
|
80
|
+
- spec/mark_mega_lotto/configuration_spec.rb
|
75
81
|
- spec/mark_mega_lotto/mark_mega_lotto_spec.rb
|
76
82
|
- spec/spec_helper.rb
|
77
83
|
homepage: ''
|
@@ -99,5 +105,6 @@ signing_key:
|
|
99
105
|
specification_version: 4
|
100
106
|
summary: gem sample
|
101
107
|
test_files:
|
108
|
+
- spec/mark_mega_lotto/configuration_spec.rb
|
102
109
|
- spec/mark_mega_lotto/mark_mega_lotto_spec.rb
|
103
110
|
- spec/spec_helper.rb
|