dkim-query 0.2.5 → 0.2.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dfa693ecdb8c2ff6703070e894ae88739d830987
4
- data.tar.gz: 117784a2b3ca90a0c171c1356bb868a5545a3559
3
+ metadata.gz: 9edb13bac9ddda5033d398b1c07f76f53bb4c71a
4
+ data.tar.gz: ded310d3e3c0f5153d9ac331a17165d6054d8af8
5
5
  SHA512:
6
- metadata.gz: 684c484de0d8d30171f6250376907c693b69d994ead22f2d1f0b353eaef4bbc917ce5e50b17ee7e5477b5df4bbaa5ff839546557fc72b18aa9b5d52551e51853
7
- data.tar.gz: f15924f5559ad378f3429426f39aeebc437aea1b9bccbebd9f3e2275336542fb7b609e8f994bf30660018af6711418d8b4832d313df7060244b2df7568e01d73
6
+ metadata.gz: a0b532e63fbd541c7f4784dc85ac4666ced8599b20d341a638ff92e9d6f59da150d882fc0e10f4756b246ca40fbbff892d9ba066ae120a0c6ff799b33775f476
7
+ data.tar.gz: ff4d52fa874948a45396629d77f7b9f174bb89db9622b2c6fc24a4752f700216fb50fc44efb5ca4c0deb0dc658988cfd07ae14d413182a7c6e5ec8e3890d1bf2
@@ -1,3 +1,7 @@
1
+ ### 0.2.6 / 2016-07-3
2
+
3
+ * Fixed a typo in the parser rules.
4
+
1
5
  ### 0.2.5 / 2016-06-17
2
6
 
3
7
  * Added `mandrill` and `google` to the list of default DKIM selectors.
@@ -96,8 +96,11 @@ module DKIM
96
96
  #
97
97
  # Section 2.4: Common ABNF Tokens
98
98
  #
99
- rule(:hypthenated_word) do
100
- alpha >> ((alpha | digit | str('-')).repeat(0) >> (alpha | digit)).maybe
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) >>
@@ -1,6 +1,6 @@
1
1
  module DKIM
2
2
  module Query
3
3
  # dkim-query version
4
- VERSION = '0.2.5'
4
+ VERSION = '0.2.6'
5
5
  end
6
6
  end
@@ -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.5
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-06-17 00:00:00.000000000 Z
11
+ date: 2016-08-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parslet