www_app 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/www_app.rb +5 -0
- data/specs/server-side/0060-string.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ac3d7e64106fc22cd4e38a3bfbd85888c834cf1
|
4
|
+
data.tar.gz: c62cbdccc760e67b318ca898658c33a5292a7b2f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 044e9fc84e4e7988c0f95c0c2b20c50ad075a76e26139cf9c550878615e35a327820dd1968a09f99251011ab24bce72bed07354b4c88424ededf2425abcb6045
|
7
|
+
data.tar.gz: 909fa6164d9f4f7584a04ab41c70c80b4d9f067156f0889c96b8a2250d3c7bc8eecd3f29a9f363fa11c320697ae908a3065634d8bfb9538e49bc5dbc9daf4de5
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.2.
|
1
|
+
1.2.1
|
data/lib/www_app.rb
CHANGED
@@ -101,6 +101,7 @@ class WWW_App < BasicObject
|
|
101
101
|
Unescaped = ::Class.new(::StandardError)
|
102
102
|
Not_Unique = ::Class.new(::StandardError)
|
103
103
|
Wrong_Parent = ::Class.new(::StandardError)
|
104
|
+
Invalid_Type = ::Class.new(::StandardError)
|
104
105
|
HTML_ID_Duplicate = ::Class.new(Not_Unique)
|
105
106
|
|
106
107
|
ALWAYS_END_TAGS = [:script]
|
@@ -710,6 +711,10 @@ class WWW_App < BasicObject
|
|
710
711
|
input(:hidden, :auth_token, :auth_token.to_mustache(:html))
|
711
712
|
end
|
712
713
|
|
714
|
+
if (results.is_a?(::Hash) && results[:type] && !results[:tag] && results[:type] != :string)
|
715
|
+
fail Invalid_Type, results[:type].inspect
|
716
|
+
end
|
717
|
+
|
713
718
|
if (results.is_a?(::Hash) && results[:type] == :string) || results.is_a?(::String) || results.is_a?(::Symbol)
|
714
719
|
tag![:text] = results
|
715
720
|
end
|
@@ -19,4 +19,14 @@ describe "string content" do
|
|
19
19
|
end
|
20
20
|
end # === it prints a string if value is a hash: {:type=>:string, ...}
|
21
21
|
|
22
|
+
it "raises an error if :type is not :string" do
|
23
|
+
should.raise(WWW_App::Invalid_Type) {
|
24
|
+
actual do
|
25
|
+
p {
|
26
|
+
{:type=>"uNkNown val", :escape=>false, :value=>"string & string"}
|
27
|
+
}
|
28
|
+
end
|
29
|
+
}.message.should =~ /uNkNown/
|
30
|
+
end # === it raises an error if :type is not :string
|
31
|
+
|
22
32
|
end # === describe "string content"
|