RpgTools 0.3.0 → 0.3.1

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: 427e48bcf495c311c8ce3d2e0e052bffaebf85e5
4
- data.tar.gz: ceb0ae54214c6802528beebd14390d40045a86df
3
+ metadata.gz: 76b4b5396a8ebfd678ca5ac5dbf115c3d0eeb028
4
+ data.tar.gz: dcf5233ee0231ad7b1977c4800ac857472f13150
5
5
  SHA512:
6
- metadata.gz: a9156b8611ac596ab1b87c522c91317c901f3f3c2b71fbe94681c1f1083ad5d072619ac21dd50661b6f62b3ee65880687be922b2f58fde8709b824d5ca1d7926
7
- data.tar.gz: fdfa3ec4e3ce917b2ca97464de5368a74dd630c927223be6459a183ffb83cda3466dbd28f05d14d03d9edba4fb47dd04ebeffa750ada125c02fa99a85a04a241
6
+ metadata.gz: a80e08868aee9e9ab8861b8a71c0593020923db1458e9cab1a55f63869a32b2744a013f9a31d91af467c6e9aa3f9febb0a4d94685a1127f02a9492f1aab2c4b1
7
+ data.tar.gz: cdc14519c78f42c845654783a6f2c39753b8f4572900b84daec2f4a4babddb1e4ddbc19dc99498bdff749f491e9a47427d4447f000db1bc030aa3a88fd9c2b19
data/README.md CHANGED
@@ -6,7 +6,7 @@ A gem that gives you tools for your RPGs : dices, coins, cards !
6
6
  ## Usage
7
7
 
8
8
  * <tt>RpgTools::Coin.flip</tt> returns a "heads" or "tails" string.
9
- * <tt>RpgTools::Dice.rool(arg)</tt> returns an array of dices of your choice (arg format : "1d6" or "4D10" for example).
9
+ * <tt>RpgTools::Dice.roll(arg)</tt> returns an array of dices of your choice (arg format : "1d6", "4D10", "1d6+3" or "4D6-1" for example).
10
10
  * <tt>RpgTools::Card.pick</tt> returns a card of a 52 cards deck + 2 jokers.
11
11
 
12
12
  ## Contributing
@@ -15,11 +15,11 @@ module RpgTools
15
15
  return standard_roll(dices, max_value) if dice =~ /^\d+[Dd]\d+$/
16
16
 
17
17
  # We apply bonuses/maluses properly if any
18
- if dice =~ /^\d+d\d+(\+)(\d+)/
19
- bonus = dice.gsub(/^\d+d\d+(\+)/, '').to_i
18
+ if dice =~ /^\d+[Dd]\d+(\+)(\d+)/
19
+ bonus = dice.gsub(/^\d+[Dd]\d+(\+)/, '').to_i
20
20
  roll_with_bonus(dices, max_value, bonus)
21
- elsif dice =~ /^\d+d\d+(\-)(\d+)/
22
- malus = dice.gsub(/^\d+d\d+(\-)/, '').to_i
21
+ elsif dice =~ /^\d+[Dd]\d+(\-)(\d+)/
22
+ malus = dice.gsub(/^\d+[Dd]\d+(\-)/, '').to_i
23
23
  roll_with_malus(dices, max_value, malus)
24
24
  else
25
25
  true
@@ -1,9 +1,9 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{RpgTools}
3
- s.version = '0.3.0'
3
+ s.version = '0.3.1'
4
4
  s.author = 'Yohan Piron'
5
5
  s.email = 'yinfei84@gmail.com'
6
- s.date = %q{2014-12-18}
6
+ s.date = %q{2015-01-07}
7
7
  s.summary = %q{RpgTools is a toolbox for tabletop games and RPGs}
8
8
  s.description = 'RpgTools gives you tools for your RPGs : dices, coins, cards...'
9
9
  s.homepage = 'https://github.com/Yinfei/rpg_tools.git'
@@ -28,7 +28,7 @@ describe RpgTools::Dice do
28
28
  end
29
29
 
30
30
  it 'rolls a dice with a malus' do
31
- expect(described_class.roll('1d6-2').count).to eq(1)
31
+ expect(described_class.roll('1D6-2').count).to eq(1)
32
32
  end
33
33
 
34
34
  it "doesn't roll a dice with an odd symbol" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: RpgTools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yohan Piron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-18 00:00:00.000000000 Z
11
+ date: 2015-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake