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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 82d067bba7b5be360bc84b6b2c6bcb0fb31e1e21
4
- data.tar.gz: 5ab9195b930b9255cf0a9f480470e26754f496a2
3
+ metadata.gz: 5854d4690f7153e3b18794c01101c8d90a684d0f
4
+ data.tar.gz: b26a895c05f734aa040d15c994ed1696c6225d1b
5
5
  SHA512:
6
- metadata.gz: 4c19cbdefc85fd313687ef7231a9e256d4fe4d168e9058698ffc40c1c180c46c6304ae0e36e64f1411214fadb003e2432788a909dd8f8fd6b6adbbdc655ad6f0
7
- data.tar.gz: 209939184c4a4bbf2964f39084baad24eacd3c94992971020d7f84170932e857f4c41fe7953b48034d97e18ac09785cd72ee3cdababd2910c4cd26ee071ffa92
6
+ metadata.gz: 098666e8e2fd7ae557971b1d680f7fcda84506207c98fb5f9bdfe135b915462f55f0c82eb29b37810a5c393a156d32d18fd80474c6eed02d8980da7725f0ce13
7
+ data.tar.gz: c605efa0866cef943e5da942db444f2ee2147f36c906ee2ef45c6365a9003a1acf984202c391b8b4fd4f34cdd770b09e46d27219ab0624dffc91beba7444931e
data/bin/custom_string ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative "../lib/mark_mega_lotto/core_ext"
4
+
5
+ string = "Mark"
6
+ puts string.awesome
7
+
8
+
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require_relative "../lib/mark_mega_lotto/drawing"
4
+
5
+ drawing = MarkMegaLotto::Drawing.new.draw
6
+ puts drawing
7
+
8
+
@@ -0,0 +1,9 @@
1
+ module MarkMegaLotto
2
+ class Configuration
3
+ attr_accessor :drawing_count
4
+
5
+ def initialize
6
+ @drawing_count = 8
7
+ end
8
+ end
9
+ end
@@ -1,7 +1,7 @@
1
1
  module MarkMegaLotto
2
2
  class Drawing
3
3
  def draw
4
- 8.times.map { single_draw }
4
+ MarkMegaLotto.configuration.drawing_count.times.map { single_draw }
5
5
  end
6
6
 
7
7
  private
@@ -1,3 +1,3 @@
1
1
  module MarkMegaLotto
2
- VERSION = "0.0.4"
2
+ VERSION = "0.1.0"
3
3
  end
@@ -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
- # Your code goes here...
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
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