roles_active_record 0.4.9 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,18 +1,23 @@
1
- # source :rubygems
2
- #
3
- # gem "activerecord", ">= 3.0.1"
4
- # gem "activesupport", ">= 3.0.1"
5
- # gem "arel", ">= 2.0"
6
- # gem "meta_where", ">= 1.0.1"
7
- # gem "sugar-high", "~> 0.3.5"
8
- # gem "require_all", '~> 1.2.0'
9
- # gem "roles_generic", '>= 0.3.7'
10
- #
11
- # gem 'rails_artifactor', '>= 0.3.3'
12
- # gem 'logging_assist', '>= 0.2.0'
13
- #
14
- # group :test do
15
- # gem "rspec", ">= 2.0.1"
16
- # gem 'database_cleaner'
17
- # gem "generator_spec", '>= 0.7.2'
18
- # end
1
+ source :rubygems
2
+
3
+ gem "activerecord", ">= 3.0.1"
4
+ gem "activesupport", ">= 3.0.1"
5
+ gem "arel", ">= 2.0"
6
+ gem "meta_where", ">= 1.0.1"
7
+ gem "sugar-high", ">= 0.5.0"
8
+ gem "require_all", '~> 1.2.0'
9
+ gem "roles_generic", '>= 0.5.0'
10
+ gem 'rails_artifactor', '>= 0.4.0'
11
+
12
+ group :development, :test do
13
+ gem "rspec", '>= 2.5.0'
14
+ gem 'generator-spec', '>= 0.7.5'
15
+ gem 'database_cleaner', '>= 0.6.7'
16
+ end
17
+
18
+ group :development do
19
+ gem "jeweler", ">= 1.6.4"
20
+ gem "bundler", ">= 1.0.10"
21
+ gem "rdoc"
22
+ end
23
+
data/Rakefile CHANGED
@@ -1,33 +1,47 @@
1
- require 'psych'
1
+ # encoding: utf-8
2
2
 
3
+ require 'rubygems'
4
+ require 'bundler'
3
5
  begin
4
- require 'jeweler'
5
- Jeweler::Tasks.new do |gem|
6
- gem.name = "roles_active_record"
7
- gem.summary = %Q{Implementation of Roles generic API for Active Record}
8
- gem.description = %Q{Makes it easy to set a role strategy on your User model in Active Record}
9
- gem.email = "kmandrup@gmail.com"
10
- gem.homepage = "http://github.com/kristianmandrup/roles_active_record"
11
- gem.authors = ["Kristian Mandrup"]
12
- gem.rubygems_version = '1.6.0'
13
-
14
- # See Gemfile for regular dependencies
15
- # COMMENTED OUT TO AVOID DUPLICATION WITH GEMFILE:
16
- # https://github.com/technicalpickles/jeweler/issues#issue/152
17
-
18
- gem.add_development_dependency 'database_cleaner', '>= 0.6'
19
- gem.add_development_dependency "rspec", '>= 2.4.1'
20
- gem.add_development_dependency "generator-spec", '>= 0.7.3'
21
- gem.add_development_dependency 'migration_assist', '~> 0.2.0'
22
-
23
- gem.add_dependency 'roles_generic', '>= 0.3.8'
24
- gem.add_dependency 'require_all', '~> 1.2.0'
25
- gem.add_dependency 'sugar-high', '~> 0.4.0'
26
- gem.add_dependency 'meta_where', '>= 1.0.1'
27
-
28
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
29
- end
30
- Jeweler::GemcutterTasks.new
31
- rescue LoadError
32
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
33
11
  end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
