teepee 0.15.1 → 0.15.2

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: 4cf1667f856da637023b09ff20bea473e2a7afb5
4
- data.tar.gz: 71a0186abc1b1adf0addcd8e56fdef6a88455b67
3
+ metadata.gz: 3ab55219c597cb80dc9422180444fc557212c07b
4
+ data.tar.gz: b3b3817de233269cf0a345ed5f7a054727439f3d
5
5
  SHA512:
6
- metadata.gz: d1947fa3ce5f652143f62689cd98c2c552af27d3539f4dc8dba878f26c81e6e0dfdef030c7b66ed04e495b20fb4864d6a47c50b63f9394b2832bb2aadc1cf363
7
- data.tar.gz: 0fb35c12ad54e037c4e4605cf190ebd1c59aeed99332ecfbc5ba1fc8a9c1efe4eccca0aedeb4ce0c51cf835309a01338093d14dc9ab0cc46fb7ba038fdf8787b
6
+ metadata.gz: 889ace53cc915c231a75edb002b35a5936986e392bfbddc0dbbacbd442150dfe2f1246bc97b5aa0bd51c6f22a316c70275b1de37cf18d7ce672c53dc2a2f9f40
7
+ data.tar.gz: 97f7168451eb2023b26617e04716ca12d083fd77557bf7d0097187a25f800af0af428575f555311bc27728415827ef33a0c790e9bd931a8035f0a30a648feedf
@@ -48,12 +48,20 @@ class Float
48
48
  def to_number
49
49
  self
50
50
  end
51
+
52
+ def to_html
53
+ self.to_s
54
+ end
51
55
  end
52
56
 
53
57
  class Integer
54
58
  def to_number
55
59
  self
56
60
  end
61
+
62
+ def to_html
63
+ self.to_s
64
+ end
57
65
  end
58
66
 
59
67
  class String
@@ -379,8 +379,10 @@ module Teepee
379
379
 
380
380
  def define expressions
381
381
  variable, _, value = expressions
382
- @parser.variables[variable.to_html] = value
383
- value.to_html
382
+ k = variable.to_html
383
+ v = value.to_html
384
+ @parser.variables[k] = v
385
+ get_operator k
384
386
  end
385
387
 
386
388
  def defined? variables
@@ -404,7 +406,9 @@ module Teepee
404
406
  end
405
407
 
406
408
  def dotimes expressions
407
- span_operator(expressions[1..-1] * expressions.first.to_number)
409
+ n = expressions.first.to_number
410
+ return "" if n.nil? or n < 1
411
+ span_operator expressions[1..-1] * n
408
412
  end
409
413
 
410
414
  def e
@@ -62,7 +62,11 @@ module Teepee
62
62
  end
63
63
 
64
64
  def to_number
65
- Float(to_html)
65
+ begin
66
+ Float(to_html)
67
+ rescue ArgumentError
68
+ nil
69
+ end
66
70
  end
67
71
 
68
72
  class << self
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.15.1
4
+ version: 0.15.2
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-04-17 00:00:00.000000000 Z
11
+ date: 2016-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport