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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6deb97c603788b103774f666d964e7fdc72ce709
4
- data.tar.gz: 2020b45f8daffc2db74fbc1706cc403d8c0292d7
3
+ metadata.gz: 3ac3d7e64106fc22cd4e38a3bfbd85888c834cf1
4
+ data.tar.gz: c62cbdccc760e67b318ca898658c33a5292a7b2f
5
5
  SHA512:
6
- metadata.gz: 1644de2510fdd6caaf1a883b905667c6ea229184d9e0bb2ee585041acafb53073a4ecb46bc7c81a25b7432f8ce89b1e4a5b5f7ec0156d925f366f597c35fb67a
7
- data.tar.gz: 87aa38768884fd6181df7606c5490cdeaaba8310f0acb7002bbd7503e9cccd946ab2af7545efb4e92c6751e095598b62ba65c431edd5d454820f4bf71ddee91b
6
+ metadata.gz: 044e9fc84e4e7988c0f95c0c2b20c50ad075a76e26139cf9c550878615e35a327820dd1968a09f99251011ab24bce72bed07354b4c88424ededf2425abcb6045
7
+ data.tar.gz: 909fa6164d9f4f7584a04ab41c70c80b4d9f067156f0889c96b8a2250d3c7bc8eecd3f29a9f363fa11c320697ae908a3065634d8bfb9538e49bc5dbc9daf4de5
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.2.0
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"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: www_app
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - da99