+ gem.name = "roles_active_record"
18
+ gem.summary = %Q{Implementation of Roles generic API for Active Record}
19
+ gem.description = %Q{Makes it easy to set a role strategy on your User model in Active Record}
20
+ gem.email = "kmandrup@gmail.com"
21
+ gem.homepage = "http://github.com/kristianmandrup/roles_active_record"
22
+ gem.email = "kmandrup@gmail.com"
23
+ gem.authors = ["Kristian Mandrup"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rake/testtask'
29
+ Rake::TestTask.new(:test) do |test|
30
+ test.libs << 'lib' << 'test'
31
+ test.pattern = 'test/**/test_*.rb'
32
+ test.verbose = true
33
+ end
34
+
35
+ task :default => :test
36
+
37
+ require 'rake/rdoctask'
38
+ Rake::RDocTask.new do |rdoc|
39
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
40
+
41
+ rdoc.rdoc_dir = 'rdoc'
42
+ rdoc.title = "cantango #{version}"
43
+ rdoc.rdoc_files.include('README*')
44
+ rdoc.rdoc_files.include('lib/**/*.rb')
45
+ end
46
+
47
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.9
1
+ 0.5.0
@@ -18,8 +18,10 @@ module ActiveRecord
18
18
  class_option :logging, :type => :boolean, :aliases => "-l", :default => false, :desc => "Logging on?"
19
19
  class_option :reverse, :type => :boolean, :alias => "-r", :default => false, :desc => "Create a remove migration for reversing a strategy"
20
20
 
21
- def self.source_root
22
- @source_root ||= File.expand_path("../templates", __FILE__)
21
+ def self.source_root
22
+ # use new reversible migrations with #change method for Rails 3.1
23
+ postfix = Rails::VERSION.include?('3.1') ? "/3_1" : ""
24
+ @source_root ||= File.expand_path("../templates#{postfix}", __FILE__)
23
25
  end
24
26
 
25
27
  def main
@@ -0,0 +1,7 @@
1
+ class AddAdminFlagStrategy < ActiveRecord::Migration
2
+ def change
3
+ change_table :<%= table_name %> do |t|
4
+ t.boolean :admin_flag, :default => false
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,38 @@
1
+ class AddManyRolesStrategy < ActiveRecord::Migration
2
+ def change
3
+ create_roles
4
+ create_user_roles
5
+ add_index :roles, :name, :unique => true
6
+
7
+ # insert_roles
8
+ end
9
+
10
+ protected
11
+
12
+ def create_user_roles
13
+ create_table :<%= table_name.singularize %>_roles do |t|
14
+ t.integer :<%= table_name.singularize %>_id
15
+ t.integer :role_id
16
+ t.timestamps
17
+ end
18
+
19
+ add_index :<%= table_name.singularize %>_roles, [:<%= table_name.singularize %>_id, :role_id], :unique => true
20
+ end
21
+
22
+ def create_roles
23
+ create_table :roles do |t|
24
+ t.string :name
25
+ t.timestamps
26
+ end
27
+ end
28
+
29
+ def insert_roles
30
+ <%- roles_to_add.each do |role| -%>
31
+ begin
32
+ Role.create(:name => '<%= role %>')
33
+ rescue
34
+ end
35
+ <%- end -%>
36
+ end
37
+ end
38
+
@@ -0,0 +1,44 @@
1
+ class AddOneRoleStrategy < ActiveRecord::Migration
2
+ def change
3
+ create_roles
4
+ add_user_role
5
+ add_index :roles, :name, :unique => true
6
+ # insert_roles
7
+ end
8
+
9
+ protected
10
+
11
+ def add_user_role
12
+ change_table :<%= table_name %> do |t|
13
+ t.integer :role_id
14
+ end
15
+ end
16
+
17
+ def remove_user_role
18
+ change_table :<%= table_name %> do |t|
19
+ t.remove :role_id
20
+ end
21
+ end
22
+
23
+
24
+ def create_roles
25
+ create_table :roles do |t|
26
+ t.string :name, :null => false
27
+ t.timestamps
28
+ end
29
+ end
30
+
31
+ def drop_roles
32
+ drop_table :roles
33
+ end
34
+
35
+ def insert_roles
36
+ <%- roles_to_add.each do |role| -%>
37
+ begin
38
+ Role.create(:name => '<%= role %>')
39
+ rescue
40
+ end
41
+ <%- end -%>
42
+ end
43
+ end
44
+
@@ -0,0 +1,7 @@
1
+ class AddRoleStringStrategy < ActiveRecord::Migration
2
+ def change
3
+ change_table :<%= table_name %> do |t|
4
+ t.string :role_string, :default => 'guest', :null => false
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ class AddRolesMaskStrategy < ActiveRecord::Migration
2
+ def change
3
+ change_table :<%= table_name %> do |t|
4
+ t.integer :roles_mask, :default => 1
5
+ end
6
+ end
7
+ end
@@ -24,6 +24,8 @@ class AddManyRolesStrategy < ActiveRecord::Migration
24
24
  t.integer :role_id
25
25
  t.timestamps
26
26
  end
27
+
28
+ add_index :<%= table_name.singularize %>_roles, [:<%= table_name.singularize %>_id, :role_id], :unique => true
27
29
  end
28
30
 
29
31
  def drop_user_roles
@@ -4,7 +4,7 @@ class Role < ActiveRecord::Base
4
4
  has_many :user_roles
5
5
  validates :name, :uniqueness => true
6
6
 
7
- extend RoleClass::ClassMethods
7
+ extend RoleClass::ClassMethods
8
8
  end
9
9
 
10
10
  class UserRole < ActiveRecord::Base
@@ -1,6 +1,11 @@
1
1
  module Roles::ActiveRecord
2
2
  module Strategy
3
- module Shared
3
+ module Shared
4
+
5
+ def set_default_role
6
+ add_role default_role
7
+ end
8
+
4
9
  def set_role role
5
10
  update_attributes(role_attribute => new_role(role))
6
11
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{roles_active_record}
8
- s.version = "0.4.9"
8
+ s.version = "0.5.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Kristian Mandrup}]
12
- s.date = %q{2011-05-09}
12
+ s.date = %q{2011-08-17}
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 = [
@@ -33,6 +33,11 @@ Gem::Specification.new do |s|
33
33
  "lib/generators/active_record/roles/templates/many_roles/user_role.rb",
34
34
  "lib/generators/active_record/roles/templates/one_role/role.rb",
35
35
  "lib/generators/active_record/roles_migration/roles_migration_generator.rb",
36
+ "lib/generators/active_record/roles_migration/templates/3_1/add_admin_flag_strategy.erb",
37
+ "lib/generators/active_record/roles_migration/templates/3_1/add_many_roles_strategy.erb",
38
+ "lib/generators/active_record/roles_migration/templates/3_1/add_one_role_strategy.erb",
39
+ "lib/generators/active_record/roles_migration/templates/3_1/add_role_string_strategy.erb",
40
+ "lib/generators/active_record/roles_migration/templates/3_1/add_roles_mask_strategy.erb",
36
41
  "lib/generators/active_record/roles_migration/templates/add_admin_flag_strategy.erb",
37
42
  "lib/generators/active_record/roles_migration/templates/add_many_roles_strategy.erb",
38
43
  "lib/generators/active_record/roles_migration/templates/add_one_role_strategy.erb",
@@ -92,74 +97,58 @@ Gem::Specification.new do |s|
92
97
  ]
93
98
  s.homepage = %q{http://github.com/kristianmandrup/roles_active_record}
94
99
  s.require_paths = [%q{lib}]
95
- s.rubygems_version = %q{1.8.0}
100
+ s.rubygems_version = %q{1.8.8}
96
101
  s.summary = %q{Implementation of Roles generic API for Active Record}
97
- s.test_files = [
98
- "spec/fixtures/many_roles_setup.rb",
99
- "spec/fixtures/many_roles_setup_unique_check.rb",
100
- "spec/fixtures/one_role_setup.rb",
101
- "spec/fixtures/one_role_setup_unique_check.rb",
102
- "spec/generator_spec_helper.rb",
103
- "spec/migration_spec_helper.rb",
104
- "spec/migrations/admin_flag/002_add_admin_flag_strategy.rb",
105
- "spec/migrations/many_roles/002_add_many_roles_strategy.rb",
106
- "spec/migrations/one_role/002_add_one_role_strategy.rb",
107
- "spec/migrations/role_string/002_add_role_string_strategy.rb",
108
- "spec/migrations/roles_mask/002_add_roles_mask_strategy.rb",
109
- "spec/migrations/users/001_create_users.rb",
110
- "spec/roles_active_record/generators/admin_flag_gen_spec.rb",
111
- "spec/roles_active_record/generators/many_roles_gen_spec.rb",
112
- "spec/roles_active_record/generators/migration_generator_spec.rb",
113
- "spec/roles_active_record/generators/one_role_gen_spec.rb",
114
- "spec/roles_active_record/generators/roles_migration/admin_flag_spec.rb",
115
- "spec/roles_active_record/generators/roles_migration/many_roles_spec.rb",
116
- "spec/roles_active_record/generators/roles_migration/one_role_spec.rb",
117
- "spec/roles_active_record/generators/roles_migration/role_string_spec.rb",
118
- "spec/roles_active_record/generators/roles_migration/roles_mask_spec.rb",
119
- "spec/roles_active_record/strategy/api.rb",
120
- "spec/roles_active_record/strategy/api_examples.rb",
121
- "spec/roles_active_record/strategy/multi/many_roles_spec.rb",
122
- "spec/roles_active_record/strategy/multi/many_roles_unique_spec.rb",
123
- "spec/roles_active_record/strategy/multi/roles_mask_spec.rb",
124
- "spec/roles_active_record/strategy/single/admin_flag_spec.rb",
125
- "spec/roles_active_record/strategy/single/one_role_spec.rb",
126
- "spec/roles_active_record/strategy/single/one_role_unique_spec.rb",
127
- "spec/roles_active_record/strategy/single/role_string_spec.rb",
128
- "spec/roles_active_record/strategy/user_setup.rb",
129
- "spec/spec_helper.rb"
130
- ]
131
102
 
132
103
  if s.respond_to? :specification_version then
133
104
  s.specification_version = 3
134
105
 
135
106
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
136
- s.add_development_dependency(%q<database_cleaner>, [">= 0.6"])
137
- s.add_development_dependency(%q<rspec>, [">= 2.4.1"])
138
- s.add_development_dependency(%q<generator-spec>, [">= 0.7.3"])
139
- s.add_development_dependency(%q<migration_assist>, ["~> 0.2.0"])
140
- s.add_runtime_dependency(%q<roles_generic>, [">= 0.3.8"])
141
- s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
142
- s.add_runtime_dependency(%q<sugar-high>, ["~> 0.4.0"])
107
+ s.add_runtime_dependency(%q<activerecord>, [">= 3.0.1"])
108
+ s.add_runtime_dependency(%q<activesupport>, [">= 3.0.1"])
109
+ s.add_runtime_dependency(%q<arel>, [">= 2.0"])
143
110
  s.add_runtime_dependency(%q<meta_where>, [">= 1.0.1"])
111
+ s.add_runtime_dependency(%q<sugar-high>, [">= 0.5.0"])
112
+ s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
113
+ s.add_runtime_dependency(%q<roles_generic>, [">= 0.5.0"])
114
+ s.add_runtime_dependency(%q<rails_artifactor>, [">= 0.4.0"])
115
+ s.add_development_dependency(%q<rspec>, [">= 2.5.0"])
116
+ s.add_development_dependency(%q<generator-spec>, [">= 0.7.5"])
117
+ s.add_development_dependency(%q<database_cleaner>, [">= 0.6.7"])
118
+ s.add_development_dependency(%q<jeweler>, [">= 1.6.4"])
119
+ s.add_development_dependency(%q<bundler>, [">= 1.0.10"])
120
+ s.add_development_dependency(%q<rdoc>, [">= 0"])
144
121
  else
145
- s.add_dependency(%q<database_cleaner>, [">= 0.6"])
146
- s.add_dependency(%q<rspec>, [">= 2.4.1"])
147
- s.add_dependency(%q<generator-spec>, [">= 0.7.3"])
148
- s.add_dependency(%q<migration_assist>, ["~> 0.2.0"])
149
- s.add_dependency(%q<roles_generic>, [">= 0.3.8"])
150
- s.add_dependency(%q<require_all>, ["~> 1.2.0"])
151
- s.add_dependency(%q<sugar-high>, ["~> 0.4.0"])
122
+ s.add_dependency(%q<activerecord>, [">= 3.0.1"])
123
+ s.add_dependency(%q<activesupport>, [">= 3.0.1"])
124
+ s.add_dependency(%q<arel>, [">= 2.0"])
152
125
  s.add_dependency(%q<meta_where>, [">= 1.0.1"])
126
+ s.add_dependency(%q<sugar-high>, [">= 0.5.0"])
127
+ s.add_dependency(%q<require_all>, ["~> 1.2.0"])
128
+ s.add_dependency(%q<roles_generic>, [">= 0.5.0"])
129
+ s.add_dependency(%q<rails_artifactor>, [">= 0.4.0"])
130
+ s.add_dependency(%q<rspec>, [">= 2.5.0"])
131
+ s.add_dependency(%q<generator-spec>, [">= 0.7.5"])
132
+ s.add_dependency(%q<database_cleaner>, [">= 0.6.7"])
133
+ s.add_dependency(%q<jeweler>, [">= 1.6.4"])
134
+ s.add_dependency(%q<bundler>, [">= 1.0.10"])
135
+ s.add_dependency(%q<rdoc>, [">= 0"])
153
136
  end
154
137
  else
155
- s.add_dependency(%q<database_cleaner>, [">= 0.6"])
156
- s.add_dependency(%q<rspec>, [">= 2.4.1"])
157
- s.add_dependency(%q<generator-spec>, [">= 0.7.3"])
158
- s.add_dependency(%q<migration_assist>, ["~> 0.2.0"])
159
- s.add_dependency(%q<roles_generic>, [">= 0.3.8"])
160
- s.add_dependency(%q<require_all>, ["~> 1.2.0"])
161
- s.add_dependency(%q<sugar-high>, ["~> 0.4.0"])
138
+ s.add_dependency(%q<activerecord>, [">= 3.0.1"])
139
+ s.add_dependency(%q<activesupport>, [">= 3.0.1"])
140
+ s.add_dependency(%q<arel>, [">= 2.0"])
162
141
  s.add_dependency(%q<meta_where>, [">= 1.0.1"])
142
+ s.add_dependency(%q<sugar-high>, [">= 0.5.0"])
143
+ s.add_dependency(%q<require_all>, ["~> 1.2.0"])
144
+ s.add_dependency(%q<roles_generic>, [">= 0.5.0"])
145
+ s.add_dependency(%q<rails_artifactor>, [">= 0.4.0"])
146
+ s.add_dependency(%q<rspec>, [">= 2.5.0"])
147
+ s.add_dependency(%q<generator-spec>, [">= 0.7.5"])
148
+ s.add_dependency(%q<database_cleaner>, [">= 0.6.7"])
149
+ s.add_dependency(%q<jeweler>, [">= 1.6.4"])
150
+ s.add_dependency(%q<bundler>, [">= 1.0.10"])
151
+ s.add_dependency(%q<rdoc>, [">= 0"])
163
152
  end
164
153
  end
165
154
 
@@ -6,7 +6,7 @@ class User < ActiveRecord::Base
6
6
 
7
7
  def initialize attributes = {}
8
8
  super
9
- # role = default_role
10
- add_role default_role
9
+ # add_role default_role
10
+ set_default_role
11
11
  end
12
12
  end
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,4 @@
1
- require 'rspec/core'
1
+ require 'rspec'
2
2
  # require 'autotest/rspec2'
3
3
  require 'rails'
4
4
  require 'active_record'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roles_active_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,66 +9,66 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-05-09 00:00:00.000000000Z
12
+ date: 2011-08-17 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: database_cleaner
16
- requirement: &2157347720 !ruby/object:Gem::Requirement
15
+ name: activerecord
16
+ requirement: &2160638120 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: '0.6'
22
- type: :development
21
+ version: 3.0.1
22
+ type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2157347720
24
+ version_requirements: *2160638120
25
25
  - !ruby/object:Gem::Dependency
26
- name: rspec
27
- requirement: &2157346800 !ruby/object:Gem::Requirement
26
+ name: activesupport
27
+ requirement: &2160637380 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
31
31
  - !ruby/object:Gem::Version
32
- version: 2.4.1
33
- type: :development
32
+ version: 3.0.1
33
+ type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2157346800
35
+ version_requirements: *2160637380
36
36
  - !ruby/object:Gem::Dependency
37
- name: generator-spec
38
- requirement: &2157346080 !ruby/object:Gem::Requirement
37
+ name: arel
38
+ requirement: &2160636680 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
42
42
  - !ruby/object:Gem::Version
43
- version: 0.7.3
44
- type: :development
43
+ version: '2.0'
44
+ type: :runtime
45
45
  prerelease: false
46
- version_requirements: *2157346080
46
+ version_requirements: *2160636680
47
47
  - !ruby/object:Gem::Dependency
48
- name: migration_assist
49
- requirement: &2157345380 !ruby/object:Gem::Requirement
48
+ name: meta_where
49
+ requirement: &2160635280 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
- - - ~>
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.2.0
55
- type: :development
54
+ version: 1.0.1
55
+ type: :runtime
56
56
  prerelease: false
57
- version_requirements: *2157345380
57
+ version_requirements: *2160635280
58
58
  - !ruby/object:Gem::Dependency
59
- name: roles_generic
60
- requirement: &2157344520 !ruby/object:Gem::Requirement
59
+ name: sugar-high
60
+ requirement: &2160633100 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
64
64
  - !ruby/object:Gem::Version
65
- version: 0.3.8
65
+ version: 0.5.0
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *2157344520
68
+ version_requirements: *2160633100
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: require_all
71
- requirement: &2157343880 !ruby/object:Gem::Requirement
71
+ requirement: &2160625640 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,29 +76,95 @@ dependencies:
76
76
  version: 1.2.0
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *2157343880
79
+ version_requirements: *2160625640
80
80
  - !ruby/object:Gem::Dependency
81
- name: sugar-high
82
- requirement: &2157343260 !ruby/object:Gem::Requirement
81
+ name: roles_generic
82
+ requirement: &2160622440 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
- - - ~>
85
+ - - ! '>='
86
86
  - !ruby/object:Gem::Version
87
- version: 0.4.0
87
+ version: 0.5.0
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *2157343260
90
+ version_requirements: *2160622440
91
91
  - !ruby/object:Gem::Dependency
92
- name: meta_where
93
- requirement: &2157342640 !ruby/object:Gem::Requirement
92
+ name: rails_artifactor
93
+ requirement: &2160618640 !ruby/object:Gem::Requirement
94
94
  none: false
95
95
  requirements:
96
96
  - - ! '>='
97
97
  - !ruby/object:Gem::Version
98
- version: 1.0.1
98
+ version: 0.4.0
99
99
  type: :runtime
100
100
  prerelease: false
101
- version_requirements: *2157342640
101
+ version_requirements: *2160618640
102
+ - !ruby/object:Gem::Dependency
103
+ name: rspec
104
+ requirement: &2160616920 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 2.5.0
110
+ type: :development
111
+ prerelease: false
112
+ version_requirements: *2160616920
113
+ - !ruby/object:Gem::Dependency
114
+ name: generator-spec
115
+ requirement: &2160614940 !ruby/object:Gem::Requirement
116
+ none: false
117
+ requirements:
118
+ - - ! '>='
119
+ - !ruby/object:Gem::Version
120
+ version: 0.7.5
121
+ type: :development
122
+ prerelease: false
123
+ version_requirements: *2160614940
124
+ - !ruby/object:Gem::Dependency
125
+ name: database_cleaner
126
+ requirement: &2160613260 !ruby/object:Gem::Requirement
127
+ none: false
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: 0.6.7
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: *2160613260
135
+ - !ruby/object:Gem::Dependency
136
+ name: jeweler
137
+ requirement: &2160612240 !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ! '>='
141
+ - !ruby/object:Gem::Version
142
+ version: 1.6.4
143
+ type: :development
144
+ prerelease: false
145
+ version_requirements: *2160612240
146
+ - !ruby/object:Gem::Dependency
147
+ name: bundler
148
+ requirement: &2160611620 !ruby/object:Gem::Requirement
149
+ none: false
150
+ requirements:
151
+ - - ! '>='
152
+ - !ruby/object:Gem::Version
153
+ version: 1.0.10
154
+ type: :development
155
+ prerelease: false
156
+ version_requirements: *2160611620
157
+ - !ruby/object:Gem::Dependency
158
+ name: rdoc
159
+ requirement: &2160610960 !ruby/object:Gem::Requirement
160
+ none: false
161
+ requirements:
162
+ - - ! '>='
163
+ - !ruby/object:Gem::Version
164
+ version: '0'
165
+ type: :development
166
+ prerelease: false
167
+ version_requirements: *2160610960
102
168
  description: Makes it easy to set a role strategy on your User model in Active Record
103
169
  email: kmandrup@gmail.com
104
170
  executables: []
@@ -123,6 +189,11 @@ files:
123
189
  - lib/generators/active_record/roles/templates/many_roles/user_role.rb
124
190
  - lib/generators/active_record/roles/templates/one_role/role.rb
125
191
  - lib/generators/active_record/roles_migration/roles_migration_generator.rb
192
+ - lib/generators/active_record/roles_migration/templates/3_1/add_admin_flag_strategy.erb
193
+ - lib/generators/active_record/roles_migration/templates/3_1/add_many_roles_strategy.erb
194
+ - lib/generators/active_record/roles_migration/templates/3_1/add_one_role_strategy.erb
195
+ - lib/generators/active_record/roles_migration/templates/3_1/add_role_string_strategy.erb
196
+ - lib/generators/active_record/roles_migration/templates/3_1/add_roles_mask_strategy.erb
126
197
  - lib/generators/active_record/roles_migration/templates/add_admin_flag_strategy.erb
127
198
  - lib/generators/active_record/roles_migration/templates/add_many_roles_strategy.erb
128
199
  - lib/generators/active_record/roles_migration/templates/add_one_role_strategy.erb
@@ -191,6 +262,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
191
262
  - - ! '>='
192
263
  - !ruby/object:Gem::Version
193
264
  version: '0'
265
+ segments:
266
+ - 0
267
+ hash: 2048227676201246637
194
268
  required_rubygems_version: !ruby/object:Gem::Requirement
195
269
  none: false
196
270
  requirements:
@@ -199,40 +273,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
273
  version: '0'
200
274
  requirements: []
201
275
  rubyforge_project:
202
- rubygems_version: 1.8.0
276
+ rubygems_version: 1.8.8
203
277
  signing_key:
204
278
  specification_version: 3
205
279
  summary: Implementation of Roles generic API for Active Record
206
- test_files:
207
- - spec/fixtures/many_roles_setup.rb
208
- - spec/fixtures/many_roles_setup_unique_check.rb
209
- - spec/fixtures/one_role_setup.rb
210
- - spec/fixtures/one_role_setup_unique_check.rb
211
- - spec/generator_spec_helper.rb
212
- - spec/migration_spec_helper.rb
213
- - spec/migrations/admin_flag/002_add_admin_flag_strategy.rb
214
- - spec/migrations/many_roles/002_add_many_roles_strategy.rb
215
- - spec/migrations/one_role/002_add_one_role_strategy.rb
216
- - spec/migrations/role_string/002_add_role_string_strategy.rb
217
- - spec/migrations/roles_mask/002_add_roles_mask_strategy.rb
218
- - spec/migrations/users/001_create_users.rb
219
- - spec/roles_active_record/generators/admin_flag_gen_spec.rb
220
- - spec/roles_active_record/generators/many_roles_gen_spec.rb
221
- - spec/roles_active_record/generators/migration_generator_spec.rb
222
- - spec/roles_active_record/generators/one_role_gen_spec.rb
223
- - spec/roles_active_record/generators/roles_migration/admin_flag_spec.rb
224
- - spec/roles_active_record/generators/roles_migration/many_roles_spec.rb
225
- - spec/roles_active_record/generators/roles_migration/one_role_spec.rb
226
- - spec/roles_active_record/generators/roles_migration/role_string_spec.rb
227
- - spec/roles_active_record/generators/roles_migration/roles_mask_spec.rb
228
- - spec/roles_active_record/strategy/api.rb
229
- - spec/roles_active_record/strategy/api_examples.rb
230
- - spec/roles_active_record/strategy/multi/many_roles_spec.rb
231
- - spec/roles_active_record/strategy/multi/many_roles_unique_spec.rb
232
- - spec/roles_active_record/strategy/multi/roles_mask_spec.rb
233
- - spec/roles_active_record/strategy/single/admin_flag_spec.rb
234
- - spec/roles_active_record/strategy/single/one_role_spec.rb
235
- - spec/roles_active_record/strategy/single/one_role_unique_spec.rb
236
- - spec/roles_active_record/strategy/single/role_string_spec.rb
237
- - spec/roles_active_record/strategy/user_setup.rb
238
- - spec/spec_helper.rb
280
+ test_files: []