easy_roles 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +3 -1
- data/README.rdoc +10 -1
- data/Rakefile +1 -1
- data/easy_roles.gemspec +3 -3
- data/generators/easy_roles/USAGE +11 -0
- data/generators/easy_roles/easy_roles_generator.rb +8 -0
- data/generators/easy_roles/templates/migration.rb +9 -0
- metadata +6 -3
data/Manifest
CHANGED
data/README.rdoc
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
Simple rails gem for basic role authorization with ruby on rails.
|
4
4
|
|
5
|
+
== Changelog
|
6
|
+
|
7
|
+
=== 21 October 2009 - Version 0.2.0
|
8
|
+
Added bang methods for 'add_role' and 'remove_role' which can be accessed through 'add_role!' and 'remove_role!' respectively.
|
9
|
+
|
5
10
|
== Install
|
6
11
|
|
7
12
|
gem install gemcutter
|
@@ -17,8 +22,12 @@ or it can be installed as a rails plugin.
|
|
17
22
|
Add the following to your enviroment.rb in the rails initializer block
|
18
23
|
|
19
24
|
config.gem 'easy_roles', :source => 'http://gemcutter.org'
|
25
|
+
|
26
|
+
(from version 0.3.0) use the migration generator
|
27
|
+
|
28
|
+
script/generate easy_roles user roles
|
20
29
|
|
21
|
-
|
30
|
+
Or add a "roles" column to your users model, and set the default value to "--- []". Please note you can call this column anything you like, I like to use the name "roles".
|
22
31
|
|
23
32
|
t.string :roles, :default => "--- []"
|
24
33
|
|
data/Rakefile
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('easy_roles', '0.
|
5
|
+
Echoe.new('easy_roles', '0.3.0') do |p|
|
6
6
|
p.description = "Easy role authorization in rails"
|
7
7
|
p.url = "http://github.com/platform45/easy_roles"
|
8
8
|
p.author = "Platform45"
|
data/easy_roles.gemspec
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{easy_roles}
|
5
|
-
s.version = "0.
|
5
|
+
s.version = "0.3.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Platform45"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-11-18}
|
10
10
|
s.description = %q{Easy role authorization in rails}
|
11
11
|
s.email = %q{ryan@platform45.com}
|
12
12
|
s.extra_rdoc_files = ["README.rdoc", "lib/easy_roles.rb"]
|
13
|
-
s.files = ["Manifest", "README.rdoc", "Rakefile", "easy_roles.
|
13
|
+
s.files = ["Manifest", "README.rdoc", "Rakefile", "generators/easy_roles/USAGE", "generators/easy_roles/easy_roles_generator.rb", "generators/easy_roles/templates/migration.rb", "init.rb", "lib/easy_roles.rb", "easy_roles.gemspec"]
|
14
14
|
s.homepage = %q{http://github.com/platform45/easy_roles}
|
15
15
|
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Easy_roles", "--main", "README.rdoc"]
|
16
16
|
s.require_paths = ["lib"]
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class AddRolesTo<%= class_name.pluralize %> < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :<%= table_name %>, :<%= args.first %>, :string, :default => "--- []"
|
4
|
+
end
|
5
|
+
|
6
|
+
def self.down
|
7
|
+
remove_column :<%= table_name.to_sym %>, :<%= args.first.to_sym %>
|
8
|
+
end
|
9
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_roles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Platform45
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-11-18 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -26,9 +26,12 @@ files:
|
|
26
26
|
- Manifest
|
27
27
|
- README.rdoc
|
28
28
|
- Rakefile
|
29
|
-
- easy_roles
|
29
|
+
- generators/easy_roles/USAGE
|
30
|
+
- generators/easy_roles/easy_roles_generator.rb
|
31
|
+
- generators/easy_roles/templates/migration.rb
|
30
32
|
- init.rb
|
31
33
|
- lib/easy_roles.rb
|
34
|
+
- easy_roles.gemspec
|
32
35
|
has_rdoc: true
|
33
36
|
homepage: http://github.com/platform45/easy_roles
|
34
37
|
licenses: []
|