dice 0.0.2 → 0.0.3

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.
Files changed (4) hide show
  1. data/README.rdoc +5 -0
  2. data/bin/roll +1 -6
  3. data/lib/dice.rb +2 -2
  4. metadata +1 -1
@@ -5,6 +5,11 @@
5
5
  [18]
6
6
  $ roll D20x3
7
7
  [7, 8, 3]
8
+ $ roll D2x3 D4 D09 D10x4
9
+ [2, 1, 2]
10
+ [2]
11
+ [9]
12
+ [3, 9, 8, 8]
8
13
 
9
14
  $ irb
10
15
  >> require 'dice'
data/bin/roll CHANGED
@@ -1,8 +1,3 @@
1
1
  #! /usr/bin/env ruby
2
2
  require File.dirname(__FILE__) + '/../lib/dice'
3
-
4
- if ARGV.length == 0
5
- puts 'Usage: roll D20'
6
- else
7
- puts eval(ARGV.first).inspect
8
- end
3
+ ARGV.length == 0 ? puts('Usage: roll D20') : ARGV.map { |x| eval(x) }.each { |x| puts x.inspect }
@@ -14,7 +14,7 @@ class Die
14
14
  end
15
15
 
16
16
  module Roller
17
-
17
+
18
18
  def const_missing name
19
19
  if name.to_s =~ /^D(\d+)$/
20
20
  Die.new($1).roll
@@ -24,7 +24,7 @@ class Die
24
24
  super
25
25
  end
26
26
  end
27
-
27
+
28
28
  end
29
29
 
30
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dice
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors: []
7
7