easy_dice 0.0.1 → 0.0.2

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: 51751349e4c734627cfae4c89f4f91ead521d654
4
- data.tar.gz: 45fee480d8d75d410ba007144418f64cbc15d302
3
+ metadata.gz: c6eb06318a0da597b05fcdb96fd03dbf2cf460c1
4
+ data.tar.gz: 4e6cdf8d904a9450a81193f953d1356595d49a54
5
5
  SHA512:
6
- metadata.gz: 03ee8a59df1475aebcd4e5c28c0e023cd3aadd71a003d7f4e06aaa67c333337b28833857cb160143786c80e976934a4accb0b47f03c032a1800ca2eeee07bcce
7
- data.tar.gz: b7304a41de6e866098ed30e7a9d9a01b379fec75219a5ef2f7e8b145032de3555a6961438b6c037f47bf08d54dc06d24b964c092e8b20ab4bf4f247b0562b3e2
6
+ metadata.gz: f4e4ca65b82bf3c9e0ea71f7e958dc727318e6aa2fdae991b9d6334a55d195c622416960220b55dfb9a373663935b02759a1ead911f60cbbdaeb7845b1481c1a
7
+ data.tar.gz: 639a9edd19b55f0f56600b49a6b8cfb87d09c7a7083bb792fc615332509deaee045970f473c995b468f51f99d1838c4a0f6437b7b84662e8c17a607708c28f6b
data/README.md CHANGED
@@ -1,10 +1,11 @@
1
- # easy_dice [![Build Status](https://travis-ci.org/komidore64/easy_dice.png?branch=master)](https://travis-ci.org/komidore64/easy_dice)
1
+ # easy_dice [![Build Status](https://travis-ci.org/komidore64/easy_dice.png?branch=master)](https://travis-ci.org/komidore64/easy_dice) [![Gem Version](https://badge.fury.io/rb/easy_dice.png)](http://rubygems.org/gems/easy_dice)
2
2
 
3
3
  super simple gem for rolling polyhedral dice
4
4
 
5
5
  ## todo
6
6
 
7
- - push to rubygems
7
+ - help-output for `roll` executable
8
+ - rdoc
8
9
 
9
10
  ## usage
10
11
 
@@ -32,12 +33,14 @@ irb> (12.d(6) + 10).roll
32
33
 
33
34
  3. `easy_dice` can give you a little bit of miscellaneous information
34
35
  ```ruby
35
- irb> (1.d(6) + 1.d(8)).min # what's the smallest number that can be rolled?
36
+ irb> d = 1.d(6) + 1.d(8)
37
+ => #<Dice:0x00 ... >
38
+ irb> d.min # what's the smallest number that can be rolled?
36
39
  => 2
37
- irb> (1.d(6) + 1.d(8)).max # what's the largest number that can be rolled?
40
+ irb> d.max # what's the largest number that can be rolled?
38
41
  => 14
39
- irb > puts 1.d(10) + 1.d(8) # "i forgot what dice i was going to roll"
40
- 1d10 + 1d8
42
+ irb > puts d # "i forgot what dice i was going to roll"
43
+ 1d6 + 1d8
41
44
  => nil
42
45
  ```
43
46
 
data/easy_dice.gemspec CHANGED
@@ -14,9 +14,11 @@
14
14
  # You should have received a copy of the GNU General Public License
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
+ require './lib/easy_dice/version'
18
+
17
19
  Gem::Specification.new do |s|
18
20
  s.name = "easy_dice"
19
- s.version = "0.0.1"
21
+ s.version = EasyDice::VERSION
20
22
  s.authors = ["Adam Price"]
21
23
  s.email = ["komidore64@gmail.com"]
22
24
  s.homepage = "http://rubygems.org/gems/easy_dice"
@@ -31,4 +33,5 @@ Gem::Specification.new do |s|
31
33
  s.add_development_dependency("rake", "~>10.1")
32
34
  s.add_development_dependency("minitest", "~>4.3")
33
35
  s.add_development_dependency("simplecov", "~>0.7")
36
+ s.add_development_dependency("debugger")
34
37
  end
@@ -16,6 +16,8 @@
16
16
 
17
17
  class Dice
18
18
 
19
+ attr_reader :count, :sides, :parent, :child
20
+
19
21
  def initialize(count, sides = 1)
20
22
  @count, @sides = count, sides
21
23
  end
@@ -56,7 +58,7 @@ class Dice
56
58
 
57
59
  protected
58
60
 
59
- attr_accessor :parent, :child
61
+ attr_writer :parent, :child
60
62
 
61
63
  def top
62
64
  return @parent.nil? ? self : @parent.top
@@ -0,0 +1,21 @@
1
+ #
2
+ # Copyright (C) 2013 Adam Price (komidore64 at gmail dot com)
3
+ #
4
+ # This program is free software: you can redistribute it and/or modify
5
+ # it under the terms of the GNU General Public License as published by
6
+ # the Free Software Foundation, either version 3 of the License, or
7
+ # (at your option) any later version.
8
+ #
9
+ # This program is distributed in the hope that it will be useful,
10
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ # GNU General Public License for more details.
13
+ #
14
+ # You should have received a copy of the GNU General Public License
15
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
+
17
+ class EasyDice
18
+
19
+ VERSION = "0.0.2"
20
+
21
+ end
data/test/dice_test.rb CHANGED
@@ -14,14 +14,6 @@
14
14
  # You should have received a copy of the GNU General Public License
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
- require 'helper'
18
-
19
- # someone will probably scold me for this
20
- class Dice
21
- attr_accessor :count, :sides
22
- attr_accessor :parent, :child
23
- end
24
-
25
17
  class DiceTest < MiniTest::Unit::TestCase
26
18
 
27
19
  def teardown
@@ -14,8 +14,6 @@
14
14
  # You should have received a copy of the GNU General Public License
15
15
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
16
16
 
17
- require 'helper'
18
-
19
17
  class EasyDiceTest < MiniTest::Unit::TestCase
20
18
 
21
19
  def test_read_happy_path
data/test/helper.rb CHANGED
@@ -20,6 +20,7 @@ SimpleCov.start do
20
20
  end
21
21
 
22
22
  require 'minitest/autorun'
23
+ require 'debugger'
23
24
 
24
25
  require 'easy_dice'
25
26
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_dice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Price
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-21 00:00:00.000000000 Z
11
+ date: 2013-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.7'
55
+ - !ruby/object:Gem::Dependency
56
+ name: debugger
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  description: Gem for rolling polyhedral dice.
56
70
  email:
57
71
  - komidore64@gmail.com
@@ -72,6 +86,7 @@ files:
72
86
  - lib/easy_dice/easy_dice.rb
73
87
  - lib/easy_dice/fixnum_d.rb
74
88
  - lib/easy_dice/format_error.rb
89
+ - lib/easy_dice/version.rb
75
90
  - rakefile
76
91
  - test/dice_test.rb
77
92
  - test/easy_dice_test.rb