isomorfeus-react 16.12.18 → 16.12.19

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
  SHA256:
3
- metadata.gz: 0cdb3fe9f9ac0989e122cd62cebb2eb9c9d906e65b160d6ec89311410673c796
4
- data.tar.gz: 4fe01c1d3bba31402af4fc1e3d12a208735178f66f42c54beb9a49d4e725f75d
3
+ metadata.gz: 132a99117abaac3fec23a796fc8ecfcbf5345e3958610a1f99e323121c585bd7
4
+ data.tar.gz: 819016d219fbb375aa3099fe42ab632b25482de9d4994c17cc566d86b9ecf2b6
5
5
  SHA512:
6
- metadata.gz: 2f4d13ca4f1d3ca81f3563a57e72ff7ef338606e2abcdfd41518cd8e85e4a1a5fe952904d6382a9100c1db7d882e0387effa6568b71b2d8375ac6d1a0cd173ad
7
- data.tar.gz: d7887ef8e4ab8f5b0a91de7feeebd0bfcb6bfa613b2a2cfc389c39a4a020d91c373bd95e5311f6431f3d3813767f71f95eff8e849ac8afd92625bae40d95f87c
6
+ metadata.gz: a15c75fcc3c20763f875572b36bd65eb98d756675f83beeab24272804911febf0e76e9cc975e8d8319478d0103f7c1cd2e49942131b3821b833d2dbfa2679412
7
+ data.tar.gz: 49436125dcab5c7fb04a4ad8201b20e6f242cfe83110d4319db06a2e347302188e6f46562c213789ee31954ea30b91a764334eddef9873186a5603a4593d0ed3
@@ -169,14 +169,12 @@ module Isomorfeus
169
169
  # sub types
170
170
 
171
171
  def Email
172
- @validation_hash[:type] = :string
173
- @validation_hash[:validate][:sub_type] = :email
172
+ @validation_hash[:type] = :email
174
173
  self
175
174
  end
176
175
 
177
176
  def Url
178
- @validation_hash[:type] = :string
179
- @validation_hash[:validate][:sub_type] = :url
177
+ @validation_hash[:type] = :uri
180
178
  self
181
179
  end
182
180
 
@@ -72,6 +72,8 @@ module Isomorfeus
72
72
  case @o[:type]
73
73
  when :boolean
74
74
  Isomorfeus.raise_error(message: "#{@c}: #{@p} is not a boolean") unless @v.class == TrueClass || @v.class == FalseClass
75
+ else
76
+ c_string_sub_types
75
77
  end
76
78
  end
77
79
  end
@@ -133,10 +135,34 @@ module Isomorfeus
133
135
  Isomorfeus.raise_error(message: "#{@c}: #{@p} test condition check failed") unless @o[:test].call(@v)
134
136
  end
135
137
 
136
- def c_sub_type(v)
137
- case v
138
+ def c_string_sub_types
139
+ Isomorfeus.raise_error(message: "#{@c}: #{@p} must be a String") unless @v.class == String
140
+ case @o[:type]
138
141
  when :email
139
- when :url
142
+ Isomorfeus.raise_error(message: "#{@c}: #{@p} is not a valid email address") unless @v.match? /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/
143
+ when :uri
144
+ if RUBY_ENGINE == 'opal'
145
+ %x{
146
+ try {
147
+ new URL(#@v);
148
+ } catch {
149
+ #{Isomorfeus.raise_error(message: "#{@c}: #{@p} is not a valid uri")}
150
+ }
151
+ }
152
+ else
153
+ unless @v.match? /\A([a-zA-Z][\-+.a-zA-Z\d]*):(?:((?:[\-_.!~*'()a-zA-Z\d;?:@&=+$,]|%[a-fA-F\d]{2})(?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|
154
+ %[a-fA-F\d]{2})*)|(?:(?:\/\/(?:(?:(?:((?:[\-_.!~*'()a-zA-Z\d;:&=+$,]|%[a-fA-F\d]{2})*)@)?(?:((?:(?:[a-zA-Z0-9\-.]|
155
+ %\h\h)+|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|
156
+ \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|
157
+ (?:(?:[a-fA-F\d]{1,4}:)*[a-fA-F\d]{1,4})?::(?:(?:[a-fA-F\d]{1,4}:)*(?:[a-fA-F\d]{1,4}|
158
+ \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))?)\]))(?::(\d*))?))?|((?:[\-_.!~*'()a-zA-Z\d$,;:@&=+]|%[a-fA-F\d]{2})+))|
159
+ (?!\/\/))(\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|
160
+ %[a-fA-F\d]{2})*)*(?:\/(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[\-_.!~*'()a-zA-Z\d:@&=+$,]|
161
+ %[a-fA-F\d]{2})*)*)*)?)(?:\?((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|
162
+ %[a-fA-F\d]{2})*))?)(?:\#((?:[\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))?\z/x
163
+ Isomorfeus.raise_error(message: "#{@c}: #{@p} is not a valid uri")
164
+ end
165
+ end
140
166
  end
141
167
  end
142
168
  end
@@ -68,6 +68,12 @@ module LucidPropDeclaration
68
68
  false
69
69
  end
70
70
 
71
+ def valid_props?(props)
72
+ validate_props(props)
73
+ rescue
74
+ false
75
+ end
76
+
71
77
  def validate
72
78
  Isomorfeus::Props::ValidateHashProxy.new
73
79
  end
@@ -1,3 +1,3 @@
1
1
  module React
2
- VERSION = '16.12.18'
2
+ VERSION = '16.12.19'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isomorfeus-react
3
3
  version: !ruby/object:Gem::Version
4
- version: 16.12.18
4
+ version: 16.12.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Biedermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-13 00:00:00.000000000 Z
11
+ date: 2020-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: concurrent-ruby
@@ -277,7 +277,7 @@ metadata:
277
277
  github_repo: ssh://github.com/isomorfeus/gems
278
278
  post_install_message: |2+
279
279
 
280
- isomorfeus-react 16.12.18:
280
+ isomorfeus-react 16.12.19:
281
281
  Breaking change:
282
282
  The event_handler DSL is gone. Instead use normal methods and method_ref, see:
283
283
  https://github.com/isomorfeus/isomorfeus-react/blob/master/ruby/docs/events.md