dicebag 3.0.3 → 3.0.5
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/lib/dicebag.rb +5 -1
- metadata +1 -1
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.5
|
22
22
|
|
23
23
|
require 'parslet'
|
24
24
|
|
@@ -146,6 +146,10 @@ module DiceBag
|
|
146
146
|
begin
|
147
147
|
tree = Parser.new.parse(dstr)
|
148
148
|
ast = Transform.new.apply(tree)
|
149
|
+
|
150
|
+
# Sometimes, we get a hash back, so wrap it as
|
151
|
+
# a single element array.
|
152
|
+
ast = [ast] unless ast.is_a?(Array)
|
149
153
|
|
150
154
|
return normalize_tree(ast)
|
151
155
|
|