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 CHANGED
@@ -1,6 +1,8 @@
1
1
  Manifest
2
2
  README.rdoc
3
3
  Rakefile
4
- easy_roles.gemspec
4
+ generators/easy_roles/USAGE
5
+ generators/easy_roles/easy_roles_generator.rb
6
+ generators/easy_roles/templates/migration.rb
5
7
  init.rb
6
8
  lib/easy_roles.rb
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
- 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".
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.2.0') do |p|
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.2.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-10-21}
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.gemspec", "init.rb", "lib/easy_roles.rb"]
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,11 @@
1
+ NAME
2
+ easy_roles - generates migration for your roles authorization column
3
+
4
+ USAGE
5
+ ./script/generate easy_roles Model Column_Name
6
+
7
+ EXAMPLE
8
+ ./script/generate easy_roles user roles
9
+
10
+ MORE INFO
11
+ http://github.com/platform45/easy_roles
@@ -0,0 +1,8 @@
1
+ class EasyRolesGenerator < Rails::Generator::NamedBase
2
+ def manifest
3
+ record do |m|
4
+ m.class_collisions class_name
5
+ m.migration_template 'migration.rb', "db/migrate", :migration_file_name => "add_#{args.first}_to_#{table_name}"
6
+ end
7
+ end
8
+ end
@@ -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.2.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-10-21 00:00:00 +02:00
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.gemspec
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: []