dicebag 3.0.2 → 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/dicebag.rb +7 -6
- data/lib/dicebag/transform.rb +1 -1
- metadata +36 -50
data/lib/dicebag.rb
CHANGED
@@ -18,7 +18,7 @@
|
|
18
18
|
# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
19
19
|
# USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
20
|
#
|
21
|
-
# dicelib.rb -- version: 3.0.
|
21
|
+
# dicelib.rb -- version: 3.0.3
|
22
22
|
|
23
23
|
require 'parslet'
|
24
24
|
|
@@ -54,15 +54,16 @@ module DiceBag
|
|
54
54
|
# If the op is not one of the arithimetic
|
55
55
|
# operators, then the op itself is returned.
|
56
56
|
# (This should only happen on :start arrays.)
|
57
|
-
|
57
|
+
|
58
|
+
op = part.first
|
59
|
+
val = part.last
|
60
|
+
|
61
|
+
op = case op
|
58
62
|
when "+" then :add
|
59
63
|
when "-" then :sub
|
60
64
|
when "*" then :mul
|
61
65
|
when "/" then :div
|
62
|
-
else part.first
|
63
66
|
end
|
64
|
-
|
65
|
-
val = part.last
|
66
67
|
|
67
68
|
# If the value is a hash, it's an :xdx hash.
|
68
69
|
# Normalize it.
|
@@ -90,7 +91,7 @@ module DiceBag
|
|
90
91
|
count = 1 if count.zero? or count.nil?
|
91
92
|
|
92
93
|
# Set the :count and :sides keys directly
|
93
|
-
# and get
|
94
|
+
# and get rid of the :xdx sub-hash.
|
94
95
|
xdx[:count] = count
|
95
96
|
xdx[:sides] = sides
|
96
97
|
xdx.delete(:xdx)
|
data/lib/dicebag/transform.rb
CHANGED
metadata
CHANGED
@@ -1,45 +1,38 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: dicebag
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 3
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
version: 3.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.0.3
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- SynTruth
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-06-21 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: parslet
|
22
|
-
|
23
|
-
|
24
|
-
requirements:
|
25
|
-
- -
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
segments:
|
28
|
-
- 1
|
29
|
-
- 4
|
30
|
-
- 0
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
31
21
|
version: 1.4.0
|
32
22
|
type: :runtime
|
33
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 1.4.0
|
34
30
|
description: A very flexible dice rolling library for Ruby.
|
35
31
|
email: syntruth@gmail.com
|
36
32
|
executables: []
|
37
|
-
|
38
33
|
extensions: []
|
39
|
-
|
40
34
|
extra_rdoc_files: []
|
41
|
-
|
42
|
-
files:
|
35
|
+
files:
|
43
36
|
- lib/dicebag/label_part.rb
|
44
37
|
- lib/dicebag/parser.rb
|
45
38
|
- lib/dicebag/result.rb
|
@@ -49,35 +42,28 @@ files:
|
|
49
42
|
- lib/dicebag/static_part.rb
|
50
43
|
- lib/dicebag/transform.rb
|
51
44
|
- lib/dicebag.rb
|
52
|
-
has_rdoc: true
|
53
45
|
homepage: https://github.com/syntruth/Dice-Bag
|
54
46
|
licenses: []
|
55
|
-
|
56
47
|
post_install_message:
|
57
48
|
rdoc_options: []
|
58
|
-
|
59
|
-
require_paths:
|
49
|
+
require_paths:
|
60
50
|
- lib
|
61
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
requirements:
|
70
|
-
- -
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
|
73
|
-
- 0
|
74
|
-
version: "0"
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ! '>='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
58
|
+
none: false
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
75
63
|
requirements: []
|
76
|
-
|
77
64
|
rubyforge_project:
|
78
|
-
rubygems_version: 1.
|
65
|
+
rubygems_version: 1.8.23
|
79
66
|
signing_key:
|
80
67
|
specification_version: 3
|
81
|
-
summary:
|
68
|
+
summary: ! 'Dice Bag: Ruby Dice Rolling Library'
|
82
69
|
test_files: []
|
83
|
-
|