roles_active_record 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,19 +1,18 @@
1
1
  source :rubygems
2
2
 
3
- gem "active_record", ">= 3.0.0"
4
- gem "active_support", ">= 3.0.0"
5
- gem "meta_where", ">= 0.9"
6
- gem "arel", "~> 1.0"
7
- gem "meta_where", ">= 0.9"
3
+ gem "activerecord", ">= 3.0.1"
4
+ gem "activesupport", ">= 3.0.1"
5
+ gem "arel", ">= 2.0"
6
+ gem "meta_where", ">= 0.9.9"
8
7
  gem "sugar-high", "~> 0.3.0"
9
8
  gem "require_all", '~> 1.2.0'
10
- gem "roles_generic", '~> 0.2.5'
9
+ gem "roles_generic", '~> 0.3.2'
11
10
 
12
- gem 'rails3_artifactor', '~> 0.3.0'
13
- gem 'logging_assist', '~> 0.1.5'
11
+ gem 'rails3_artifactor', '>= 0.3.1'
12
+ gem 'logging_assist', '>= 0.1.6'
14
13
 
15
14
  group :test do
16
- gem "rspec", ">= 2.0.0"
15
+ gem "rspec", ">= 2.0.1"
17
16
  gem "yaml"
18
17
  gem "logger"
19
18
  gem 'database_cleaner'
data/Rakefile CHANGED
@@ -5,22 +5,22 @@ begin
5
5
  gem.summary = %Q{Implementation of Roles generic API for Active Record}
6
6
  gem.description = %Q{Makes it easy to set a role strategy on your User model in Active Record}
7
7
  gem.email = "kmandrup@gmail.com"
8
- gem.homepage = "http://github.com/kristianmandrup/roles_for_dm"
8
+ gem.homepage = "http://github.com/kristianmandrup/roles_active_record"
9
9
  gem.authors = ["Kristian Mandrup"]
10
- gem.add_development_dependency "rspec", '>= 2.0'
10
+ gem.add_development_dependency "rspec", '>= 2.0.1'
11
11
  gem.add_development_dependency 'database_cleaner', '>= 0.5'
12
12
  gem.add_development_dependency "generator-spec", '>= 0.7.0'
13
13
 
14
- gem.add_dependency "activerecord", "~> 3.0"
15
- gem.add_dependency "activesupport", "~> 3.0"
16
- gem.add_dependency "arel", "~> 1.0"
17
- gem.add_dependency "meta_where", ">= 0.9"
14
+ gem.add_dependency "activerecord", "~> 3.0.1"
15
+ gem.add_dependency "activesupport", "~> 3.0.1"
16
+ gem.add_dependency "arel", ">= 2.0"
17
+ gem.add_dependency "meta_where", ">= 0.9.9"
18
18
  gem.add_dependency "sugar-high", "~> 0.3.0"
19
19
  gem.add_dependency "require_all", '~> 1.2.0'
20
- gem.add_dependency "roles_generic", '>= 0.3.0'
20
+ gem.add_dependency "roles_generic", '>= 0.3.2'
21
21
 
22
- gem.add_dependency 'rails3_artifactor', '~> 0.3.1'
23
- gem.add_dependency 'logging_assist', '~> 0.1.6'
22
+ gem.add_dependency 'rails3_artifactor', '>= 0.3.1'
23
+ gem.add_dependency 'logging_assist', '>= 0.1.6'
24
24
  # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
25
25
  end
26
26
  Jeweler::GemcutterTasks.new
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 0.3.2
@@ -5,19 +5,20 @@ module ActiveRecord
5
5
  module Generators
6
6
  class RolesGenerator < Rails::Generators::NamedBase
7
7
  desc "Add role strategy to a model"
8
+
9
+ # argument name
8
10
 
9
11
  class_option :strategy, :type => :string, :aliases => "-s", :default => 'role_string',
10
12
  :desc => "Role strategy to use (admin_flag, role_string, roles_string, role_strings, one_role, many_roles, roles_mask)"
11
13
 
12
14
 
13
15
  class_option :roles, :type => :array, :aliases => "-r", :default => [], :desc => "Valid roles"
14
-
15
16
  class_option :default_roles, :type => :boolean, :default => true, :desc => "Use default roles :admin and :base"
16
-
17
+ class_option :logfile, :type => :string, :default => nil, :desc => "Logfile location"
17
18
 
18
19
  def apply_role_strategy
19
- # logger.add_logfile
20
- # logger.debug "apply_role_strategy for : #{strategy} in model #{name}"
20
+ logger.add_logfile :logfile => logfile if logfile
21
+ logger.debug "apply_role_strategy for : #{strategy} in model #{name}"
21
22
  begin
22
23
  insert_into_model name do
23
24
  insertion_text
@@ -33,6 +34,14 @@ module ActiveRecord
33
34
  use_orm :active_record
34
35
  include Rails3::Assist::BasicLogger
35
36
 
37
+ def logfile
38
+ options[:logfile]
39
+ end
40
+
41
+ def user_model_name
42
+ name || 'User'
43
+ end
44
+
36
45
  def orm
37
46
  :active_record
38
47
  end
@@ -48,6 +57,15 @@ module ActiveRecord
48
57
  def roles
49
58
  roles_to_add.map{|r| ":#{r}" }
50
59
  end
