cwninja-popthis 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.markdown +16 -10
  2. data/Rakefile +1 -1
  3. data/lib/pop_this.rb +5 -7
  4. 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 (you can be nice back, but that's another story), and I'm going to let you get at your mails with POP3!
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
- Wheeeeeeeee!
11
+ I hope you like it. I do!
12
12
 
13
- Also, I stole most of the code from [http://snippets.dzone.com/posts/show/5906](http://snippets.dzone.com/posts/show/5906).
13
+ ## Usage:
14
14
 
15
- So, erm, yeah.
15
+ Start the server:
16
16
 
17
- It will accept any username, and any password, and will only ever serve up the given dir.
17
+ popthis tmp/mails/
18
18
 
19
- I hope you like it. I do!
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
- ## Usage
29
+ ## Origins:
22
30
 
23
- Usage: popthis [port] [path]
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
@@ -15,7 +15,7 @@ end
15
15
 
16
16
  spec = Gem::Specification.new do |s|
17
17
  s.name = "popthis"
18
- s.version = "0.1"
18
+ s.version = "0.2"
19
19
  s.summary = "Run a pop server serving up the current dir."
20
20
  s.description = "Run a pop server serving up the current dir."
21
21
 
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(port, dir)
9
- super(port)
10
- @dir = dir
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 = nil)
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.1"
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-03-28 00:00:00 -07:00
12
+ date: 2009-04-10 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15