cwninja-popthis 0.1 → 0.2
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/README.markdown +16 -10
- data/Rakefile +1 -1
- data/lib/pop_this.rb +5 -7
- metadata +2 -2
data/README.markdown
CHANGED
@@ -6,20 +6,26 @@ So you downloaded [inaction_mailer](http://github.com/cwninja/inaction_mailer),
|
|
6
6
|
|
7
7
|
Now you want to preview your e-mails?!? You people are never happy!
|
8
8
|
|
9
|
-
Well, I'm a little tipsy, so I'm going to be nice
|
9
|
+
Well, I'm a little tipsy, so I'm going to be nice, and I'm going to let you get at your mails with POP3!
|
10
10
|
|
11
|
-
|
11
|
+
I hope you like it. I do!
|
12
12
|
|
13
|
-
|
13
|
+
## Usage:
|
14
14
|
|
15
|
-
|
15
|
+
Start the server:
|
16
16
|
|
17
|
-
|
17
|
+
popthis tmp/mails/
|
18
18
|
|
19
|
-
|
19
|
+
Now, configure your mail client as follows:
|
20
|
+
|
21
|
+
* Server: **localhost**
|
22
|
+
* Protocol: **POP3**
|
23
|
+
* Port: **2220**
|
24
|
+
* Username: anything
|
25
|
+
* Password: anything
|
26
|
+
|
27
|
+
You should now be able to see the contents of your tmp/mails folder in your mail client!
|
20
28
|
|
21
|
-
##
|
29
|
+
## Origins:
|
22
30
|
|
23
|
-
|
24
|
-
Default port: 2220
|
25
|
-
Default path: current working directory
|
31
|
+
I stole most of the code from [here](http://snippets.dzone.com/posts/show/5906)... so credit where credit's due.
|
data/Rakefile
CHANGED
data/lib/pop_this.rb
CHANGED
@@ -2,20 +2,18 @@ require 'gserver'
|
|
2
2
|
require 'digest/md5'
|
3
3
|
module PopThis
|
4
4
|
class POP3Server < GServer
|
5
|
-
attr_writer :hostname
|
6
|
-
attr_writer :dir
|
7
5
|
|
8
|
-
def initialize(
|
9
|
-
|
10
|
-
|
6
|
+
def initialize(options)
|
7
|
+
@hostname = options[:host]
|
8
|
+
super(options[:port])
|
9
|
+
@dir = options[:path]
|
11
10
|
end
|
12
11
|
|
13
12
|
class Email
|
14
13
|
attr_reader :filename
|
15
14
|
attr_accessor :deleted
|
16
15
|
|
17
|
-
def self.all(dir
|
18
|
-
dir ||= Dir.pwd
|
16
|
+
def self.all(dir)
|
19
17
|
Dir.glob("#{ dir }/*").reject{|fn| fn =~ /^\./ || File.directory?(fn) }.map{|fn| Email.new(fn) }
|
20
18
|
end
|
21
19
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cwninja-popthis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "0.
|
4
|
+
version: "0.2"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Lea
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-04-10 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|