spf-query 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/ChangeLog.md +5 -0
- data/Gemfile +1 -0
- data/Rakefile +2 -1
- data/lib/spf/query/exceptions.rb +3 -0
- data/lib/spf/query/parser.rb +2 -0
- data/lib/spf/query/record.rb +11 -3
- data/lib/spf/query/version.rb +1 -1
- data/spec/record_spec.rb +10 -0
- metadata +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad212d3a18fdf143d0a478c9b703a51fd790b704
|
4
|
+
data.tar.gz: 85e5eaf89a001162b200707971c1aeeccf59fac8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ebdda6c3f7346574531cdcd5c2739e5424077fe768712298cc239a6c7f46e68fc799b2d0921d63b528ad78102a5424e2f03312818d4c9586472a0e8d569849b3
|
7
|
+
data.tar.gz: e3a139ead34ca81521bd4ff91696d5152db75b9380d364f39acdfc9d3a98f047bb1344933d372c2dddf083732c131239d6564e6964a23e463f73e836c3930bd1
|
data/.travis.yml
CHANGED
data/ChangeLog.md
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
data/lib/spf/query/exceptions.rb
CHANGED
data/lib/spf/query/parser.rb
CHANGED
data/lib/spf/query/record.rb
CHANGED
@@ -134,14 +134,22 @@ module SPF
|
|
134
134
|
# @raise [InvalidRecord]
|
135
135
|
# The SPF record could not be parsed.
|
136
136
|
#
|
137
|
+
# @raise [SenderIDFound]
|
138
|
+
#
|
137
139
|
# @see Parser.parse
|
138
140
|
#
|
139
141
|
# @api public
|
140
142
|
#
|
141
143
|
def self.parse(spf)
|
142
|
-
|
143
|
-
|
144
|
-
|
144
|
+
if spf.include?('spf2.0')
|
145
|
+
raise(SenderIDFound,"Sender ID was found in place of SPF")
|
146
|
+
end
|
147
|
+
|
148
|
+
begin
|
149
|
+
Parser.parse(spf)
|
150
|
+
rescue Parslet::ParseFailed => error
|
151
|
+
raise(InvalidRecord.new(error.message,error.cause))
|
152
|
+
end
|
145
153
|
end
|
146
154
|
|
147
155
|
#
|
data/lib/spf/query/version.rb
CHANGED
data/spec/record_spec.rb
CHANGED
@@ -173,6 +173,16 @@ describe SPF::Query::Record do
|
|
173
173
|
}.to raise_error(InvalidRecord)
|
174
174
|
end
|
175
175
|
end
|
176
|
+
|
177
|
+
context "when given a SenderID record" do
|
178
|
+
let(:sender_id) { "spf2.0/mfrom,pra or spf2.0/pra,mfrom" }
|
179
|
+
|
180
|
+
it "should raise a SenderIDFound exception" do
|
181
|
+
expect {
|
182
|
+
described_class.parse(sender_id)
|
183
|
+
}.to raise_error(SenderIDFound)
|
184
|
+
end
|
185
|
+
end
|
176
186
|
end
|
177
187
|
|
178
188
|
describe ".query" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spf-query
|
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
|
- nicktitle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parslet
|
@@ -118,4 +118,3 @@ test_files:
|
|
118
118
|
- spec/query_spec.rb
|
119
119
|
- spec/record_spec.rb
|
120
120
|
- spec/spec_helper.rb
|
121
|
-
has_rdoc:
|