60
+
61
+ def roles_statement
62
+ return '' if has_valid_roles_statement?
63
+ roles ? "valid_roles_are #{roles.join(', ')}" : ''
64
+ end
65
+
66
+ def has_valid_roles_statement?
67
+ !(read_model(user_model_name) =~ /valid_roles_are/).nil?
68
+ end
51
69
 
52
70
  def role_strategy_statement
53
71
  "strategy :#{strategy}, :default\n#{role_class_stmt}"
@@ -56,11 +74,7 @@ module ActiveRecord
56
74
  def role_class_stmt
57
75
  " role_class :role" if [:one_role, :many_roles].include? (strategy.to_sym)
58
76
  end
59
-
60
- def roles_statement
61
- roles ? "valid_roles_are #{roles.join(', ')}" : ''
62
- end
63
-
77
+
64
78
  def insertion_text
65
79
  %Q{include Roles::#{orm.to_s.camelize}
66
80
  #{role_strategy_statement}
@@ -13,12 +13,21 @@ module ActiveRecord
13
13
  class_option :strategy, :type => :string, :aliases => "-s", :default => 'inline_role',
14
14
  :desc => "Role strategy to use (admin_flag, role_string, one_role, many_roles, roles_mask)"
15
15
 
16
+ class_option :logfile, :type => :string, :default => nil, :desc => "Logfile location"
16
17
  class_option :reverse, :type => :boolean, :alias => "-r", :default => false, :desc => "Create a remove migration for reversing a strategy"
17
18
 
18
19
  def self.source_root
19
20
  @source_root ||= File.expand_path("../templates", __FILE__)
20
21
  end
21
22
 
23
+ def main
24
+ logger.add_logfile :logfile => logfile if logfile
25
+ valid_strategy?
26
+ run_migration
27
+ end
28
+
29
+ protected
30
+
22
31
  def valid_strategy?
23
32
  if !strategies.include?(strategy.to_sym)
24
33
  logger.info "Unknown role strategy #{strategy}"
@@ -26,15 +35,14 @@ module ActiveRecord
26
35
  end
27
36
  end
28
37
 
29
- def run_migration
38
+ def run_migration
39
+ logger.debug "Create migration for role_strategy: #{strategy}"
30
40
  migration_name = "add_#{strategy}_strategy"
31
41
  target_migration_name = reverse? ? reverse_migration_name(migration_name) : migration_name
32
42
  migration_template "#{migration_name}.erb", "db/migrations/#{target_migration_name}"
33
43
  generated_migration = latest_migration_file(migration_dir, target_migration_name)
34
44
  reverse_migration!(generated_migration) if generated_migration && reverse?
35
45
  end
36
-
37
- protected
38
46
 
39
47
  include Rails3::Assist::BasicLogger
40
48
 
@@ -39,19 +39,14 @@ module RoleStrategy::ActiveRecord
39
39
 
40
40
  # assign multiple roles
41
41
  def roles=(*role_names)
42
- puts "Assign roles #{role_names}"
43
42
  role_names = role_names.flat_uniq
44
43
  role_names = extract_roles(role_names)
45
44
  return nil if role_names.empty?
46
- puts "role names #{role_names}"
47
45
  valids = role_class.find_roles(role_names).to_a
48
- puts "valids: #{valids}"
49
46
  vrs = select_valid_roles role_names
50
- puts "Set valid roles #{vrs}"
51
47
  set_roles(vrs)
52
48
  end
53
49
 
54
-
55
50
  def new_roles *role_names
56
51
  role_class.find_roles(extract_roles role_names)
57
52
  end
@@ -45,7 +45,6 @@ module RoleStrategy::ActiveRecord
45
45
  def set_empty_role
46
46
  self.send("#{role_attribute}=", false)
47
47
  end
48
-
49
48
  end # Implementation
50
49
 
51
50
  extend Roles::Generic::User::Configuration
@@ -1,138 +1,136 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{roles_active_record}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
12
- s.date = %q{2010-11-20}
12
+ s.date = %q{2010-12-01}
13
13
  s.description = %q{Makes it easy to set a role strategy on your User model in Active Record}
14
14
  s.email = %q{kmandrup@gmail.com}
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
- "README.markdown"
17
+ "README.markdown"
18
18
  ]
