rfc3987 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rfc3987.rb +4 -3618
- data/lib/rfc3987/validation.rb +11 -0
- data/lib/rfc3987/version.rb +1 -1
- data/rfc3987.treetop +7 -7
- metadata +2 -2
- data/lib/rfc3987/parser.rb +0 -13
data/lib/rfc3987/version.rb
CHANGED
data/rfc3987.treetop
CHANGED
@@ -48,7 +48,7 @@ grammar RFC3987
|
|
48
48
|
end
|
49
49
|
|
50
50
|
rule ipath_abempty
|
51
|
-
( '/' isegment)*
|
51
|
+
( '/' isegment )*
|
52
52
|
end
|
53
53
|
|
54
54
|
rule ipath_absolute
|
@@ -56,7 +56,7 @@ grammar RFC3987
|
|
56
56
|
end
|
57
57
|
|
58
58
|
rule ipath_noscheme
|
59
|
-
isegment_nz_nc ( '/' isegment)*
|
59
|
+
isegment_nz_nc ( '/' isegment )*
|
60
60
|
end
|
61
61
|
|
62
62
|
rule ipath_rootless
|
@@ -105,8 +105,9 @@ grammar RFC3987
|
|
105
105
|
/ [\u40000-\u4FFFD] / [\u50000-\u5FFFD] / [\u60000-\u6FFFD]
|
106
106
|
/ [\u70000-\u7FFFD] / [\u80000-\u8FFFD] / [\u90000-\u9FFFD]
|
107
107
|
/ [\uA0000-\uAFFFD] / [\uB0000-\uBFFFD] / [\uC0000-\uCFFFD]
|
108
|
-
|
109
|
-
|
108
|
+
# FIXME: Ruby says \uD800-\uDFFFD seems invalid Unicode codepoint
|
109
|
+
#/ [\uD0000-\uDFFFD]
|
110
|
+
/ [\uE1000-\uEFFFD] / [\uE1000-\uEFFFD]
|
110
111
|
end
|
111
112
|
|
112
113
|
rule iprivate
|
@@ -154,9 +155,9 @@ grammar RFC3987
|
|
154
155
|
end
|
155
156
|
|
156
157
|
rule dec_octet
|
157
|
-
DIGIT
|
158
|
+
DIGIT # 0-9
|
158
159
|
/ ['0x30'-'0x39'] DIGIT # 10-99
|
159
|
-
/ "1" DIGIT 2..2
|
160
|
+
/ "1" DIGIT 2..2 # 100-199
|
160
161
|
/ "2" ['0x30'-'0x34'] DIGIT # 200-249
|
161
162
|
/ "25" ['0x30'-'0x35'] # 250-255
|
162
163
|
end
|
@@ -192,5 +193,4 @@ grammar RFC3987
|
|
192
193
|
rule HEXDIG
|
193
194
|
[0-9A-F]
|
194
195
|
end
|
195
|
-
|
196
196
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rfc3987
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kajisha
|
@@ -98,7 +98,7 @@ files:
|
|
98
98
|
- bin/console
|
99
99
|
- bin/setup
|
100
100
|
- lib/rfc3987.rb
|
101
|
-
- lib/rfc3987/
|
101
|
+
- lib/rfc3987/validation.rb
|
102
102
|
- lib/rfc3987/version.rb
|
103
103
|
- rfc3987.gemspec
|
104
104
|
- rfc3987.treetop
|
data/lib/rfc3987/parser.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
class RFC3987::Parser < Treetop::Runtime::CompiledParser
|
2
|
-
include RFC3987
|
3
|
-
|
4
|
-
class << self
|
5
|
-
def valid_path?(str)
|
6
|
-
!self.new.parse(str, root: :ipath).nil?
|
7
|
-
end
|
8
|
-
|
9
|
-
def valid_segment?(str)
|
10
|
-
!self.new.parse(str, root: :isegment).nil?
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|