mailman-rails 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -4,10 +4,15 @@ This gem helps you integrate <a href="https://github.com/titanous/mailman">ruby
4
4
 
5
5
  ## Installation
6
6
 
7
- Add these line to your application's Gemfile:
7
+ Add this line to your application's Gemfile:
8
8
 
9
9
  gem 'mailman-rails'
10
- gem 'mailman', :git => 'https://github.com/titanous/mailman' # The version in rubygems isn't yet compatible with this gem
10
+
11
+ And one of these lines depending on status of pull requests, versions etc:
12
+
13
+ gem 'mailman', :git => 'https://github.com/johncant/mailman'
14
+ gem 'mailman', :git => 'https://github.com/titanous/mailman'
15
+ gem 'mailman'
11
16
 
12
17
  And then execute:
13
18
 
@@ -1,13 +1,36 @@
1
- require "mailman-rails/version"
2
1
  require "rubygems"
3
- Gem.send :require, "mailman" # Force loading of the Gem, not my file
4
2
  require 'mailman'
5
- require "mailman/rails"
6
- require "mailman/rails/railtie"
7
- require File.expand_path("../mailman", __FILE__)
3
+ require "mailman-rails"
4
+ require "mailman-rails/version"
5
+ #require "mailman-rails/railtie"
6
+ #require File.expand_path("../mailman", __FILE__)
8
7
 
9
8
  module Mailman
10
9
  module Rails
11
- # Railtie added further down the tree
10
+ require 'mailman-rails/railtie'
11
+
12
+ @@application = nil
13
+
14
+ def self.application
15
+ @@application ||= Mailman::Application.new do end # Avoid forcing Mailman to require a block
16
+ end
17
+
18
+ def self.configure(&block)
19
+ Mailman.config.instance_exec(&block)
20
+ end
21
+
22
+ def self.receive(&block)
23
+ self.application.instance_exec(&block)
24
+ end
25
+
26
+ def self.run!
27
+
28
+ # Under no circumstances should Mailman itself load the Rails enviroment!
29
+ Mailman.config.rails_root = false
30
+
31
+ self.application.run
32
+ end
33
+
12
34
  end
13
35
  end
36
+
@@ -1,3 +1,5 @@
1
+ require File.expand_path('../../../mailman-rails', __FILE__)
2
+
1
3
  namespace :mailman do
2
4
 
3
5
  mailman_tasks = [:start, :stop, :restart, :status]
@@ -27,7 +29,7 @@ task :mailman => :environment do
27
29
 
28
30
  Mailman.config.logger = Logger.new("#{Rails.root}/log/mailman.#{Rails.env}.log")
29
31
 
30
- Mailman.run!
32
+ Mailman::Rails.run!
31
33
 
32
34
  end
33
35
 
@@ -1,5 +1,5 @@
1
1
  module Mailman
2
2
  module Rails
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -19,13 +19,13 @@ describe Mailman do
19
19
  # It's not true though, if one of the "ghost" specs fails, you still notice.
20
20
  spec = self
21
21
 
22
- Mailman.configure do
22
+ Mailman::Rails.configure do
23
23
  self.maildir = "#{spec.gem_root}/tmp/examples/"
24
24
  end
25
25
 
26
26
  emails_parsed = 0
27
27
 
28
- Mailman.receive do
28
+ Mailman::Rails.receive do
29
29
  to('email1@example') do
30
30
  route = self
31
31
  spec.instance_eval do
@@ -36,7 +36,7 @@ describe Mailman do
36
36
  end
37
37
  end
38
38
 
39
- Mailman.receive do
39
+ Mailman::Rails.receive do
40
40
  to('email2@example') do
41
41
  route = self
42
42
  spec.instance_eval do
@@ -47,7 +47,7 @@ describe Mailman do
47
47
  end
48
48
  end
49
49
 
50
- Mailman.application.process_maildir # If this had already happened, the spec would fail
50
+ Mailman::Rails.application.process_maildir # If this had already happened, the spec would fail
51
51
 
52
52
  emails_parsed.should == 2
53
53
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailman-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -91,11 +91,9 @@ files:
91
91
  - examples/new/1353967927.V801I42421M758136.example
92
92
  - examples/new/1353967928.V801I42421M758136.example
93
93
  - lib/mailman-rails.rb
94
+ - lib/mailman-rails/railtie.rb
95
+ - lib/mailman-rails/tasks/mailman.rake
94
96
  - lib/mailman-rails/version.rb
95
- - lib/mailman.rb
96
- - lib/mailman/rails.rb
97
- - lib/mailman/rails/railtie.rb
98
- - lib/mailman/rails/tasks/mailman.rake
99
97
  - mailman-rails.gemspec
100
98
  - spec/mailman_spec.rb
101
99
  - spec/spec_helper.rb
@@ -1,23 +0,0 @@
1
- module Mailman
2
- @@application = nil
3
-
4
- def self.application
5
- @@application ||= Mailman::Application.new do end # Avoid forcing Mailman to require a block
6
- end
7
-
8
- def self.configure(&block)
9
- Mailman.config.instance_exec(&block)
10
- end
11
-
12
- def self.receive(&block)
13
- self.application.instance_exec(&block)
14
- end
15
-
16
- def self.run!
17
-
18
- # Under no circumstances should Mailman itself load the Rails enviroment!
19
- Mailman.config.rails_root = false
20
-
21
- self.application.run
22
- end
23
- end
@@ -1,4 +0,0 @@
1
- module Mailman
2
- module Rails
3
- end
4
- end