19
19
  s.files = [
20
20
  ".document",
21
- ".gitignore",
22
- ".rspec",
23
- "Gemfile",
24
- "LICENSE",
25
- "README.markdown",
26
- "Rakefile",
27
- "VERSION",
28
- "development.sqlite3",
29
- "lib/generators/active_record/roles/roles_generator.rb",
30
- "lib/generators/active_record/roles_migration/roles_migration_generator.rb",
31
- "lib/generators/active_record/roles_migration/templates/add_admin_flag_strategy.erb",
32
- "lib/generators/active_record/roles_migration/templates/add_many_roles_strategy.erb",
33
- "lib/generators/active_record/roles_migration/templates/add_one_role_strategy.erb",
34
- "lib/generators/active_record/roles_migration/templates/add_role_string_strategy.erb",
35
- "lib/generators/active_record/roles_migration/templates/add_roles_mask_strategy.erb",
36
- "lib/roles_active_record.rb",
37
- "lib/roles_active_record/base.rb",
38
- "lib/roles_active_record/namespaces.rb",
39
- "lib/roles_active_record/role.rb",
40
- "lib/roles_active_record/strategy.rb",
41
- "lib/roles_active_record/strategy/multi.rb",
42
- "lib/roles_active_record/strategy/multi/many_roles.rb",
43
- "lib/roles_active_record/strategy/multi/roles_mask.rb",
44
- "lib/roles_active_record/strategy/shared.rb",
45
- "lib/roles_active_record/strategy/single.rb",
46
- "lib/roles_active_record/strategy/single/admin_flag.rb",
47
- "lib/roles_active_record/strategy/single/one_role.rb",
48
- "lib/roles_active_record/strategy/single/role_string.rb",
49
- "lib/views/_multi_role_selector.erb.html",
50
- "lib/views/_single_role_selector.erb.html",
51
- "logging.log",
52
- "roles_active_record.gemspec",
53
- "sandbox/Rakefile",
54
- "sandbox/add_role_to_users_migration.erb",
55
- "sandbox/create_roles_migration.erb",
56
- "sandbox/create_user_roles_migration.erb",
57
- "sandbox/database.log",
58
- "sandbox/database.yml",
59
- "sandbox/development.sqlite3",
60
- "sandbox/migrate/201002508_create_roles.rb",
61
- "sandbox/migrate/20102507_create_users.rb",
62
- "sandbox/model_base.rb",
63
- "sandbox/test.rb",
64
- "spec/db/database.yml",
65
- "spec/fixtures/many_roles_setup.rb",
66
- "spec/fixtures/one_role_setup.rb",
67
- "spec/generator_spec_helper.rb",
68
- "spec/migration_spec_helper.rb",
69
- "spec/migrations/admin_flag/004_add_admin_flag_to_users.rb",
70
- "spec/migrations/many_roles/002_create_roles.rb",
71
- "spec/migrations/many_roles/003_create_user_roles.rb",
72
- "spec/migrations/one_role/002_create_roles.rb",
73
- "spec/migrations/one_role/003_add_role_to_users.rb",
74
- "spec/migrations/role_string/002_add_role_string_to_users.rb",
75
- "spec/migrations/roles_mask/005_add_roles_mask_to_users.rb",
76
- "spec/migrations/users/001_create_users.rb",
77
- "spec/roles_active_record/generators/roles_generator_spec.rb",
78
- "spec/roles_active_record/generators/roles_migration/admin_flag_spec.rb",
79
- "spec/roles_active_record/generators/roles_migration/many_roles_spec.rb",
80
- "spec/roles_active_record/generators/roles_migration/one_role_spec.rb",
81
- "spec/roles_active_record/generators/roles_migration/role_string_spec.rb",
82
- "spec/roles_active_record/generators/roles_migration/roles_mask_spec.rb",
83
- "spec/roles_active_record/generators/setup_generator_spec.rb",
84
- "spec/roles_active_record/strategy/api.rb",
85
- "spec/roles_active_record/strategy/api_examples.rb",
86
- "spec/roles_active_record/strategy/multi/many_roles_spec.rb",
87
- "spec/roles_active_record/strategy/multi/roles_mask_spec.rb",
88
- "spec/roles_active_record/strategy/single/admin_flag_spec.rb",
89
- "spec/roles_active_record/strategy/single/one_role_spec.rb",
90
- "spec/roles_active_record/strategy/single/role_string_spec.rb",
91
- "spec/roles_active_record/strategy/user_setup.rb",
92
- "spec/spec_helper.rb",
93
- "tmp/rails/app/models/user.rb",
94
- "tmp/rails/config/routes.rb",
95
- "tmp/rails/db/migrations/20100912101428_add_admin_flag_strategy.rb",
96
- "tmp/rails/db/migrations/20100912101429_remove_admin_flag_strategy.rb",
97
- "tmp/rails/db/migrations/20100912105055_add_many_roles_strategy.rb",
98
- "tmp/rails/db/migrations/20100912105323_add_one_role_strategy.rb",
99
- "tmp/rails/db/migrations/20100912110044_add_role_string_strategy.rb",
100
- "tmp/rails/db/migrations/20100912110249_add_roles_mask_strategy.rb"
21
+ ".rspec",
22
+ "Gemfile",
23
+ "LICENSE",
24
+ "README.markdown",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "development.sqlite3",
28
+ "lib/generators/active_record/roles/roles_generator.rb",
29
+ "lib/generators/active_record/roles_migration/roles_migration_generator.rb",
30
+ "lib/generators/active_record/roles_migration/templates/add_admin_flag_strategy.erb",
31
+ "lib/generators/active_record/roles_migration/templates/add_many_roles_strategy.erb",
32
+ "lib/generators/active_record/roles_migration/templates/add_one_role_strategy.erb",
33
+ "lib/generators/active_record/roles_migration/templates/add_role_string_strategy.erb",
34
+ "lib/generators/active_record/roles_migration/templates/add_roles_mask_strategy.erb",
35
+ "lib/roles_active_record.rb",
36
+ "lib/roles_active_record/base.rb",
37
+ "lib/roles_active_record/namespaces.rb",
38
+ "lib/roles_active_record/role.rb",
39
+ "lib/roles_active_record/strategy.rb",
40
+ "lib/roles_active_record/strategy/multi.rb",
41
+ "lib/roles_active_record/strategy/multi/many_roles.rb",
42
+ "lib/roles_active_record/strategy/multi/roles_mask.rb",
43
+ "lib/roles_active_record/strategy/shared.rb",
44
+ "lib/roles_active_record/strategy/single.rb",
45
+ "lib/roles_active_record/strategy/single/admin_flag.rb",
46
+ "lib/roles_active_record/strategy/single/one_role.rb",
47
+ "lib/roles_active_record/strategy/single/role_string.rb",
48
+ "lib/views/_multi_role_selector.erb.html",
49
+ "lib/views/_single_role_selector.erb.html",
50
+ "logging.log",
51
+ "roles_active_record.gemspec",
52
+ "sandbox/Rakefile",
53
+ "sandbox/add_role_to_users_migration.erb",
54
+ "sandbox/create_roles_migration.erb",
55
+ "sandbox/create_user_roles_migration.erb",
56
+ "sandbox/database.log",
57
+ "sandbox/database.yml",
58
+ "sandbox/development.sqlite3",
59
+ "sandbox/migrate/201002508_create_roles.rb",
60
+ "sandbox/migrate/20102507_create_users.rb",
61
+ "sandbox/model_base.rb",
62
+ "sandbox/test.rb",
63
+ "spec/db/database.yml",
64
+ "spec/fixtures/many_roles_setup.rb",
65
+ "spec/fixtures/one_role_setup.rb",
66
+ "spec/generator_spec_helper.rb",
67
+ "spec/migration_spec_helper.rb",
68
+ "spec/migrations/admin_flag/004_add_admin_flag_to_users.rb",
69
+ "spec/migrations/many_roles/002_create_roles.rb",
70
+ "spec/migrations/many_roles/003_create_user_roles.rb",
71
+ "spec/migrations/one_role/002_create_roles.rb",
72
+ "spec/migrations/one_role/003_add_role_to_users.rb",
73
+ "spec/migrations/role_string/002_add_role_string_to_users.rb",
74
+ "spec/migrations/roles_mask/005_add_roles_mask_to_users.rb",
75
+ "spec/migrations/users/001_create_users.rb",
76
+ "spec/roles_active_record/generators/roles_generator_spec.rb",
77
+ "spec/roles_active_record/generators/roles_migration/admin_flag_spec.rb",
78
+ "spec/roles_active_record/generators/roles_migration/many_roles_spec.rb",
79
+ "spec/roles_active_record/generators/roles_migration/one_role_spec.rb",
80
+ "spec/roles_active_record/generators/roles_migration/role_string_spec.rb",
81
+ "spec/roles_active_record/generators/roles_migration/roles_mask_spec.rb",
82
+ "spec/roles_active_record/generators/setup_generator_spec.rb",
83
+ "spec/roles_active_record/strategy/api.rb",
84
+ "spec/roles_active_record/strategy/api_examples.rb",
85
+ "spec/roles_active_record/strategy/multi/many_roles_spec.rb",
86
+ "spec/roles_active_record/strategy/multi/roles_mask_spec.rb",
87
+ "spec/roles_active_record/strategy/single/admin_flag_spec.rb",
88
+ "spec/roles_active_record/strategy/single/one_role_spec.rb",
89
+ "spec/roles_active_record/strategy/single/role_string_spec.rb",
90
+ "spec/roles_active_record/strategy/user_setup.rb",
91
+ "spec/spec_helper.rb",
92
+ "tmp/rails/app/models/user.rb",
93
+ "tmp/rails/config/routes.rb",
94
+ "tmp/rails/db/migrations/20100912101428_add_admin_flag_strategy.rb",
95
+ "tmp/rails/db/migrations/20100912101429_remove_admin_flag_strategy.rb",
96
+ "tmp/rails/db/migrations/20100912105055_add_many_roles_strategy.rb",
97
+ "tmp/rails/db/migrations/20100912105323_add_one_role_strategy.rb",
98
+ "tmp/rails/db/migrations/20100912110044_add_role_string_strategy.rb",
99
+ "tmp/rails/db/migrations/20100912110249_add_roles_mask_strategy.rb"
101
100
  ]
