mailman 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,7 +4,7 @@ Mailman is an incoming mail processing microframework (with POP3 and Maildir
4
4
  support), that works with Rails "out of the box".
5
5
 
6
6
  require 'mailman'
7
- Mailman::Application.new do
7
+ Mailman::Application.run do
8
8
  to 'ticket-%id%@example.org' do

9
9
  Ticket.find(params[:id]).add_reply(message)
10
10
  end
@@ -10,7 +10,7 @@ email account, and adds them to a database.
10
10
 
11
11
  Mailman.config.maildir = '~/Maildir'
12
12
 
13
- Mailman::Application.new do
13
+ Mailman::Application.run do
14
14
  to 'support@example.org' do
15
15
  Ticket.new_from_message(message)
16
16
  end
@@ -63,7 +63,7 @@ the params helper (`params[:captures]`) as an Array, and as block arguments.
63
63
 
64
64
  Routes are defined within a Mailman application block:
65
65
 
66
- Mailman::Application.new do
66
+ Mailman::Application.run do
67
67
  # routes here
68
68
  end
69
69
 
@@ -2,12 +2,12 @@
2
2
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
3
  require 'mailman'
4
4
 
5
- Mailman::Application.new do
5
+ Mailman::Application.run do
6
6
 
7
7
  from('%user%@%domain%') do
8
8
  puts "Got #{message.subject} from #{params[:user]}"
9
9
  end
10
10
 
11
- end.run
11
+ end
12
12
 
13
13
  # cat ../spec/fixtures/example01.eml | ./simple_route.rb
@@ -2,6 +2,12 @@ module Mailman
2
2
  # The main application class. Pass a block to {#new} to create a new app.
3
3
  class Application
4
4
 
5
+ def self.run(&block)
6
+ app = new(&block)
7
+ app.run
8
+ app
9
+ end
10
+
5
11
  # @return [Router] the app's router
6
12
  attr_reader :router
7
13
 
@@ -1,3 +1,3 @@
1
1
  module Mailman
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailman
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
5
4
  prerelease: false
6
5
  segments:
7
6
  - 0
8
- - 1
7
+ - 2
9
8
  - 0
10
- version: 0.1.0
9
+ version: 0.2.0
11
10
  platform: ruby
12
11
  authors:
13
12
  - Jonathan Rudenberg
@@ -15,7 +14,7 @@ autorequire:
15
14
  bindir: bin
16
15
  cert_chain: []
17
16
 
18
- date: 2010-07-27 00:00:00 -04:00
17
+ date: 2010-07-28 00:00:00 -04:00
19
18
  default_executable:
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
@@ -26,7 +25,6 @@ dependencies:
26
25
  requirements:
27
26
  - - ">="
28
27
  - !ruby/object:Gem::Version
29
- hash: 9
30
28
  segments:
31
29
  - 2
32
30
  - 0
@@ -42,7 +40,6 @@ dependencies:
42
40
  requirements:
43
41
  - - ">="
44
42
  - !ruby/object:Gem::Version
45
- hash: 11
46
43
  segments:
47
44
  - 2
48
45
  - 3
@@ -58,7 +55,6 @@ dependencies:
58
55
  requirements:
59
56
  - - ">="
60
57
  - !ruby/object:Gem::Version
61
- hash: 19
62
58
  segments:
63
59
  - 0
64
60
  - 1
@@ -74,7 +70,6 @@ dependencies:
74
70
  requirements:
75
71
  - - ">="
76
72
  - !ruby/object:Gem::Version
77
- hash: 11
78
73
  segments:
79
74
  - 0
80
75
  - 5
@@ -90,7 +85,6 @@ dependencies:
90
85
  requirements:
91
86
  - - ">="
92
87
  - !ruby/object:Gem::Version
93
- hash: 3
94
88
  segments:
95
89
  - 0
96
90
  version: "0"
@@ -138,7 +132,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
132
  requirements:
139
133
  - - ">="
140
134
  - !ruby/object:Gem::Version
141
- hash: 3
142
135
  segments:
143
136
  - 0
144
137
  version: "0"
@@ -147,7 +140,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
140
  requirements:
148
141
  - - ">="
149
142
  - !ruby/object:Gem::Version
150
- hash: 3
151
143
  segments:
152
144
  - 0
153
145
  version: "0"