renshi 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/renshi/parser.rb CHANGED
@@ -132,7 +132,7 @@ module Renshi
132
132
  else #$foo
133
133
 
134
134
  #divide with a delimiter for anything which is not a name character - alpa-numeric and underscore
135
- words = text[(idx +1)..-1].split(/[^\w."'{}()+=*\/\-@]/)
135
+ words = text[(idx +1)..-1].split(/[^\w."'{}()+=*\/\-@\[\]]/)
136
136
  words[0] = "'$'" if words[0] == "$"
137
137
  statement_str = words.first
138
138
  statement = Statement.new(statement_str)
data/lib/renshi.rb CHANGED
@@ -9,7 +9,7 @@ require 'renshi/attribute_expressions'
9
9
  require 'renshi/frameworks'
10
10
 
11
11
  module Renshi
12
- VERSION="0.1.5"
12
+ VERSION="0.1.6"
13
13
 
14
14
  class SyntaxError < StandardError; end
15
15
  end
data/spec/parser_spec.rb CHANGED
@@ -117,7 +117,7 @@ class Test
117
117
  end
118
118
  end
119
119
 
120
- it "should interpret single $foo.bar using \W" do
120
+ it "should interpret single $foo.bar " do
121
121
  raw = Renshi::Parser.parse("$foo.bar")
122
122
  foo = Test.new
123
123
  html = eval(raw, binding)
@@ -125,7 +125,7 @@ end
125
125
  html.should eql "hello world"
126
126
  end
127
127
 
128
- it "should interpret single $1+1 and $2*2 and $3/3 and $4-4 using \W" do
128
+ it "should interpret single $1+1 and $2*2 and $3/3 and $4-4 " do
129
129
  raw = Renshi::Parser.parse("$1+1")
130
130
  foo = Test.new
131
131
  html = eval(raw, binding)
@@ -148,4 +148,11 @@ end
148
148
  end
149
149
 
150
150
 
151
+ it "should interpret $foo[0] " do
152
+ raw = Renshi::Parser.parse("$foo[0]")
153
+ foo = ["hello world"]
154
+ html = eval(raw, binding)
155
+
156
+ html.should eql "hello world"
157
+ end
151
158
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: renshi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Faiz
@@ -9,7 +9,7 @@ autorequire: renshi
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-19 00:00:00 +10:00
12
+ date: 2009-08-24 00:00:00 +10:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency