userify 0.2.0 → 0.2.1

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.
@@ -26,7 +26,6 @@ Here's the setup method.
26
26
 
27
27
  Install Userify gem, as well as Haml.
28
28
 
29
- sudo gem sources -a http://gems.github.com # if you haven't do it already
30
29
  sudo gem install haml
31
30
  sudo gem install userify
32
31
 
@@ -34,7 +33,7 @@ In config/environment.rb:
34
33
 
35
34
  config.gem "haml"
36
35
  config.gem "userify"
37
- DO_NOT_REPLY = "donotreply@example.com"
36
+ UserifyMailer.sender_address = %("Do Not Reply" <donotreply@example.com>)
38
37
 
39
38
  Run the generator:
40
39
 
@@ -42,7 +41,11 @@ Run the generator:
42
41
 
43
42
  In config/environments/development.rb and test.rb:
44
43
 
45
- HOST = "localhost:3000"
44
+ config.action_mailer.default_url_options = { :host => "localhost", :port => 3000 }
45
+
46
+ In config/environments/production.rb:
47
+
48
+ config.action_mailer.default_url_options = { :host => "example.com" }
46
49
 
47
50
  Define root_url to *something* in your config/routes.rb. Assuming home controller for root:
48
51
 
data/Rakefile CHANGED
@@ -35,7 +35,7 @@ task :default => ['test:all', 'test:features']
35
35
 
36
36
  gem_spec = Gem::Specification.new do |gem_spec|
37
37
  gem_spec.name = "userify"
38
- gem_spec.version = "0.2.0"
38
+ gem_spec.version = "0.2.1"
39
39
  gem_spec.summary = "Super simple authentication system for Rails, using username, email and password."
40
40
  gem_spec.email = "kenn.ejima <at> gmail.com"
41
41
  gem_spec.homepage = "http://github.com/kenn/userify"
@@ -1,16 +1,16 @@
1
1
  class UserifyMailer < ActionMailer::Base
2
-
3
- default_url_options[:host] = HOST
2
+ @@sender_address = %("Do Not Reply" <donotreply@example.com>)
3
+ cattr_accessor :sender_address
4
4
 
5
5
  def reset_password(user)
6
- from DO_NOT_REPLY
6
+ from sender_address
7
7
  recipients user.email
8
8
  subject "Reset your password"
9
9
  body :user => user
10
10
  end
11
11
 
12
12
  def confirmation(user)
13
- from DO_NOT_REPLY
13
+ from sender_address
14
14
  recipients user.email
15
15
  subject "Account confirmation"
16
16
  body :user => user
@@ -3,17 +3,16 @@
3
3
 
4
4
  Ok, enough fancy automatic stuff. Time for some old school monkey copy-pasting.
5
5
 
6
- 1. Define a HOST constant in your environments files.
7
- In config/environments/test.rb and config/environments/development.rb it can be:
6
+ 1. Define default_url_options in your config/environments/* files.
8
7
 
9
- HOST = "localhost:3000"
8
+ config.action_mailer.default_url_options = { :host => "localhost", :port => 3000 }
9
+ config.action_mailer.default_url_options = { :host => "example.com" }
10
10
 
11
11
  In production.rb it must be the actual host your application is deployed to.
12
- The constant is used by mailers to generate URLs in emails.
13
12
 
14
13
  2. In config/environment.rb:
15
14
 
16
- DO_NOT_REPLY = "donotreply@example.com"
15
+ UserifyMailer.sender_address = %("Do Not Reply" <donotreply@example.com>)
17
16
 
18
17
  3. Define root_url to *something* in your config/routes.rb:
19
18
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: userify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenn Ejima