lottery 0.0.4 → 0.0.5

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: ede8ddac005011ce912b5b447b8805b70bebdf60
4
- data.tar.gz: 2e1eda9f065252b74c428b44c9496aca0ed8b674
3
+ metadata.gz: 5df2d74c3dbce8419c53f26a119a1f9025634a8a
4
+ data.tar.gz: 5de18a84c8c0c74be2f640f1ede278b0acfff2c3
5
5
  SHA512:
6
- metadata.gz: 2191c7083743b4cd02d263a6ae8e73a2eaea6d0701119ee83a109ae1ea4d78c30b5a5f000399b4b23324ef0ec825d3c37e1a88abceec1bcce1f833212fd61e53
7
- data.tar.gz: e1e359d55aaf88c1a1ab9a59c536400874c219c6623c2dd877984b9f265855b0ae2a219b0527297fe4eb187a6be8577cb79360af2255c2072949a12c1b4c4782
6
+ metadata.gz: 0c01b2fb50fe6204ea5131e488dc6a3b2ad354ba0801cf82a68d5be11469cbe96a8e74c5401d1172bac18f27c90da0e3932c9b683e19b7a1c4adffa8315bca10
7
+ data.tar.gz: 31f894cb06ff8826912db3b4fd12f4fbba09f2e1daceab470ea8b6e19d41a2ccbfeae762b805df5c27025a0c81c89188c6b95e804c7550b9e535709ccf10c658
@@ -1,3 +1,11 @@
1
+ ## v0.0.5
2
+
3
+ * add two new lotteries for Taiwan.
4
+
5
+ ## v0.0.4
6
+
7
+ * bug fixes.
8
+
1
9
  ## v0.0.3
2
10
 
3
11
  * Fix a incorrect description in Europe region.
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  # Lottery
2
3
 
3
4
  Go buy a ticket by 100% Ruby chosen numbers and be the next jackpot winner!
@@ -10,6 +11,20 @@ Install Lottery:
10
11
 
11
12
  ## Where are you from?
12
13
 
14
+ ### Spain?
15
+
16
+ __Generate Daily 6/49:__
17
+
18
+ lottery es
19
+
20
+ __Generate Sunday 5/54+1:__
21
+
22
+ lottery es 1
23
+
24
+ __Generate Spanish 6/49:__
25
+
26
+ lottery es 2
27
+
13
28
  ### Europe?
14
29
 
15
30
  __Generate Euro Million Numbers:__
@@ -24,33 +39,33 @@ __Generate Thunderball Numbers:__
24
39
 
25
40
  lottery eu 2
26
41
 
27
- ### Spain?
28
-
29
- __Generate Daily 6/49:__
30
-
31
- lottery es
42
+ ### Taiwan?
32
43
 
33
- __Generate Sunday 5/54+1:__
44
+ __產生[威力彩][superlotto638]號碼:__
34
45
 
35
- lottery es 1
46
+ lottery tw
36
47
 
37
- __Generate Spanish 6/49:__
48
+ __產生[大樂透][lotto649]號碼:__
38
49
 
39
- lottery es 2
50
+ lottery tw 1
40
51
 
41
- ### Taiwan?
52
+ __產生[今彩 539][dc539] 號碼:__
42
53
 
43
- __產生威力彩號碼:__
54
+ lottery tw 2
44
55
 
45
- lottery tw
56
+ __產生[三星彩][3d]號碼:__
46
57
 
47
- __產生大樂透號碼:__
58
+ lottery tw 3
48
59
 
49
- lottery tw 1
60
+ __產生[四星彩][4d]號碼:__
50
61
 
51
- __產生今彩 539 號碼:__
62
+ lottery tw 4
52
63
 
53
- lottery tw 2
64
+ [superlotto638]: http://www.taiwanlottery.com.tw/SuperLotto638/index.asp
65
+ [lotto649]: http://www.taiwanlottery.com.tw/Lotto649/index.asp
66
+ [dc539]: http://www.taiwanlottery.com.tw/DailyCash/index.asp
67
+ [3d]: http://www.taiwanlottery.com.tw/3D/index.asp
68
+ [4d]: http://www.taiwanlottery.com.tw/4D/index.asp
54
69
 
55
70
  ## Contributing
56
71
 
@@ -24,23 +24,29 @@ module Lottery
24
24
  end
25
25
  end
26
26
 
27
- desc 'tw [type]', 'Lotteries in Taiwan. Including Lotto649, SuperLotto638, and Daily Cash.'
28
- long_desc <<-LONGDESC
27
+ desc 'tw [type]', 'Lotteries in Taiwan. Including Lotto649, SuperLotto638, Daily Cash, 3 stars and 4 stars.'
28
+ long_desc <<-TW_LONGDESC
29
29
  $ lottery tw
30
30
 
31
- generates Taiwanese Lottery numbers. Support SuperLotto638, Lotto649, and Daily Cash.
31
+ generates Taiwanese Lottery numbers. Support SuperLotto638, Lotto649, Daily Cash, 3 stars and 4 stars.
32
32
 
33
33
  $ lottery tw will generate SuperLotto638 numbers.
34
34
 
35
35
  $ lottery tw 1 will generate Lotto649 numbers.
36
36
 
37
37
  $ lottery tw 2 will generate Daily Cash numbers.
38
- LONGDESC
38
+
39
+ $ lottery tw 3 will generate 3 stars numbers.
40
+
41
+ $ lottery tw 4 will generate 4 stars numbers.
42
+ TW_LONGDESC
39
43
  def tw(which = 0)
40
44
  case which.to_i
41
- when 1 then puts '6/49 Lotto:'; Lottery::Taiwan.lotto_649.pprint
42
- when 2 then puts 'Daily Cash 539:'; Lottery::Taiwan.daily_cash.pprint
43
- else puts 'Super Lotto 638:'; Lottery::Taiwan.super_lotto_638.pprint first_name: '1st zone', second_name: '2nd zone'
45
+ when 1 then puts '6/49 Lotto:'; Lottery::Taiwan.lotto_649.pprint
46
+ when 2 then puts 'Daily Cash 539:'; Lottery::Taiwan.daily_cash_539.pprint
47
+ when 3 then printf "3 stars: %s\n" % Lottery::Taiwan.three_stars
48
+ when 4 then printf "4 stars: %s\n" % Lottery::Taiwan.four_stars
49
+ else puts 'Super Lotto 638:'; Lottery::Taiwan.super_lotto_638.pprint first_name: '1st zone', second_name: '2nd zone'
44
50
  end
45
51
  end
46
52
 
@@ -13,10 +13,23 @@ module Lottery
13
13
  make_hash(draw(49, 6))
14
14
  end
15
15
 
16
- # Daily Cash
17
- def daily_cash
16
+ # Daily Cash 539
17
+ def daily_cash_539
18
18
  make_hash(draw(39, 5))
19
19
  end
20
20
 
21
+ def three_stars
22
+ digit_draw
23
+ end
24
+
25
+ def four_stars
26
+ digit_draw(4)
27
+ end
28
+
29
+ private
30
+
31
+ def digit_draw(digits=3)
32
+ ('0' * digits ..'9' * digits).to_a.sample
33
+ end
21
34
  end
22
35
  end
@@ -1,3 +1,3 @@
1
1
  module Lottery
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lottery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juanito Fatas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-27 00:00:00.000000000 Z
11
+ date: 2013-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler