tabletop 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.
- data/Rakefile +29 -4
- data/lib/tabletop/pool.rb +15 -6
- data/lib/tabletop/{die.rb → randomizers.rb} +24 -0
- data/lib/tabletop/roll.rb +2 -2
- data/lib/tabletop/token.rb +47 -0
- data/lib/tabletop/version.rb +1 -1
- data/lib/tabletop.rb +2 -1
- data/spec/fixnum_spec.rb +6 -5
- data/spec/pool_spec.rb +20 -10
- data/spec/{die_spec.rb → randomizers_spec.rb} +47 -15
- data/spec/roll_spec.rb +3 -3
- data/spec/token_spec.rb +121 -0
- data/tabletop.gemspec +1 -3
- metadata +10 -18
data/Rakefile
CHANGED
@@ -15,14 +15,10 @@ rescue Bundler::BundlerError => e
|
|
15
15
|
end
|
16
16
|
require 'rake'
|
17
17
|
|
18
|
-
require 'bueller'
|
19
|
-
Bueller::Tasks.new
|
20
|
-
|
21
18
|
require 'rspec/core/rake_task'
|
22
19
|
RSpec::Core::RakeTask.new(:examples) do |examples|
|
23
20
|
examples.rspec_opts = '-Ispec'
|
24
21
|
end
|
25
|
-
|
26
22
|
task :default => :examples
|
27
23
|
|
28
24
|
require 'rdoc/task'
|
@@ -35,3 +31,32 @@ RDoc::Task.new do |rdoc|
|
|
35
31
|
rdoc.rdoc_files.include('README*')
|
36
32
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
37
33
|
end
|
34
|
+
|
35
|
+
gemspec = eval(File.read(Dir["*.gemspec"].first))
|
36
|
+
desc "Validate the gemspec"
|
37
|
+
task :gemspec do
|
38
|
+
gemspec.validate
|
39
|
+
end
|
40
|
+
|
41
|
+
desc "Build gem locally"
|
42
|
+
task :build => :gemspec do
|
43
|
+
system "gem build #{gemspec.name}.gemspec"
|
44
|
+
FileUtils.mkdir_p "pkg"
|
45
|
+
FileUtils.mv "#{gemspec.name}-#{gemspec.version}.gem", "pkg"
|
46
|
+
end
|
47
|
+
|
48
|
+
desc "Install gem locally"
|
49
|
+
task :install => :build do
|
50
|
+
system "gem install pkg/#{gemspec.name}-#{gemspec.version}"
|
51
|
+
end
|
52
|
+
|
53
|
+
desc "Clean automatically generated files"
|
54
|
+
task :clean do
|
55
|
+
FileUtils.rm_rf "pkg"
|
56
|
+
end
|
57
|
+
|
58
|
+
desc "Push changes to github and rubygems"
|
59
|
+
task :publish do
|
60
|
+
system "git push origin master --tags"
|
61
|
+
system "gem push pkg/#{gemspec.name}-#{gemspec.version}"
|
62
|
+
end
|
data/lib/tabletop/pool.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
require_relative '
|
1
|
+
require_relative 'randomizers'
|
2
2
|
require 'delegate'
|
3
3
|
|
4
4
|
module Tabletop
|
5
5
|
class Pool < DelegateClass(Array)
|
6
6
|
include Comparable
|
7
7
|
def initialize(init_dice)
|
8
|
-
return super(init_dice) if init_dice.
|
8
|
+
return super(init_dice) if init_dice.instance_of?(Array)
|
9
9
|
d_groups = init_dice.split
|
10
10
|
dice = []
|
11
11
|
d_groups.each do |d_notation|
|
@@ -20,9 +20,10 @@ module Tabletop
|
|
20
20
|
end
|
21
21
|
super(dice)
|
22
22
|
end
|
23
|
+
|
23
24
|
def +(operand)
|
24
25
|
# if the operator is a pool, or an array only of Die objects...
|
25
|
-
if operand.
|
26
|
+
if operand.instance_of?(Pool) or (operand.instance_of?(Array) and !(operand.detect{|obj| !(obj.instance_of?(Die))}))
|
26
27
|
new_union(operand)
|
27
28
|
elsif operand.kind_of? Numeric
|
28
29
|
sum + operand
|
@@ -35,6 +36,14 @@ module Tabletop
|
|
35
36
|
sum <=> operand.to_int
|
36
37
|
end
|
37
38
|
|
39
|
+
def *(operand)
|
40
|
+
sum * operand
|
41
|
+
end
|
42
|
+
|
43
|
+
def coerce(other)
|
44
|
+
[other, sum]
|
45
|
+
end
|
46
|
+
|
38
47
|
def values
|
39
48
|
map {|die| die.value}
|
40
49
|
end
|
@@ -42,8 +51,8 @@ module Tabletop
|
|
42
51
|
fudge = nil
|
43
52
|
result = {}
|
44
53
|
each do |die|
|
45
|
-
if die.
|
46
|
-
fudge = count {|d| d.
|
54
|
+
if die.instance_of?(FudgeDie)
|
55
|
+
fudge = count {|d| d.instance_of?(FudgeDie)}
|
47
56
|
else
|
48
57
|
result[die.sides] = count {|d| d.sides == die.sides}
|
49
58
|
end
|
@@ -101,7 +110,7 @@ module Tabletop
|
|
101
110
|
union = [self, array].flatten
|
102
111
|
new_pool =[]
|
103
112
|
union.each do |die|
|
104
|
-
if die.
|
113
|
+
if die.instance_of?(FudgeDie)
|
105
114
|
new_pool << FudgeDie.new(die.value)
|
106
115
|
else
|
107
116
|
new_pool << Die.new(die.sides, die.value)
|
@@ -59,4 +59,28 @@ module Tabletop
|
|
59
59
|
[1,0,-1].include?(val)
|
60
60
|
end
|
61
61
|
end
|
62
|
+
|
63
|
+
class Coin < Die
|
64
|
+
def initialize(value=nil)
|
65
|
+
super(2, value)
|
66
|
+
end
|
67
|
+
|
68
|
+
def roll
|
69
|
+
@value = rand(sides)
|
70
|
+
end
|
71
|
+
|
72
|
+
def flip
|
73
|
+
roll
|
74
|
+
self
|
75
|
+
end
|
76
|
+
|
77
|
+
def to_s
|
78
|
+
"(#{[' ', '+'][value]})"
|
79
|
+
end
|
80
|
+
|
81
|
+
protected
|
82
|
+
def valid_value?(val)
|
83
|
+
[0,1].include?(val)
|
84
|
+
end
|
85
|
+
end
|
62
86
|
end
|
data/lib/tabletop/roll.rb
CHANGED
@@ -40,7 +40,7 @@ module Tabletop
|
|
40
40
|
@possibilities.each do |poss|
|
41
41
|
if meets?(poss)
|
42
42
|
poss.outcomes.each do |outcome|
|
43
|
-
if Roll
|
43
|
+
if outcome.instance_of?(Roll)
|
44
44
|
results << outcome.roll.effects
|
45
45
|
else
|
46
46
|
results << outcome
|
@@ -98,7 +98,7 @@ module Tabletop
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def equals(values, *outcomes)
|
101
|
-
if values.
|
101
|
+
if values.instance_of?(Range)
|
102
102
|
values.each do |val|
|
103
103
|
@possibilities << Possibility.new(outcomes, :== => val)
|
104
104
|
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Tabletop
|
2
|
+
|
3
|
+
class NotEnoughTokensError < ArgumentError
|
4
|
+
end
|
5
|
+
|
6
|
+
class TokenStack
|
7
|
+
attr_accessor :count
|
8
|
+
include Comparable
|
9
|
+
|
10
|
+
def initialize(n = 1)
|
11
|
+
@count = n
|
12
|
+
end
|
13
|
+
|
14
|
+
def <=>(operand)
|
15
|
+
count <=> operand.to_int
|
16
|
+
end
|
17
|
+
|
18
|
+
def add(n = 1)
|
19
|
+
raise ArgumentError unless n.instance_of?(Fixnum) and n > 0
|
20
|
+
@count += n
|
21
|
+
end
|
22
|
+
|
23
|
+
def remove(n=1)
|
24
|
+
raise ArgumentError unless n.instance_of?(Fixnum) and n > 0
|
25
|
+
if n > @count
|
26
|
+
n_t, c_t = "token", "token"
|
27
|
+
|
28
|
+
n_t << "s" if n > 1 or n == 0
|
29
|
+
|
30
|
+
c_t << "s" if @count > 1 or @count == 0
|
31
|
+
|
32
|
+
c = @count > 0 ? @count : "no"
|
33
|
+
errmsg = "tried to remove #{n} #{n_t} from a stack with #{c} #{c_t}"
|
34
|
+
raise NotEnoughTokensError, errmsg
|
35
|
+
end
|
36
|
+
@count -= n
|
37
|
+
end
|
38
|
+
|
39
|
+
def move(n, opts)
|
40
|
+
raise(ArgumentError, "target is #{opts[:to].class}, not TokenStack") unless opts[:to].instance_of?(TokenStack)
|
41
|
+
remove(n)
|
42
|
+
opts[:to].add(n)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
|
47
|
+
end
|
data/lib/tabletop/version.rb
CHANGED
data/lib/tabletop.rb
CHANGED
data/spec/fixnum_spec.rb
CHANGED
@@ -4,20 +4,21 @@ module Tabletop
|
|
4
4
|
describe Fixnum do
|
5
5
|
describe "#dX" do
|
6
6
|
it "generates a pool of the appropriate size and type" do
|
7
|
-
1.d6.
|
7
|
+
1.d6.should be_instance_of(Pool)
|
8
8
|
4.d7.dice.should == ["4d7"]
|
9
|
-
10.d100.
|
9
|
+
10.d100.should be_instance_of(Pool)
|
10
10
|
end
|
11
11
|
|
12
12
|
it "shows up in respond_to?(:dN)" do
|
13
|
-
1.respond_to
|
13
|
+
1.should respond_to(:d50)
|
14
|
+
10.should_not respond_to(:dthing)
|
14
15
|
end
|
15
16
|
end
|
16
17
|
describe "#dF" do
|
17
18
|
it "generates a pool of fudge dice" do
|
18
19
|
sotc = 4.dF
|
19
|
-
sotc.
|
20
|
-
sotc.all? { |d| d.
|
20
|
+
sotc.should be_instance_of(Pool)
|
21
|
+
sotc.all? { |d| d.instance_of?(FudgeDie) }.should be_true
|
21
22
|
sotc.dice.should == ["4dF"]
|
22
23
|
end
|
23
24
|
end
|
data/spec/pool_spec.rb
CHANGED
@@ -22,19 +22,19 @@ module Tabletop
|
|
22
22
|
|
23
23
|
describe "[]" do
|
24
24
|
it "should access Die objects" do
|
25
|
-
@d6[0].
|
26
|
-
@fudge[0].
|
25
|
+
@d6[0].should be_instance_of(Die)
|
26
|
+
@fudge[0].should be_instance_of(FudgeDie)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
30
|
describe "+" do
|
31
31
|
it "should join Pools into new Pools" do
|
32
|
-
(@mixed + @d17s).
|
33
|
-
(@d6 + @fudge).
|
32
|
+
(@mixed + @d17s).should be_instance_of(Pool)
|
33
|
+
(@d6 + @fudge).should be_instance_of(Pool)
|
34
34
|
end
|
35
35
|
|
36
36
|
it "should persist die types" do
|
37
|
-
(@d6 + @fudge)[1].
|
37
|
+
(@d6 + @fudge)[1].should be_instance_of(FudgeDie)
|
38
38
|
end
|
39
39
|
|
40
40
|
it "should join pools without rolling them" do
|
@@ -76,8 +76,18 @@ module Tabletop
|
|
76
76
|
end
|
77
77
|
|
78
78
|
it "should reject adding anything else" do
|
79
|
-
|
80
|
-
|
79
|
+
expect {@d6 + "foof"}.to raise_error(ArgumentError)
|
80
|
+
expect {@d6 + [Die.new, Object.new]}.to raise_error(ArgumentError)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
describe "*" do
|
85
|
+
it "should multiply by the sum of the pool" do
|
86
|
+
(1..10).each do |v|
|
87
|
+
p = Pool.new([Die.new(10, v)])
|
88
|
+
(p * 5).should == (v * 5)
|
89
|
+
(5 * p).should == (5 * v)
|
90
|
+
end
|
81
91
|
end
|
82
92
|
end
|
83
93
|
|
@@ -92,7 +102,7 @@ module Tabletop
|
|
92
102
|
describe "#roll" do
|
93
103
|
it "should return the Pool itself" do
|
94
104
|
@d6.roll.length.should == @d6.length
|
95
|
-
@d6.roll.
|
105
|
+
@d6.roll.should be_instance_of(Pool)
|
96
106
|
end
|
97
107
|
|
98
108
|
it "should store the new values" do
|
@@ -150,7 +160,7 @@ module Tabletop
|
|
150
160
|
|
151
161
|
describe "#highest" do
|
152
162
|
it "should return a pool of the highest-value die" do
|
153
|
-
@d6.highest.
|
163
|
+
@d6.highest.should be_instance_of(Pool)
|
154
164
|
@d6.highest.values.should == [2]
|
155
165
|
@d17s.highest.values.should == [17]
|
156
166
|
@mixed.highest.values.should == [11]
|
@@ -166,7 +176,7 @@ module Tabletop
|
|
166
176
|
describe "#lowest" do
|
167
177
|
it "should return a pool of the lowest-value die." do
|
168
178
|
@d6.lowest.values.should == [2]
|
169
|
-
@d17s.lowest.
|
179
|
+
@d17s.lowest.should be_instance_of(Pool)
|
170
180
|
@d17s.lowest.values.should == [1]
|
171
181
|
@mixed.lowest.values.should == [1]
|
172
182
|
end
|
@@ -20,15 +20,15 @@ module Tabletop
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "cannot be 1 or less" do
|
23
|
-
|
24
|
-
|
25
|
-
|
23
|
+
expect { Die.new(0) }.to raise_error(ArgumentError)
|
24
|
+
expect { Die.new(1) }.to raise_error(ArgumentError)
|
25
|
+
expect { Die.new(-5) }.to raise_error(ArgumentError)
|
26
26
|
end
|
27
27
|
|
28
28
|
it "cannot be a non-integer" do
|
29
|
-
|
30
|
-
|
31
|
-
|
29
|
+
expect { Die.new(0.1) }.to raise_error(ArgumentError)
|
30
|
+
expect { Die.new(5.7694) }.to raise_error(ArgumentError)
|
31
|
+
expect { Die.new("foof") }.to raise_error(ArgumentError)
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -46,9 +46,9 @@ module Tabletop
|
|
46
46
|
end
|
47
47
|
|
48
48
|
it "cannot be a non-integer" do
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
expect { Die.new(0.1) }.to raise_error(ArgumentError)
|
50
|
+
expect { Die.new(5.7694) }.to raise_error(ArgumentError)
|
51
|
+
expect { Die.new("foof") }.to raise_error(ArgumentError)
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
@@ -144,17 +144,17 @@ module Tabletop
|
|
144
144
|
[-1, 0, 1].each do |v|
|
145
145
|
FudgeDie.new(v)
|
146
146
|
end
|
147
|
-
|
148
|
-
|
149
|
-
|
147
|
+
expect {FudgeDie.new(2)}.to raise_error(ArgumentError)
|
148
|
+
expect {FudgeDie.new(0.6)}.to raise_error(ArgumentError)
|
149
|
+
expect {FudgeDie.new("5")}.to raise_error(ArgumentError)
|
150
150
|
end
|
151
151
|
end
|
152
152
|
|
153
153
|
describe "#value=" do
|
154
154
|
it "cannot be set to anything but -1, 0, or 1" do
|
155
|
-
|
156
|
-
|
157
|
-
|
155
|
+
expect {@fudge.value = 2}.to raise_error(ArgumentError)
|
156
|
+
expect {@fudge.value = 0.6}.to raise_error(ArgumentError)
|
157
|
+
expect {@fudge.value = "5"}.to raise_error(ArgumentError)
|
158
158
|
[-1, 0, 1].each do |v|
|
159
159
|
@fudge.value = v
|
160
160
|
end
|
@@ -169,4 +169,36 @@ module Tabletop
|
|
169
169
|
end
|
170
170
|
end
|
171
171
|
end
|
172
|
+
|
173
|
+
describe Coin do
|
174
|
+
describe "#sides" do
|
175
|
+
it {subject.sides.should == 2}
|
176
|
+
end
|
177
|
+
|
178
|
+
describe "#value" do
|
179
|
+
it "can be either 0 or 1" do
|
180
|
+
[0, 1].each do |v|
|
181
|
+
subject.value = v
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
it "can't be anything else" do
|
186
|
+
expect {subject.value = "a thing"}.to raise_error(ArgumentError)
|
187
|
+
expect {subject.value = 2}.to raise_error(ArgumentError)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
|
191
|
+
describe "#flip" do
|
192
|
+
it {subject.flip.should be_instance_of(Coin)}
|
193
|
+
it "should alias roll" do
|
194
|
+
subject.should_receive(:roll)
|
195
|
+
subject.flip
|
196
|
+
end
|
197
|
+
end
|
198
|
+
|
199
|
+
describe "#to_s" do
|
200
|
+
it {Coin.new(1).to_s.should == "(+)"}
|
201
|
+
it {Coin.new(0).to_s.should == "( )"}
|
202
|
+
end
|
203
|
+
end
|
172
204
|
end
|
data/spec/roll_spec.rb
CHANGED
@@ -7,7 +7,7 @@ module Tabletop
|
|
7
7
|
it "accesses the roll's pool" do
|
8
8
|
d20 = Roll.new(1.d20) do
|
9
9
|
end
|
10
|
-
d20.pool.
|
10
|
+
d20.pool.should be_instance_of(Pool)
|
11
11
|
d20.pool.length.should == 1
|
12
12
|
d20.pool[0].sides.should == 20
|
13
13
|
end
|
@@ -61,7 +61,7 @@ module Tabletop
|
|
61
61
|
end
|
62
62
|
@exalted.roll(:pool=>10)
|
63
63
|
@exalted.pool.length.should == 10
|
64
|
-
|
64
|
+
expect {@exalted.roll}.to raise_error(ArgumentError)
|
65
65
|
end
|
66
66
|
|
67
67
|
it "can count successes" do
|
@@ -111,7 +111,7 @@ module Tabletop
|
|
111
111
|
|
112
112
|
[1,2,3].include?(c[0]).should be_true
|
113
113
|
|
114
|
-
b[1].
|
114
|
+
b[1].should be_instance_of(String)
|
115
115
|
|
116
116
|
end
|
117
117
|
before :each do
|
data/spec/token_spec.rb
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module Tabletop
|
4
|
+
describe TokenStack do
|
5
|
+
|
6
|
+
describe "#count" do
|
7
|
+
it {subject.count.should == 1}
|
8
|
+
|
9
|
+
it "can be set on instantiation" do
|
10
|
+
(1..5).each do |v|
|
11
|
+
TokenStack.new(v).count.should == v
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
it "is called when stacks are compared to numbers" do
|
16
|
+
(1..5).each do |v|
|
17
|
+
s = TokenStack.new(v)
|
18
|
+
s.should == v
|
19
|
+
s.should >= v-1
|
20
|
+
s.should <= v+1
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "#add" do
|
26
|
+
|
27
|
+
context "when called without arguments" do
|
28
|
+
it "increases the count by 1" do
|
29
|
+
subject.add
|
30
|
+
subject.count.should == 2
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
context "when called with one argument" do
|
35
|
+
it "increases the count by that argument" do
|
36
|
+
subject.add(2)
|
37
|
+
subject.count.should == 3
|
38
|
+
(1..5).each do |i|
|
39
|
+
expect {
|
40
|
+
subject.add(i)
|
41
|
+
}.to change{subject.count}.by(i)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
it "does not accept non-integers" do
|
46
|
+
expect { subject.add(0.1) }.to raise_error(ArgumentError)
|
47
|
+
end
|
48
|
+
|
49
|
+
it "does not accept arguments < 1" do
|
50
|
+
expect { subject.add(0) }.to raise_error(ArgumentError)
|
51
|
+
expect { subject.add(-1) }.to raise_error(ArgumentError)
|
52
|
+
subject.add(1)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
describe "#remove" do
|
57
|
+
context "when called without arguments" do
|
58
|
+
it "decreases the count by 1" do
|
59
|
+
subject.remove
|
60
|
+
subject.count.should == 0
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
context "when called with one argument" do
|
65
|
+
it "decreases the count by that argument" do
|
66
|
+
(1..5).each do |i|
|
67
|
+
s = TokenStack.new(5)
|
68
|
+
expect {s.remove(i)}.to change{s.count}.by(-i)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
it "does not accept non-integers" do
|
73
|
+
expect { subject.remove(0.1) }.to raise_error(ArgumentError)
|
74
|
+
end
|
75
|
+
|
76
|
+
it "does not accept arguments < 1" do
|
77
|
+
expect { subject.remove(0) }.to raise_error(ArgumentError)
|
78
|
+
expect { subject.remove(-1) }.to raise_error(ArgumentError)
|
79
|
+
subject.remove(1)
|
80
|
+
end
|
81
|
+
|
82
|
+
it "raises an error when trying to remove too many" do
|
83
|
+
expect { subject.remove(2) }.to raise_error(
|
84
|
+
NotEnoughTokensError,
|
85
|
+
/tried to remove 2 tokens from a stack with 1 token/)
|
86
|
+
expect { TokenStack.new(2).remove(3) }.to raise_error(
|
87
|
+
NotEnoughTokensError,
|
88
|
+
/tried to remove 3 tokens from a stack with 2 tokens/)
|
89
|
+
expect { TokenStack.new(0).remove(1) }.to raise_error(
|
90
|
+
NotEnoughTokensError,
|
91
|
+
/tried to remove 1 token from a stack with no tokens/)
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
describe "#move" do
|
96
|
+
before :each do
|
97
|
+
@a = TokenStack.new
|
98
|
+
@b = TokenStack.new
|
99
|
+
end
|
100
|
+
it "removes tokens from the receiving stack" do
|
101
|
+
(1..10).each do |v|
|
102
|
+
@a.add(v)
|
103
|
+
expect {@a.move(v, :to =>@b)}.to change{@a.count}.by(-v)
|
104
|
+
end
|
105
|
+
end
|
106
|
+
it "adds tokens to the stack passed as the :to argument" do
|
107
|
+
(1..10).each do |v|
|
108
|
+
@a.add(v)
|
109
|
+
expect {@a.move(v, :to =>@b)}.to change{@b.count}.by(v)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
it "doesn't move any tokens if :to isn't a TokenStack" do
|
113
|
+
expect {@a.move(1, :to => [])}.to raise_error(
|
114
|
+
ArgumentError,
|
115
|
+
/target is Array, not TokenStack/)
|
116
|
+
@a.count.should == 1
|
117
|
+
@b.count.should == 1
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
end
|
data/tabletop.gemspec
CHANGED
@@ -16,8 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
'README.markdown',
|
17
17
|
]
|
18
18
|
|
19
|
-
s.required_rubygems_version =
|
20
|
-
s.rubygems_version = '1.3.7'
|
19
|
+
s.required_rubygems_version = '>= 1.3.7'
|
21
20
|
s.specification_version = 3
|
22
21
|
|
23
22
|
ignores = File.readlines(".gitignore").grep(/\S+/).map {|s| s.chomp }
|
@@ -29,7 +28,6 @@ Gem::Specification.new do |s|
|
|
29
28
|
|
30
29
|
s.add_development_dependency 'rspec'
|
31
30
|
s.add_development_dependency 'bundler'
|
32
|
-
s.add_development_dependency 'bueller'
|
33
31
|
s.add_development_dependency 'rake'
|
34
32
|
s.add_development_dependency 'rdoc'
|
35
33
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: tabletop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.
|
5
|
+
version: 0.2.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Nick Novitski
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: *id002
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
38
|
+
name: rake
|
39
39
|
requirement: &id003 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
prerelease: false
|
47
47
|
version_requirements: *id003
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
|
-
name:
|
49
|
+
name: rdoc
|
50
50
|
requirement: &id004 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
@@ -56,17 +56,6 @@ dependencies:
|
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
58
|
version_requirements: *id004
|
59
|
-
- !ruby/object:Gem::Dependency
|
60
|
-
name: rdoc
|
61
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
62
|
-
none: false
|
63
|
-
requirements:
|
64
|
-
- - ">="
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version: "0"
|
67
|
-
type: :development
|
68
|
-
prerelease: false
|
69
|
-
version_requirements: *id005
|
70
59
|
description: Tabletop aims to provide a simple way of describing, automating and tracking the tools and tasks involved in "analog" games, determining results from the motions and properties of various dice and chips.
|
71
60
|
email: nicknovitski@gmail.com
|
72
61
|
executables: []
|
@@ -79,19 +68,21 @@ extra_rdoc_files:
|
|
79
68
|
files:
|
80
69
|
- Gemfile
|
81
70
|
- lib/fixnum.rb
|
82
|
-
- lib/tabletop/die.rb
|
83
71
|
- lib/tabletop/pool.rb
|
72
|
+
- lib/tabletop/randomizers.rb
|
84
73
|
- lib/tabletop/roll.rb
|
74
|
+
- lib/tabletop/token.rb
|
85
75
|
- lib/tabletop/version.rb
|
86
76
|
- lib/tabletop.rb
|
87
77
|
- LICENSE
|
88
78
|
- Rakefile
|
89
79
|
- README.markdown
|
90
|
-
- spec/die_spec.rb
|
91
80
|
- spec/fixnum_spec.rb
|
92
81
|
- spec/pool_spec.rb
|
82
|
+
- spec/randomizers_spec.rb
|
93
83
|
- spec/roll_spec.rb
|
94
84
|
- spec/spec_helper.rb
|
85
|
+
- spec/token_spec.rb
|
95
86
|
- tabletop.gemspec
|
96
87
|
- .gitignore
|
97
88
|
homepage: http://github.com/njay/tabletop
|
@@ -107,7 +98,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
107
98
|
requirements:
|
108
99
|
- - ">="
|
109
100
|
- !ruby/object:Gem::Version
|
110
|
-
hash:
|
101
|
+
hash: 3490526089610525128
|
111
102
|
segments:
|
112
103
|
- 0
|
113
104
|
version: "0"
|
@@ -125,8 +116,9 @@ signing_key:
|
|
125
116
|
specification_version: 3
|
126
117
|
summary: A Ruby DSL for role-playing games
|
127
118
|
test_files:
|
128
|
-
- spec/die_spec.rb
|
129
119
|
- spec/fixnum_spec.rb
|
130
120
|
- spec/pool_spec.rb
|
121
|
+
- spec/randomizers_spec.rb
|
131
122
|
- spec/roll_spec.rb
|
132
123
|
- spec/spec_helper.rb
|
124
|
+
- spec/token_spec.rb
|