102
- s.homepage = %q{http://github.com/kristianmandrup/roles_for_dm}
103
- s.rdoc_options = ["--charset=UTF-8"]
101
+ s.homepage = %q{http://github.com/kristianmandrup/roles_active_record}
104
102
  s.require_paths = ["lib"]
105
103
  s.rubygems_version = %q{1.3.7}
106
104
  s.summary = %q{Implementation of Roles generic API for Active Record}
107
105
  s.test_files = [
108
106
  "spec/fixtures/many_roles_setup.rb",
109
- "spec/fixtures/one_role_setup.rb",
110
- "spec/generator_spec_helper.rb",
111
- "spec/migration_spec_helper.rb",
112
- "spec/migrations/admin_flag/004_add_admin_flag_to_users.rb",
113
- "spec/migrations/many_roles/002_create_roles.rb",
114
- "spec/migrations/many_roles/003_create_user_roles.rb",
115
- "spec/migrations/one_role/002_create_roles.rb",
116
- "spec/migrations/one_role/003_add_role_to_users.rb",
117
- "spec/migrations/role_string/002_add_role_string_to_users.rb",
118
- "spec/migrations/roles_mask/005_add_roles_mask_to_users.rb",
119
- "spec/migrations/users/001_create_users.rb",
120
- "spec/roles_active_record/generators/roles_generator_spec.rb",
121
- "spec/roles_active_record/generators/roles_migration/admin_flag_spec.rb",
122
- "spec/roles_active_record/generators/roles_migration/many_roles_spec.rb",
123
- "spec/roles_active_record/generators/roles_migration/one_role_spec.rb",
124
- "spec/roles_active_record/generators/roles_migration/role_string_spec.rb",
125
- "spec/roles_active_record/generators/roles_migration/roles_mask_spec.rb",
126
- "spec/roles_active_record/generators/setup_generator_spec.rb",
127
- "spec/roles_active_record/strategy/api.rb",
128
- "spec/roles_active_record/strategy/api_examples.rb",
129
- "spec/roles_active_record/strategy/multi/many_roles_spec.rb",
130
- "spec/roles_active_record/strategy/multi/roles_mask_spec.rb",
131
- "spec/roles_active_record/strategy/single/admin_flag_spec.rb",
132
- "spec/roles_active_record/strategy/single/one_role_spec.rb",
133
- "spec/roles_active_record/strategy/single/role_string_spec.rb",
134
- "spec/roles_active_record/strategy/user_setup.rb",
135
- "spec/spec_helper.rb"
107
+ "spec/fixtures/one_role_setup.rb",
108
+ "spec/generator_spec_helper.rb",
109
+ "spec/migration_spec_helper.rb",
110
+ "spec/migrations/admin_flag/004_add_admin_flag_to_users.rb",
111
+ "spec/migrations/many_roles/002_create_roles.rb",
112
+ "spec/migrations/many_roles/003_create_user_roles.rb",
113
+ "spec/migrations/one_role/002_create_roles.rb",
114
+ "spec/migrations/one_role/003_add_role_to_users.rb",
115
+ "spec/migrations/role_string/002_add_role_string_to_users.rb",
116
+ "spec/migrations/roles_mask/005_add_roles_mask_to_users.rb",
117
+ "spec/migrations/users/001_create_users.rb",
118
+ "spec/roles_active_record/generators/roles_generator_spec.rb",
119
+ "spec/roles_active_record/generators/roles_migration/admin_flag_spec.rb",
120
+ "spec/roles_active_record/generators/roles_migration/many_roles_spec.rb",
121
+ "spec/roles_active_record/generators/roles_migration/one_role_spec.rb",
122
+ "spec/roles_active_record/generators/roles_migration/role_string_spec.rb",
123
+ "spec/roles_active_record/generators/roles_migration/roles_mask_spec.rb",
124
+ "spec/roles_active_record/generators/setup_generator_spec.rb",
125
+ "spec/roles_active_record/strategy/api.rb",
126
+ "spec/roles_active_record/strategy/api_examples.rb",
127
+ "spec/roles_active_record/strategy/multi/many_roles_spec.rb",
128
+ "spec/roles_active_record/strategy/multi/roles_mask_spec.rb",
129
+ "spec/roles_active_record/strategy/single/admin_flag_spec.rb",
130
+ "spec/roles_active_record/strategy/single/one_role_spec.rb",
131
+ "spec/roles_active_record/strategy/single/role_string_spec.rb",
132
+ "spec/roles_active_record/strategy/user_setup.rb",
133
+ "spec/spec_helper.rb"
136
134
  ]
137
135
 
138
136
  if s.respond_to? :specification_version then
@@ -140,45 +138,72 @@ Gem::Specification.new do |s|
140
138
  s.specification_version = 3
141
139
 
142
140
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
143
- s.add_development_dependency(%q<rspec>, [">= 2.0"])
141
+ s.add_runtime_dependency(%q<activerecord>, [">= 3.0.1"])
142
+ s.add_runtime_dependency(%q<activesupport>, [">= 3.0.1"])
143
+ s.add_runtime_dependency(%q<arel>, [">= 2.0"])
144
+ s.add_runtime_dependency(%q<meta_where>, [">= 0.9.9"])
145
+ s.add_runtime_dependency(%q<sugar-high>, ["~> 0.3.0"])
146
+ s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
147
+ s.add_runtime_dependency(%q<roles_generic>, ["~> 0.3.2"])
148
+ s.add_runtime_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
149
+ s.add_runtime_dependency(%q<logging_assist>, [">= 0.1.6"])
150
+ s.add_development_dependency(%q<rspec>, [">= 2.0.1"])
144
151
  s.add_development_dependency(%q<database_cleaner>, [">= 0.5"])
145
152
  s.add_development_dependency(%q<generator-spec>, [">= 0.7.0"])
146
- s.add_runtime_dependency(%q<activerecord>, ["~> 3.0"])
147
- s.add_runtime_dependency(%q<activesupport>, ["~> 3.0"])
148
- s.add_runtime_dependency(%q<arel>, ["~> 1.0"])
149
- s.add_runtime_dependency(%q<meta_where>, [">= 0.9"])
153
+ s.add_runtime_dependency(%q<activerecord>, ["~> 3.0.1"])
154
+ s.add_runtime_dependency(%q<activesupport>, ["~> 3.0.1"])
155
+ s.add_runtime_dependency(%q<arel>, [">= 2.0"])
156
+ s.add_runtime_dependency(%q<meta_where>, [">= 0.9.9"])
150
157
  s.add_runtime_dependency(%q<sugar-high>, ["~> 0.3.0"])
151
158
  s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
152
- s.add_runtime_dependency(%q<roles_generic>, [">= 0.3.0"])
153
- s.add_runtime_dependency(%q<rails3_artifactor>, ["~> 0.3.1"])
154
- s.add_runtime_dependency(%q<logging_assist>, ["~> 0.1.6"])
159
+ s.add_runtime_dependency(%q<roles_generic>, [">= 0.3.2"])
160
+ s.add_runtime_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
161
+ s.add_runtime_dependency(%q<logging_assist>, [">= 0.1.6"])
155
162
  else
156
- s.add_dependency(%q<rspec>, [">= 2.0"])
163
+ s.add_dependency(%q<activerecord>, [">= 3.0.1"])
164
+ s.add_dependency(%q<activesupport>, [">= 3.0.1"])
165
+ s.add_dependency(%q<arel>, [">= 2.0"])
166
+ s.add_dependency(%q<meta_where>, [">= 0.9.9"])
167
+ s.add_dependency(%q<sugar-high>, ["~> 0.3.0"])
168
+ s.add_dependency(%q<require_all>, ["~> 1.2.0"])
169
+ s.add_dependency(%q<roles_generic>, ["~> 0.3.2"])
170
+ s.add_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
171
+ s.add_dependency(%q<logging_assist>, [">= 0.1.6"])
172
+ s.add_dependency(%q<rspec>, [">= 2.0.1"])
157
173
  s.add_dependency(%q<database_cleaner>, [">= 0.5"])
158
174
  s.add_dependency(%q<generator-spec>, [">= 0.7.0"])
159
- s.add_dependency(%q<activerecord>, ["~> 3.0"])
160
- s.add_dependency(%q<activesupport>, ["~> 3.0"])
161
- s.add_dependency(%q<arel>, ["~> 1.0"])
162
- s.add_dependency(%q<meta_where>, [">= 0.9"])
175
+ s.add_dependency(%q<activerecord>, ["~> 3.0.1"])
176
+ s.add_dependency(%q<activesupport>, ["~> 3.0.1"])
177
+ s.add_dependency(%q<arel>, [">= 2.0"])
178
+ s.add_dependency(%q<meta_where>, [">= 0.9.9"])
163
179
  s.add_dependency(%q<sugar-high>, ["~> 0.3.0"])
164
180
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
165
- s.add_dependency(%q<roles_generic>, [">= 0.3.0"])
166
- s.add_dependency(%q<rails3_artifactor>, ["~> 0.3.1"])
167
- s.add_dependency(%q<logging_assist>, ["~> 0.1.6"])
181
+ s.add_dependency(%q<roles_generic>, [">= 0.3.2"])
182
+ s.add_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
183
+ s.add_dependency(%q<logging_assist>, [">= 0.1.6"])
168
184
  end
169
185
  else
170
- s.add_dependency(%q<rspec>, [">= 2.0"])
186
+ s.add_dependency(%q<activerecord>, [">= 3.0.1"])
187
+ s.add_dependency(%q<activesupport>, [">= 3.0.1"])
188
+ s.add_dependency(%q<arel>, [">= 2.0"])
189
+ s.add_dependency(%q<meta_where>, [">= 0.9.9"])
190
+ s.add_dependency(%q<sugar-high>, ["~> 0.3.0"])
191
+ s.add_dependency(%q<require_all>, ["~> 1.2.0"])
192
+ s.add_dependency(%q<roles_generic>, ["~> 0.3.2"])
193
+ s.add_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
194
+ s.add_dependency(%q<logging_assist>, [">= 0.1.6"])
195
+ s.add_dependency(%q<rspec>, [">= 2.0.1"])
171
196
  s.add_dependency(%q<database_cleaner>, [">= 0.5"])
172
197
  s.add_dependency(%q<generator-spec>, [">= 0.7.0"])
173
- s.add_dependency(%q<activerecord>, ["~> 3.0"])
174
- s.add_dependency(%q<activesupport>, ["~> 3.0"])
175
- s.add_dependency(%q<arel>, ["~> 1.0"])
176
- s.add_dependency(%q<meta_where>, [">= 0.9"])
198
+ s.add_dependency(%q<activerecord>, ["~> 3.0.1"])
199
+ s.add_dependency(%q<activesupport>, ["~> 3.0.1"])
200
+ s.add_dependency(%q<arel>, [">= 2.0"])
201
+ s.add_dependency(%q<meta_where>, [">= 0.9.9"])
177
202
  s.add_dependency(%q<sugar-high>, ["~> 0.3.0"])
178
203
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
179
- s.add_dependency(%q<roles_generic>, [">= 0.3.0"])
180
- s.add_dependency(%q<rails3_artifactor>, ["~> 0.3.1"])
181
- s.add_dependency(%q<logging_assist>, ["~> 0.1.6"])
204
+ s.add_dependency(%q<roles_generic>, [">= 0.3.2"])
205
+ s.add_dependency(%q<rails3_artifactor>, [">= 0.3.1"])
206
+ s.add_dependency(%q<logging_assist>, [">= 0.1.6"])
182
207
  end
183
208
  end
184
209
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 1
9
- version: 0.3.1
8
+ - 2
9
+ version: 0.3.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup
@@ -14,13 +14,42 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-20 00:00:00 +01:00
17
+ date: 2010-12-01 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
- name: rspec
22
- prerelease: false
21
+ name: activerecord
23
22
  requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 3
29
+ - 0
30
+ - 1
31
+ version: 3.0.1
32
+ type: :runtime
33
+ prerelease: false
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: activesupport
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 3
44
+ - 0
45
+ - 1
46
+ version: 3.0.1
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: arel
52
+ requirement: &id003 !ruby/object:Gem::Requirement
24
53
  none: false
25
54
  requirements:
26
55
  - - ">="
@@ -29,12 +58,117 @@ dependencies:
29
58
  - 2
30
59
  - 0
31
60
  version: "2.0"
61
+ type: :runtime
62
+ prerelease: false
63
+ version_requirements: *id003
64
+ - !ruby/object:Gem::Dependency
65
+ name: meta_where
66
+ requirement: &id004 !ruby/object:Gem::Requirement
67
+ none: false
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ segments:
72
+ - 0
73
+ - 9
74
+ - 9
75
+ version: 0.9.9
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: *id004
79
+ - !ruby/object:Gem::Dependency
80
+ name: sugar-high
81
+ requirement: &id005 !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ~>
85
+ - !ruby/object:Gem::Version
86
+ segments:
87
+ - 0
88
+ - 3
89
+ - 0
90
+ version: 0.3.0
91
+ type: :runtime
92
+ prerelease: false
93
+ version_requirements: *id005
94
+ - !ruby/object:Gem::Dependency
95
+ name: require_all
96
+ requirement: &id006 !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ segments:
102
+ - 1
103
+ - 2
104
+ - 0
105
+ version: 1.2.0
106
+ type: :runtime
107
+ prerelease: false
108
+ version_requirements: *id006
109
+ - !ruby/object:Gem::Dependency
110
+ name: roles_generic
111
+ requirement: &id007 !ruby/object:Gem::Requirement
112
+ none: false
113
+ requirements:
114
+ - - ~>
115
+ - !ruby/object:Gem::Version
116
+ segments:
117
+ - 0
118
+ - 3
119
+ - 2
120
+ version: 0.3.2
121
+ type: :runtime
122
+ prerelease: false
123
+ version_requirements: *id007
124
+ - !ruby/object:Gem::Dependency
125
+ name: rails3_artifactor
126
+ requirement: &id008 !ruby/object:Gem::Requirement
127
+ none: false
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ segments:
132
+ - 0
133
+ - 3
134
+ - 1
135
+ version: 0.3.1
136
+ type: :runtime
137
+ prerelease: false
138
+ version_requirements: *id008
139
+ - !ruby/object:Gem::Dependency
140
+ name: logging_assist
141
+ requirement: &id009 !ruby/object:Gem::Requirement
142
+ none: false
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ segments:
147
+ - 0
148
+ - 1
149
+ - 6
150
+ version: 0.1.6
151
+ type: :runtime
152
+ prerelease: false
153
+ version_requirements: *id009
154
+ - !ruby/object:Gem::Dependency
155
+ name: rspec
156
+ requirement: &id010 !ruby/object:Gem::Requirement
157
+ none: false
158
+ requirements:
159
+ - - ">="
160
+ - !ruby/object:Gem::Version
161
+ segments:
162
+ - 2
163
+ - 0
164
+ - 1
165
+ version: 2.0.1
32
166
  type: :development
33
- version_requirements: *id001
167
+ prerelease: false
168
+ version_requirements: *id010
34
169
  - !ruby/object:Gem::Dependency
35
170
  name: database_cleaner
36
- prerelease: false
37
- requirement: &id002 !ruby/object:Gem::Requirement
171
+ requirement: &id011 !ruby/object:Gem::Requirement
38
172
  none: false
39
173
  requirements:
40
174
  - - ">="
@@ -44,11 +178,11 @@ dependencies:
44
178
  - 5
45
179
  version: "0.5"
46
180
  type: :development
47
- version_requirements: *id002
181
+ prerelease: false
182
+ version_requirements: *id011
48
183
  - !ruby/object:Gem::Dependency
49
184
  name: generator-spec
50
- prerelease: false
51
- requirement: &id003 !ruby/object:Gem::Requirement
185
+ requirement: &id012 !ruby/object:Gem::Requirement
52
186
  none: false
53
187
  requirements:
54
188
  - - ">="
@@ -59,11 +193,11 @@ dependencies:
59
193
  - 0
60
194
  version: 0.7.0
61
195
  type: :development
62
- version_requirements: *id003
196
+ prerelease: false
197
+ version_requirements: *id012
63
198
  - !ruby/object:Gem::Dependency
64
199
  name: activerecord
65
- prerelease: false
66
- requirement: &id004 !ruby/object:Gem::Requirement
200
+ requirement: &id013 !ruby/object:Gem::Requirement
67
201
  none: false
68
202
  requirements:
69
203
  - - ~>
@@ -71,13 +205,14 @@ dependencies:
71
205
  segments:
72
206
  - 3
73
207
  - 0
74
- version: "3.0"
208
+ - 1
209
+ version: 3.0.1
75
210
  type: :runtime
76
- version_requirements: *id004
211
+ prerelease: false
212
+ version_requirements: *id013
77
213
  - !ruby/object:Gem::Dependency
78
214
  name: activesupport
79
- prerelease: false
80
- requirement: &id005 !ruby/object:Gem::Requirement
215
+ requirement: &id014 !ruby/object:Gem::Requirement
81
216
  none: false
82
217
  requirements:
83
218
  - - ~>
@@ -85,27 +220,28 @@ dependencies:
85
220
  segments:
86
221
  - 3
87
222
  - 0
88
- version: "3.0"
223
+ - 1
224
+ version: 3.0.1
89
225
  type: :runtime
90
- version_requirements: *id005
226
+ prerelease: false
227
+ version_requirements: *id014
91
228
  - !ruby/object:Gem::Dependency
92
229
  name: arel
93
- prerelease: false
94
- requirement: &id006 !ruby/object:Gem::Requirement
230
+ requirement: &id015 !ruby/object:Gem::Requirement
95
231
  none: false
96
232
  requirements:
97
- - - ~>
233
+ - - ">="
98
234
  - !ruby/object:Gem::Version
99
235
  segments:
100
- - 1
236
+ - 2
101
237
  - 0
102
- version: "1.0"
238
+ version: "2.0"
103
239
  type: :runtime
104
- version_requirements: *id006
240
+ prerelease: false
241
+ version_requirements: *id015
105
242
  - !ruby/object:Gem::Dependency
106
243
  name: meta_where
107
- prerelease: false
108
- requirement: &id007 !ruby/object:Gem::Requirement
244
+ requirement: &id016 !ruby/object:Gem::Requirement
109
245
  none: false
110
246
  requirements:
111
247
  - - ">="
@@ -113,13 +249,14 @@ dependencies:
113
249
  segments:
114
250
  - 0
115
251
  - 9
116
- version: "0.9"
252
+ - 9
253
+ version: 0.9.9
117
254
  type: :runtime
118
- version_requirements: *id007
255
+ prerelease: false
256
+ version_requirements: *id016
119
257
  - !ruby/object:Gem::Dependency
120
258
  name: sugar-high
121
- prerelease: false
122
- requirement: &id008 !ruby/object:Gem::Requirement
259
+ requirement: &id017 !ruby/object:Gem::Requirement
123
260
  none: false
124
261
  requirements:
125
262
  - - ~>
@@ -130,11 +267,11 @@ dependencies:
130
267
  - 0
131
268
  version: 0.3.0
132
269
  type: :runtime
133
- version_requirements: *id008
270
+ prerelease: false
271
+ version_requirements: *id017
134
272
  - !ruby/object:Gem::Dependency
135
273
  name: require_all
136
- prerelease: false
137
- requirement: &id009 !ruby/object:Gem::Requirement
274
+ requirement: &id018 !ruby/object:Gem::Requirement
138
275
  none: false
139
276
  requirements:
140
277
  - - ~>
@@ -145,11 +282,11 @@ dependencies:
145
282
  - 0
146
283
  version: 1.2.0
147
284
  type: :runtime
148
- version_requirements: *id009
285
+ prerelease: false
286
+ version_requirements: *id018
149
287
  - !ruby/object:Gem::Dependency
150
288
  name: roles_generic
151
- prerelease: false
152
- requirement: &id010 !ruby/object:Gem::Requirement
289
+ requirement: &id019 !ruby/object:Gem::Requirement
153
290
  none: false
154
291
  requirements:
155
292
  - - ">="
@@ -157,17 +294,17 @@ dependencies:
157
294
  segments:
158
295
  - 0
159
296
  - 3
160
- - 0
161
- version: 0.3.0
297
+ - 2
298
+ version: 0.3.2
162
299
  type: :runtime
163
- version_requirements: *id010
300
+ prerelease: false
301
+ version_requirements: *id019
164
302
  - !ruby/object:Gem::Dependency
165
303
  name: rails3_artifactor
166
- prerelease: false
167
- requirement: &id011 !ruby/object:Gem::Requirement
304
+ requirement: &id020 !ruby/object:Gem::Requirement
168
305
  none: false
169
306
  requirements:
170
- - - ~>
307
+ - - ">="
171
308
  - !ruby/object:Gem::Version
172
309
  segments:
173
310
  - 0
@@ -175,14 +312,14 @@ dependencies:
175
312
  - 1
176
313
  version: 0.3.1
177
314
  type: :runtime
178
- version_requirements: *id011
315
+ prerelease: false
316
+ version_requirements: *id020
179
317
  - !ruby/object:Gem::Dependency
180
318
  name: logging_assist
181
- prerelease: false
182
- requirement: &id012 !ruby/object:Gem::Requirement
319
+ requirement: &id021 !ruby/object:Gem::Requirement
183
320
  none: false
184
321
  requirements:
185
- - - ~>
322
+ - - ">="
186
323
  - !ruby/object:Gem::Version
187
324
  segments:
188
325
  - 0
@@ -190,7 +327,8 @@ dependencies:
190
327
  - 6
191
328
  version: 0.1.6
192
329
  type: :runtime
193
- version_requirements: *id012
330
+ prerelease: false
331
+ version_requirements: *id021
194
332
  description: Makes it easy to set a role strategy on your User model in Active Record
195
333
  email: kmandrup@gmail.com
196
334
  executables: []
@@ -202,7 +340,6 @@ extra_rdoc_files:
202
340
  - README.markdown
203
341
  files:
204
342
  - .document
205
- - .gitignore
206
343
  - .rspec
207
344
  - Gemfile
208
345
  - LICENSE
@@ -283,12 +420,12 @@ files:
283
420
  - tmp/rails/db/migrations/20100912110044_add_role_string_strategy.rb
284
421
  - tmp/rails/db/migrations/20100912110249_add_roles_mask_strategy.rb
285
422
  has_rdoc: true
286
- homepage: http://github.com/kristianmandrup/roles_for_dm
423
+ homepage: http://github.com/kristianmandrup/roles_active_record
287
424
  licenses: []
288
425
 
289
426
  post_install_message:
290
- rdoc_options:
291
- - --charset=UTF-8
427
+ rdoc_options: []
428
+
292
429
  require_paths:
293
430
  - lib
294
431
  required_ruby_version: !ruby/object:Gem::Requirement
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
-
21
- ## PROJECT::SPECIFIC