casein 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/PUBLIC_VERSION.yml +4 -0
- data/README.rdoc +6 -1
- data/Rakefile +1 -1
- data/app/helpers/casein/casein_helper.rb +2 -2
- data/app/mailers/casein/casein_notification.rb +6 -11
- data/app/models/casein/user.rb +3 -3
- metadata +4 -3
data/PUBLIC_VERSION.yml
ADDED
data/README.rdoc
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Casein is a plugin that provides scaffolding generators and helper functions to quickly create a clean and minimal CRUD (Create, Read, Update and Delete) interface for your data. It also comes with a pre-rolled user authentication system. As Casein is completely decoupled from the front-end, it can be added to a new or existing Rails project, or used as a standalone CMS to drive platforms built on other technologies.
|
4
4
|
|
5
|
+
This version of Casein is designed for Ruby on Rails 3.x. For a legacy version that is compatible with Rails 2.x, see: http://github.com/spoiledmilk/casein
|
6
|
+
|
5
7
|
==Disclaimer
|
6
8
|
|
7
9
|
Casein is the in-house CMS framework used by digital agency Spoiled Milk and is being used in many live production websites. This open source project is an attempt to extract and share the core.
|
@@ -12,10 +14,13 @@ Casein is sponsored by Spoiled Milk (http://www.spoiledmilk.dk) and maintained b
|
|
12
14
|
|
13
15
|
Casein 3.x is built for Ruby on Rails 3 and has the following major updates:
|
14
16
|
|
17
|
+
* Authentication changed to use Authlogic
|
15
18
|
* Supplied as a gem
|
16
19
|
* Runs as an Engine
|
17
20
|
* Now properly namespaced
|
21
|
+
* Timezone support
|
18
22
|
* Rails 3 compatibility fixes
|
23
|
+
* Many other tweaks and improvements over Casein 2.x
|
19
24
|
|
20
25
|
==Installation
|
21
26
|
|
@@ -55,7 +60,7 @@ Casein 3.x is built for Ruby on Rails 3 and has the following major updates:
|
|
55
60
|
|
56
61
|
rails g casein:update
|
57
62
|
|
58
|
-
|
63
|
+
— Perform a database migration to create the Casein users table:
|
59
64
|
|
60
65
|
rake db:create (if needed)
|
61
66
|
rake db:migrate
|
data/Rakefile
CHANGED
@@ -28,7 +28,7 @@ begin
|
|
28
28
|
gem.name = "casein"
|
29
29
|
gem.summary = "A lightweight Ruby on Rails CMS."
|
30
30
|
gem.description = "Casein is an open source CMS for Ruby on Rails, originally developed by Spoiled Milk."
|
31
|
-
gem.files = Dir["Gemfile", "MIT-LICENSE", "Rakefile", "README.rdoc", "{lib}/**/*", "{app}/**/*", "{config}/**/*"]
|
31
|
+
gem.files = Dir["Gemfile", "MIT-LICENSE", "Rakefile", "README.rdoc", "PUBLIC_VERSION.yml", "{lib}/**/*", "{app}/**/*", "{config}/**/*"]
|
32
32
|
gem.email = "mail@russellquinn.com"
|
33
33
|
gem.authors = ["Russell Quinn", "Spoiled Milk"]
|
34
34
|
gem.homepage = "http://github.com/spoiledmilk/casein3"
|
@@ -1,8 +1,8 @@
|
|
1
1
|
module Casein
|
2
2
|
module CaseinHelper
|
3
3
|
|
4
|
-
def casein_get_version_info
|
5
|
-
YAML::load_file File.join(File.dirname(__FILE__), '..', '..', '..', '
|
4
|
+
def casein_get_version_info
|
5
|
+
YAML::load_file File.join(File.dirname(__FILE__), '..', '..', '..', 'PUBLIC_VERSION.yml')
|
6
6
|
end
|
7
7
|
|
8
8
|
def casein_get_full_version_string
|
@@ -1,35 +1,30 @@
|
|
1
1
|
module Casein
|
2
2
|
|
3
|
-
require 'casein/config_helper'
|
4
|
-
include Casein::ConfigHelper
|
5
|
-
|
6
3
|
class CaseinNotification < ActionMailer::Base
|
7
4
|
|
8
|
-
default :from => casein_config_email_from_address
|
9
|
-
|
10
5
|
self.prepend_view_path File.join(File.dirname(__FILE__), '..', 'views', 'casein')
|
11
6
|
|
12
|
-
def generate_new_password casein_user, host, pass
|
7
|
+
def generate_new_password from, casein_user, host, pass
|
13
8
|
@name = casein_user.name
|
14
9
|
@host = host
|
15
10
|
@login = casein_user.login
|
16
11
|
@pass = pass
|
17
12
|
@from_text = casein_config_website_name
|
18
13
|
|
19
|
-
mail(:to => casein_user.email, :subject => "[#{casein_config_website_name}] New password")
|
14
|
+
mail(:to => casein_user.email, :from => from, :subject => "[#{casein_config_website_name}] New password")
|
20
15
|
end
|
21
16
|
|
22
|
-
def new_user_information casein_user, host, pass
|
17
|
+
def new_user_information from, casein_user, host, pass
|
23
18
|
@name = casein_user.name
|
24
19
|
@host = host
|
25
20
|
@login = casein_user.login
|
26
21
|
@pass = pass
|
27
22
|
@from_text = casein_config_website_name
|
28
23
|
|
29
|
-
mail(:to => casein_user.email, :subject => "[#{casein_config_website_name}] New user account")
|
24
|
+
mail(:to => casein_user.email, :from => from, :subject => "[#{casein_config_website_name}] New user account")
|
30
25
|
end
|
31
26
|
|
32
|
-
def password_reset_instructions casein_user, host
|
27
|
+
def password_reset_instructions from, casein_user, host
|
33
28
|
ActionMailer::Base.default_url_options[:host] = host.gsub("http://", "")
|
34
29
|
@name = casein_user.name
|
35
30
|
@host = host
|
@@ -37,7 +32,7 @@ module Casein
|
|
37
32
|
@reset_password_url = edit_casein_password_reset_url + "/?token=#{casein_user.perishable_token}"
|
38
33
|
@from_text = casein_config_website_name
|
39
34
|
|
40
|
-
mail(:to => casein_user.email, :subject => "[#{casein_config_website_name}] Password reset instructions")
|
35
|
+
mail(:to => casein_user.email, :from => from, :subject => "[#{casein_config_website_name}] Password reset instructions")
|
41
36
|
end
|
42
37
|
|
43
38
|
end
|
data/app/models/casein/user.rb
CHANGED
@@ -28,19 +28,19 @@ module Casein
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def send_create_notification
|
31
|
-
Casein::CaseinNotification.new_user_information(self, casein_config_hostname, @password).deliver
|
31
|
+
Casein::CaseinNotification.new_user_information(casein_config_email_from_address, self, casein_config_hostname, @password).deliver
|
32
32
|
end
|
33
33
|
|
34
34
|
def send_update_notification
|
35
35
|
if notify_of_new_password
|
36
36
|
notify_of_new_password = false
|
37
|
-
Casein::CaseinNotification.generate_new_password(self, casein_config_hostname, @password).deliver
|
37
|
+
Casein::CaseinNotification.generate_new_password(casein_config_email_from_address, self, casein_config_hostname, @password).deliver
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
41
|
def send_password_reset_instructions
|
42
42
|
reset_perishable_token!
|
43
|
-
Casein::CaseinNotification.password_reset_instructions(self, casein_config_hostname).deliver
|
43
|
+
Casein::CaseinNotification.password_reset_instructions(casein_config_email_from_address, self, casein_config_hostname).deliver
|
44
44
|
end
|
45
45
|
|
46
46
|
def check_time_zone
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: casein
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 3.1.
|
9
|
+
- 1
|
10
|
+
version: 3.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Russell Quinn
|
@@ -62,6 +62,7 @@ extra_rdoc_files:
|
|
62
62
|
files:
|
63
63
|
- Gemfile
|
64
64
|
- MIT-LICENSE
|
65
|
+
- PUBLIC_VERSION.yml
|
65
66
|
- README.rdoc
|
66
67
|
- Rakefile
|
67
68
|
- app/controllers/casein/casein_controller.rb
|