cancan-permits 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/Changelog.txt CHANGED
@@ -1,3 +1,9 @@
1
+ ## Nov 24, 2010
2
+
3
+ The generator has now been tested with Rails 3.0.3 and works. Previously there was an issue with missing generator dependencies in the Rakefile.
4
+ Dependencies in general have been updated and the generator improved.
5
+ Specs have been created for all the ORMs supported.
6
+
1
7
  ## Oct 23, 2010
2
8
 
3
9
  The API specs are now stored in spec/generic/api. To spec that an ORM implementation of cancan-permits work, simply require the 'xgroup_orm' file from the /basic and /owner
data/README.markdown CHANGED
@@ -4,12 +4,22 @@ Role specific Permits for use with [CanCan](http://github.com/ryanb/cancan) perm
4
4
 
5
5
  ## Changes
6
6
 
7
- See Changelog.txt
7
+ See Changelog.txt (Major updates as per Nov 24. 2010)
8
8
 
9
9
  ## Install
10
10
 
11
11
  <code>gem install cancan-permits</code>
12
12
 
13
+ ## Usage Rails 3 app
14
+
15
+ Gemfile
16
+ <code>gem 'cancan-permits'</code>
17
+
18
+ Update gem bundle in terminal:
19
+ <code>$ bundle install</code>
20
+
21
+ See Generator section below. Also see [CanCan permits demo app](https://github.com/kristianmandrup/cancan-permits-demo)
22
+
13
23
  ## Usage
14
24
 
15
25
  * Define Roles that Users can have
data/Rakefile CHANGED
@@ -7,13 +7,17 @@ begin
7
7
  gem.email = "kmandrup@gmail.com"
8
8
  gem.homepage = "http://github.com/kristianmandrup/cancan-permits"
9
9
  gem.authors = ["Kristian Mandrup"]
10
- gem.add_development_dependency "rspec", "~> 2.0.0"
10
+ gem.add_development_dependency "rspec", ">= 2.0.0"
11
11
  gem.add_development_dependency 'code-spec', "~> 0.2.5"
12
12
  gem.add_development_dependency 'rails-app-spec', "~> 0.3.0"
13
13
 
14
- gem.add_dependency 'cancan', "~> 1.4.0"
15
- gem.add_dependency 'require_all', "~> 1.2.0"
16
- gem.add_dependency 'sugar-high', "~> 0.3.0"
14
+ gem.add_dependency 'cancan', "~> 1.4.1"
15
+ gem.add_dependency 'require_all', "~> 1.2.0"
16
+ gem.add_dependency 'sugar-high', "~> 0.3.0"
17
+ gem.add_dependency 'rails3_artifactor', "~> 0.3.1"
18
+ gem.add_dependency 'activesupport', ">= 3.0.1"
19
+ gem.add_dependency 'logging_assist', ">= 0.1.6"
20
+
17
21
  end
18
22
  Jeweler::GemcutterTasks.new
19
23
  rescue LoadError
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.8
1
+ 0.2.9
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cancan-permits}
8
- s.version = "0.2.8"
8
+ s.version = "0.2.9"
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"]
@@ -144,27 +144,36 @@ Gem::Specification.new do |s|
144
144
  s.specification_version = 3
145
145
 
146
146
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
147
- s.add_development_dependency(%q<rspec>, ["~> 2.0.0"])
147
+ s.add_development_dependency(%q<rspec>, [">= 2.0.0"])
148
148
  s.add_development_dependency(%q<code-spec>, ["~> 0.2.5"])
149
149
  s.add_development_dependency(%q<rails-app-spec>, ["~> 0.3.0"])
150
- s.add_runtime_dependency(%q<cancan>, ["~> 1.4.0"])
150
+ s.add_runtime_dependency(%q<cancan>, ["~> 1.4.1"])
151
151
  s.add_runtime_dependency(%q<require_all>, ["~> 1.2.0"])
152
152
  s.add_runtime_dependency(%q<sugar-high>, ["~> 0.3.0"])
153
+ s.add_runtime_dependency(%q<rails3_artifactor>, ["~> 0.3.1"])
154
+ s.add_runtime_dependency(%q<activesupport>, [">= 3.0.1"])
155
+ s.add_runtime_dependency(%q<logging_assist>, [">= 0.1.6"])
153
156
  else
154
- s.add_dependency(%q<rspec>, ["~> 2.0.0"])
157
+ s.add_dependency(%q<rspec>, [">= 2.0.0"])
155
158
  s.add_dependency(%q<code-spec>, ["~> 0.2.5"])
156
159
  s.add_dependency(%q<rails-app-spec>, ["~> 0.3.0"])
157
- s.add_dependency(%q<cancan>, ["~> 1.4.0"])
160
+ s.add_dependency(%q<cancan>, ["~> 1.4.1"])
158
161
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
159
162
  s.add_dependency(%q<sugar-high>, ["~> 0.3.0"])
163
+ s.add_dependency(%q<rails3_artifactor>, ["~> 0.3.1"])
164
+ s.add_dependency(%q<activesupport>, [">= 3.0.1"])
165
+ s.add_dependency(%q<logging_assist>, [">= 0.1.6"])
160
166
  end
161
167
  else
162
- s.add_dependency(%q<rspec>, ["~> 2.0.0"])
168
+ s.add_dependency(%q<rspec>, [">= 2.0.0"])
163
169
  s.add_dependency(%q<code-spec>, ["~> 0.2.5"])
164
170
  s.add_dependency(%q<rails-app-spec>, ["~> 0.3.0"])
165
- s.add_dependency(%q<cancan>, ["~> 1.4.0"])
171
+ s.add_dependency(%q<cancan>, ["~> 1.4.1"])
166
172
  s.add_dependency(%q<require_all>, ["~> 1.2.0"])
167
173
  s.add_dependency(%q<sugar-high>, ["~> 0.3.0"])
174
+ s.add_dependency(%q<rails3_artifactor>, ["~> 0.3.1"])
175
+ s.add_dependency(%q<activesupport>, [">= 3.0.1"])
176
+ s.add_dependency(%q<logging_assist>, [">= 0.1.6"])
168
177
  end
169
178
  end
170
179
 
@@ -1,3 +1,4 @@
1
+ require 'rails/generators/base'
1
2
  require 'sugar-high/array'
2
3
  require 'active_support/inflector'
3
4
  require 'rails3_artifactor'
@@ -20,13 +21,13 @@ class PermitsGenerator < Rails::Generators::Base
20
21
  default_roles.each do |role|
21
22
  template_permit role
22
23
  end
23
- template_permit :admin, :admin_permit
24
+
24
25
  template_permit :any, :any_permit
25
26
  template_permit :system, :barebones_permit
26
27
 
27
28
  permit_logic = base_logic
28
29
  roles.each do |role|
29
- template_permit role if !default_roles.include?(role)
30
+ template_permit role if !default_roles.include?(role.to_sym)
30
31
  end
31
32
  template "licenses.rb", "app/permits/licenses.rb"
32
33
  permits_initializer
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'rspec/core'
2
2
  require 'cancan/matchers'
3
- require 'cancan-permits'
3
+ require 'cancan-permits'
4
4
  require 'cancan-permits/rspec'
5
5
 
6
6
  require_all File.dirname(__FILE__) + '/fixtures/permits'
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 8
9
- version: 0.2.8
8
+ - 9
9
+ version: 0.2.9
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  none: false
25
25
  requirements:
26
- - - ~>
26
+ - - ">="
27
27
  - !ruby/object:Gem::Version
28
28
  segments:
29
29
  - 2
@@ -73,8 +73,8 @@ dependencies:
73
73
  segments:
74
74
  - 1
75
75
  - 4
76
- - 0
77
- version: 1.4.0
76
+ - 1
77
+ version: 1.4.1
78
78
  type: :runtime
79
79
  version_requirements: *id004
80
80
  - !ruby/object:Gem::Dependency
@@ -107,6 +107,51 @@ dependencies:
107
107
  version: 0.3.0
108
108
  type: :runtime
109
109
  version_requirements: *id006
110
+ - !ruby/object:Gem::Dependency
111
+ name: rails3_artifactor
112
+ prerelease: false
113
+ requirement: &id007 !ruby/object:Gem::Requirement
114
+ none: false
115
+ requirements:
116
+ - - ~>
117
+ - !ruby/object:Gem::Version
118
+ segments:
119
+ - 0
120
+ - 3
121
+ - 1
122
+ version: 0.3.1
123
+ type: :runtime
124
+ version_requirements: *id007
125
+ - !ruby/object:Gem::Dependency
126
+ name: activesupport
127
+ prerelease: false
128
+ requirement: &id008 !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ segments:
134
+ - 3
135
+ - 0
136
+ - 1
137
+ version: 3.0.1
138
+ type: :runtime
139
+ version_requirements: *id008
140
+ - !ruby/object:Gem::Dependency
141
+ name: logging_assist
142
+ prerelease: false
143
+ requirement: &id009 !ruby/object:Gem::Requirement
144
+ none: false
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ segments:
149
+ - 0
150
+ - 1
151
+ - 6
152
+ version: 0.1.6
153
+ type: :runtime
154
+ version_requirements: *id009
110
155
  description: Role specific Permits for use with CanCan permission system
111
156
  email: kmandrup@gmail.com
112
157
  executables: []