spf 0.0.12 → 0.0.13

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.
data/lib/spf/model.rb CHANGED
@@ -260,7 +260,7 @@ class SPF::Mech < SPF::Term
260
260
  if @parse_text.sub!(/^ (#{NAME_PATTERN}) (?: : (?=.) )? /x, '')
261
261
  @name = $1
262
262
  else
263
- raise SPF::InvalidMech.new("Unexpected mechanism encountered in '#{@text}'")
263
+ raise SPF::InvalidMechError.new("Unexpected mechanism encountered in '#{@text}'")
264
264
  end
265
265
  end
266
266
 
@@ -833,13 +833,13 @@ class SPF::Record
833
833
  # Looks like a mechanism:
834
834
  mech_text = $1
835
835
  mech_name = $2.downcase
836
- mech_class = self.mech_classes[mech_name.to_sym]
837
- unless mech_class
838
- raise SPF::InvalidMech.new("Unknown mechanism type '#{mech_name}' in '#{@version_tag}' record")
839
- end
836
+ mech_class = self.mech_classes[mech_name.to_sym] || SPF::Mech
840
837
  term = mech = mech_class.new_from_string(mech_text)
841
838
  @ip_netblocks << mech.ip_netblocks
842
839
  @terms << mech
840
+ if mech_class == SPF::Mech
841
+ raise SPF::InvalidMechError.new("Unknown mechanism type '#{mech_name}' in '#{@version_tag}' record")
842
+ end
843
843
  elsif (
844
844
  @parse_text.sub!(/
845
845
  ^
@@ -853,7 +853,7 @@ class SPF::Record
853
853
  # Looks like a modifier:
854
854
  mod_text = $1
855
855
  mod_name = $2.downcase
856
- mod_class = self.class::MOD_CLASSES[mod_name.to_sym]
856
+ mod_class = self.class::MOD_CLASSES[mod_name.to_sym] || SPF::Mod
857
857
  if mod_class
858
858
  # Known modifier.
859
859
  term = mod = mod_class.new_from_string(mod_text)
data/lib/spf/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module SPF
2
- VERSION = '0.0.12'
2
+ VERSION = '0.0.13'
3
3
  end
4
4
 
5
5
  # vim:sw=2 sts=2
data/spf.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "spf"
8
- s.version = "0.0.12"
8
+ s.version = "0.0.13"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Andrew Flury", "Julian Mehnle"]
12
- s.date = "2013-10-26"
12
+ s.date = "2013-10-29"
13
13
  s.description = " An object-oriented Ruby implementation of the Sender Policy Framework (SPF)\n e-mail sender authentication system, fully compliant with RFC 4408.\n"
14
14
  s.email = ["code@agari.com", "aflury@agari.com", "jmehnle@agari.com"]
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-10-26 00:00:00.000000000 Z
13
+ date: 2013-10-29 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -119,6 +119,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
119
  - - ! '>='
120
120
  - !ruby/object:Gem::Version
121
121
  version: '0'
122
+ segments:
123
+ - 0
124
+ hash: -4387479351355747049
122
125
  required_rubygems_version: !ruby/object:Gem::Requirement
123
126
  none: false
124
127
  requirements: