dkim-query 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +4 -0
- data/lib/dkim/query/parser.rb +5 -2
- data/lib/dkim/query/version.rb +1 -1
- data/spec/parser_spec.rb +57 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9edb13bac9ddda5033d398b1c07f76f53bb4c71a
|
4
|
+
data.tar.gz: ded310d3e3c0f5153d9ac331a17165d6054d8af8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0b532e63fbd541c7f4784dc85ac4666ced8599b20d341a638ff92e9d6f59da150d882fc0e10f4756b246ca40fbbff892d9ba066ae120a0c6ff799b33775f476
|
7
|
+
data.tar.gz: ff4d52fa874948a45396629d77f7b9f174bb89db9622b2c6fc24a4752f700216fb50fc44efb5ca4c0deb0dc658988cfd07ae14d413182a7c6e5ec8e3890d1bf2
|
data/ChangeLog.md
CHANGED
data/lib/dkim/query/parser.rb
CHANGED
@@ -96,8 +96,11 @@ module DKIM
|
|
96
96
|
#
|
97
97
|
# Section 2.4: Common ABNF Tokens
|
98
98
|
#
|
99
|
-
rule(:
|
100
|
-
alpha >> (
|
99
|
+
rule(:hyphenated_word) do
|
100
|
+
alpha >> (
|
101
|
+
(str('-').absnt? >> (alpha | digit)) |
|
102
|
+
(str('-').repeat(0) >> (alpha | digit))
|
103
|
+
).repeat(0)
|
101
104
|
end
|
102
105
|
rule(:base64string) do
|
103
106
|
(alpha | digit | str('+') | str('/') | fws).repeat(1) >>
|
data/lib/dkim/query/version.rb
CHANGED
data/spec/parser_spec.rb
CHANGED
@@ -60,6 +60,13 @@ describe Parser do
|
|
60
60
|
]
|
61
61
|
}
|
62
62
|
end
|
63
|
+
|
64
|
+
it "should parse h=abc-123-xyz" do
|
65
|
+
expect(subject.parse('h=abc-123-xyz')).to be == {
|
66
|
+
name: 'h',
|
67
|
+
value: {string: 'abc-123-xyz'}
|
68
|
+
}
|
69
|
+
end
|
63
70
|
end
|
64
71
|
|
65
72
|
describe "k" do
|
@@ -71,6 +78,13 @@ describe Parser do
|
|
71
78
|
value: {symbol: 'rsa'}
|
72
79
|
}
|
73
80
|
end
|
81
|
+
|
82
|
+
it "should parse k=abc-123-xyz" do
|
83
|
+
expect(subject.parse('k=abc-123-xyz')).to be == {
|
84
|
+
name: 'k',
|
85
|
+
value: {string: 'abc-123-xyz'}
|
86
|
+
}
|
87
|
+
end
|
74
88
|
end
|
75
89
|
|
76
90
|
describe "n" do
|
@@ -122,6 +136,13 @@ describe Parser do
|
|
122
136
|
value: [{symbol: 'email'}, {symbol: '*'}]
|
123
137
|
}
|
124
138
|
end
|
139
|
+
|
140
|
+
it "should parse s=abc-123-xyz" do
|
141
|
+
expect(subject.parse('s=abc-123-xyz')).to be == {
|
142
|
+
name: 's',
|
143
|
+
value: {string: 'abc-123-xyz'}
|
144
|
+
}
|
145
|
+
end
|
125
146
|
end
|
126
147
|
|
127
148
|
describe "t" do
|
@@ -140,6 +161,13 @@ describe Parser do
|
|
140
161
|
value: {symbol: 's'}
|
141
162
|
}
|
142
163
|
end
|
164
|
+
|
165
|
+
it "should parse t=abc-123-xyz" do
|
166
|
+
expect(subject.parse('t=abc-123-xyz')).to be == {
|
167
|
+
name: 't',
|
168
|
+
value: {string: 'abc-123-xyz'}
|
169
|
+
}
|
170
|
+
end
|
143
171
|
end
|
144
172
|
end
|
145
173
|
|
@@ -151,6 +179,35 @@ describe Parser do
|
|
151
179
|
end
|
152
180
|
|
153
181
|
describe "hyphenated_word" do
|
182
|
+
subject { super().hyphenated_word }
|
183
|
+
|
184
|
+
it "should parse abc" do
|
185
|
+
expect(subject.parse('abc')).to be == 'abc'
|
186
|
+
end
|
187
|
+
|
188
|
+
it "should parse abc123" do
|
189
|
+
expect(subject.parse('abc123')).to be == 'abc123'
|
190
|
+
end
|
191
|
+
|
192
|
+
it "should parse a-b-c" do
|
193
|
+
expect(subject.parse('a-b-c')).to be == 'a-b-c'
|
194
|
+
end
|
195
|
+
|
196
|
+
it "should parse a---b---c" do
|
197
|
+
expect(subject.parse('a---b---c')).to be == 'a---b---c'
|
198
|
+
end
|
199
|
+
|
200
|
+
it "should not parse -a" do
|
201
|
+
expect { subject.parse('-a') }.to raise_error(Parslet::ParseFailed)
|
202
|
+
end
|
203
|
+
|
204
|
+
it "should not parse a-" do
|
205
|
+
expect { subject.parse('a-') }.to raise_error(Parslet::ParseFailed)
|
206
|
+
end
|
207
|
+
|
208
|
+
it "should not parse -" do
|
209
|
+
expect { subject.parse('-') }.to raise_error(Parslet::ParseFailed)
|
210
|
+
end
|
154
211
|
end
|
155
212
|
|
156
213
|
describe "base64string" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dkim-query
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nicktitle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parslet
|