remailer 0.4.2 → 0.4.3

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/Rakefile CHANGED
@@ -10,6 +10,7 @@ begin
10
10
  gem.email = "scott@twg.ca"
11
11
  gem.homepage = "http://github.com/twg/remailer"
12
12
  gem.authors = [ "Scott Tadman" ]
13
+ gem.add_runtime_dependency 'eventmachine'
13
14
  end
14
15
  Jeweler::GemcutterTasks.new
15
16
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.2
1
+ 0.4.3
@@ -77,14 +77,38 @@ class Remailer::Connection < EventMachine::Connection
77
77
  host_port = proxy_options[:port] || SOCKS5_PORT
78
78
  end
79
79
 
80
- begin
81
- EventMachine.connect(host_name, host_port, self, options)
82
- rescue EventMachine::ConnectionError => e
83
- options[:connect].is_a?(Proc) and options[:connect].call(false, e.to_s)
84
- options[:on_error].is_a?(Proc) and options[:on_error].call(e.to_s)
85
- options[:debug].is_a?(Proc) and options[:debug].call(:error, e.to_s)
86
- options[:error].is_a?(Proc) and options[:error].call(:connect_error, e.to_s)
80
+ EventMachine.connect(host_name, host_port, self, options)
81
+
82
+ rescue EventMachine::ConnectionError => e
83
+ case (options[:connect])
84
+ when Proc
85
+ options[:connect].call(false, e.to_s)
86
+ when IO
87
+ options[:connect].puts(e.to_s)
88
+ end
89
+
90
+ case (options[:on_error])
91
+ when Proc
92
+ options[:on_error].call(e.to_s)
93
+ when IO
94
+ options[:on_error].puts(e.to_s)
95
+ end
96
+
97
+ case (options[:debug])
98
+ when Proc
99
+ options[:debug].call(:error, e.to_s)
100
+ when IO
101
+ options[:debug].puts(e.to_s)
102
+ end
103
+
104
+ case (options[:error])
105
+ when Proc
106
+ options[:error].call(:connect_error, e.to_s)
107
+ when IO
108
+ options[:error].puts(e.to_s)
87
109
  end
110
+
111
+ false
88
112
  end
89
113
 
90
114
  # Warns about supplying a Proc which does not appear to accept the required
@@ -62,11 +62,11 @@ class Remailer::Connection::Socks5Interpreter < Remailer::Interpreter
62
62
  end
63
63
 
64
64
  parse do |s|
65
- return unless (s.length >= 2)
65
+ if (s.length >= 2)
66
+ version, method = s.slice!(0,2).unpack('CC')
66
67
 
67
- version, method = s.slice!(0,2).unpack('CC')
68
-
69
- method
68
+ method
69
+ end
70
70
  end
71
71
 
72
72
  interpret(SOCKS5_METHOD[:username_password]) do
@@ -168,7 +168,7 @@ class Remailer::Connection::Socks5Interpreter < Remailer::Interpreter
168
168
  state :failed do
169
169
  enter do
170
170
  message = "Proxy server returned error code #{@reply}: #{SOCKS5_REPLY[@reply]}"
171
- delegate.debug(:error, message)
171
+ delegate.debug_notification(:error, message)
172
172
  delegate.connect_notification(false, message)
173
173
  delegate.close_connection
174
174
  end
data/remailer.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{remailer}
8
- s.version = "0.4.2"
8
+ s.version = "0.4.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Scott Tadman"]
12
- s.date = %q{2011-01-27}
12
+ s.date = %q{2011-03-02}
13
13
  s.description = %q{EventMachine SMTP Mail User Agent}
14
14
  s.email = %q{scott@twg.ca}
15
15
  s.extra_rdoc_files = [
@@ -38,7 +38,7 @@ Gem::Specification.new do |s|
38
38
  ]
39
39
  s.homepage = %q{http://github.com/twg/remailer}
40
40
  s.require_paths = ["lib"]
41
- s.rubygems_version = %q{1.3.7}
41
+ s.rubygems_version = %q{1.5.3}
42
42
  s.summary = %q{Reactor-Ready SMTP Mailer}
43
43
  s.test_files = [
44
44
  "test/config.example.rb",
@@ -52,13 +52,15 @@ Gem::Specification.new do |s|
52
52
  ]
53
53
 
54
54
  if s.respond_to? :specification_version then
55
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
56
55
  s.specification_version = 3
57
56
 
58
57
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
58
+ s.add_runtime_dependency(%q<eventmachine>, [">= 0"])
59
59
  else
60
+ s.add_dependency(%q<eventmachine>, [">= 0"])
60
61
  end
61
62
  else
63
+ s.add_dependency(%q<eventmachine>, [">= 0"])
62
64
  end
63
65
  end
64
66
 
metadata CHANGED
@@ -1,12 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remailer
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 4
8
- - 2
9
- version: 0.4.2
4
+ prerelease:
5
+ version: 0.4.3
10
6
  platform: ruby
11
7
  authors:
12
8
  - Scott Tadman
@@ -14,10 +10,20 @@ autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
12
 
17
- date: 2011-01-27 00:00:00 -05:00
13
+ date: 2011-03-02 00:00:00 -05:00
18
14
  default_executable:
19
- dependencies: []
20
-
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: eventmachine
18
+ prerelease: false
19
+ requirement: &id001 !ruby/object:Gem::Requirement
20
+ none: false
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ type: :runtime
26
+ version_requirements: *id001
21
27
  description: EventMachine SMTP Mail User Agent
22
28
  email: scott@twg.ca
23
29
  executables: []
@@ -60,21 +66,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
60
66
  requirements:
61
67
  - - ">="
62
68
  - !ruby/object:Gem::Version
63
- segments:
64
- - 0
65
69
  version: "0"
66
70
  required_rubygems_version: !ruby/object:Gem::Requirement
67
71
  none: false
68
72
  requirements:
69
73
  - - ">="
70
74
  - !ruby/object:Gem::Version
71
- segments:
72
- - 0
73
75
  version: "0"
74
76
  requirements: []
75
77
 
76
78
  rubyforge_project:
77
- rubygems_version: 1.3.7
79
+ rubygems_version: 1.5.3
78
80
  signing_key:
79
81
  specification_version: 3
80
82
  summary: Reactor-Ready SMTP Mailer