teepee 0.12.5 → 0.12.6
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 +4 -4
- data/lib/teepee/command-parser.rb +3 -3
- data/lib/teepee/commander.rb +13 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80d3b41e120755474c7f5f07bb933f931ea346f5
|
4
|
+
data.tar.gz: 4509080cb66640a3ca8da2520f500a316bdc2e4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12212ac9b8c23ee02a13861614b4fc51e8eb0c083b9380af8a01a590826381a40353decc127212b6d61a3b38d555c491ba4c881d932d101044572afe40a0a24b
|
7
|
+
data.tar.gz: d62c4c44f2b2b097b326578818088811c560382f5824acd9b9fd29e1ac7085306b025d45eac7af101009a244d946f35dede5e19ae02ef8f5213c73552bf7816c
|
@@ -396,6 +396,8 @@ module Teepee
|
|
396
396
|
@@commander.unless_operator expressions
|
397
397
|
when "do"
|
398
398
|
@@commander.do_operator expressions
|
399
|
+
when "cond"
|
400
|
+
@@commander.cond_operator expressions
|
399
401
|
else
|
400
402
|
command_error "unknown command #{command.to_html}"
|
401
403
|
end
|
@@ -451,9 +453,7 @@ module Teepee
|
|
451
453
|
return [CommandParser.new(command, []), rest]
|
452
454
|
end
|
453
455
|
while rest.length > 0
|
454
|
-
if rest.first.is_a? WordToken
|
455
|
-
expressions << rest.shift
|
456
|
-
elsif rest.first.is_a? WhitespaceToken
|
456
|
+
if rest.first.is_a? WordToken or rest.first.is_a? WhitespaceToken or rest.first.is_a? PipeToken
|
457
457
|
expressions << rest.shift
|
458
458
|
elsif rest.first.is_a? BackslashToken
|
459
459
|
result, rest = CommandParser.parse(rest)
|
data/lib/teepee/commander.rb
CHANGED
@@ -144,6 +144,10 @@ module Teepee
|
|
144
144
|
expression.to_s == "false"
|
145
145
|
end
|
146
146
|
|
147
|
+
def pipe? expression
|
148
|
+
expression.is_a? PipeToken
|
149
|
+
end
|
150
|
+
|
147
151
|
#----------------------------------------------------------------------------
|
148
152
|
|
149
153
|
def + *numbers
|
@@ -313,6 +317,15 @@ module Teepee
|
|
313
317
|
html_tag :br, nil
|
314
318
|
end
|
315
319
|
|
320
|
+
def cond_operator expressions
|
321
|
+
conditional, _, form, *rest = strip expressions
|
322
|
+
if true_constant? conditional
|
323
|
+
form
|
324
|
+
elsif not rest.empty?
|
325
|
+
cond_operator rest
|
326
|
+
end
|
327
|
+
end
|
328
|
+
|
316
329
|
def cos angle
|
317
330
|
ensure_numeric Math.cos angle
|
318
331
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: teepee
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Mark Gore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|