teepee 0.12.5 → 0.12.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de392b0bbaf4c52d34a7549e43cb3c2fe62f8039
4
- data.tar.gz: 403695f81168571cec10f8be68722542ee9192d2
3
+ metadata.gz: 80d3b41e120755474c7f5f07bb933f931ea346f5
4
+ data.tar.gz: 4509080cb66640a3ca8da2520f500a316bdc2e4b
5
5
  SHA512:
6
- metadata.gz: 7b4d7176aec8026f58ed5be0703827fbe30c6197f0d7eb90a65709ade6043c80e2b46a1a01245be1ccf548bb97026aeaa03e939a73d8fc1991c97981caa50bca
7
- data.tar.gz: f7b25f39125f07e409aaa3fa50c781be8abc515ea322a6959cca830bf170f313fbd58b4911792079718de7423ff99806ec78c9c58538435bbfaaf090df7f7e37
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)
@@ -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.5
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-23 00:00:00.000000000 Z
11
+ date: 2016-03-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport