c2 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/lib/c2/controller_additions.rb +22 -20
  2. metadata +29 -31
@@ -5,32 +5,34 @@ module C2
5
5
  base.helper_method :current_c2_agent, :current_c2_agent_title, :c2_login_path, :c2_profile_path, :c2_logout_path
6
6
  end
7
7
 
8
- def current_c2_agent
9
- @current_c2_agent ||= current_user
10
- end
8
+ module ClassMethods
9
+ def current_c2_agent
10
+ @current_c2_agent ||= current_user
11
+ end
11
12
 
12
- def current_c2_agent_title
13
- @current_c2_agent_title ||= current_c2_agent.send(([:c2_title, :title, :name, :email].map(&:to_s) & current_c2_agent.methods).first)
14
- end
13
+ def current_c2_agent_title
14
+ @current_c2_agent_title ||= current_c2_agent.send(([:c2_title, :title, :name, :email].map(&:to_s) & current_c2_agent.methods).first)
15
+ end
15
16
 
16
- def c2_clearance?
17
- current_c2_agent && current_c2_agent.admin?
18
- end
17
+ def c2_clearance?
18
+ current_c2_agent && current_c2_agent.admin?
19
+ end
19
20
 
20
- def authorize_c2_agent
21
- raise C2::AccessDenied unless c2_clearance?
22
- end
21
+ def authorize_c2_agent
22
+ raise C2::AccessDenied unless c2_clearance?
23
+ end
23
24
 
24
- def c2_login_path
25
- '/'
26
- end
25
+ def c2_login_path
26
+ '/'
27
+ end
27
28
 
28
- def c2_profile_path
29
- '/'
30
- end
29
+ def c2_profile_path
30
+ '/'
31
+ end
31
32
 
32
- def c2_logout_path
33
- '/'
33
+ def c2_logout_path
34
+ '/'
35
+ end
34
36
  end
35
37
  end
36
38
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: c2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 6
10
- version: 0.1.6
9
+ - 7
10
+ version: 0.1.7
11
11
  platform: ruby
12
12
  authors:
13
13
  - hexorx
@@ -15,13 +15,12 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-27 00:00:00 -06:00
19
- default_executable:
18
+ date: 2011-08-12 00:00:00 Z
20
19
  dependencies:
21
20
  - !ruby/object:Gem::Dependency
21
+ name: rails
22
22
  prerelease: false
23
- type: :runtime
24
- requirement: &id001 !ruby/object:Gem::Requirement
23
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
24
  none: false
26
25
  requirements:
27
26
  - - ">="
@@ -32,12 +31,12 @@ dependencies:
32
31
  - 0
33
32
  - 0
34
33
  version: 3.0.0
35
- name: rails
36
- version_requirements: *id001
34
+ type: :runtime
35
+ requirement: *id001
37
36
  - !ruby/object:Gem::Dependency
37
+ name: mongoid
38
38
  prerelease: false
39
- type: :runtime
40
- requirement: &id002 !ruby/object:Gem::Requirement
39
+ version_requirements: &id002 !ruby/object:Gem::Requirement
41
40
  none: false
42
41
  requirements:
43
42
  - - ">="
@@ -46,12 +45,12 @@ dependencies:
46
45
  segments:
47
46
  - 0
48
47
  version: "0"
49
- name: mongoid
50
- version_requirements: *id002
48
+ type: :runtime
49
+ requirement: *id002
51
50
  - !ruby/object:Gem::Dependency
51
+ name: bson_ext
52
52
  prerelease: false
53
- type: :runtime
54
- requirement: &id003 !ruby/object:Gem::Requirement
53
+ version_requirements: &id003 !ruby/object:Gem::Requirement
55
54
  none: false
56
55
  requirements:
57
56
  - - ">="
@@ -60,12 +59,12 @@ dependencies:
60
59
  segments:
61
60
  - 0
62
61
  version: "0"
63
- name: bson_ext
64
- version_requirements: *id003
62
+ type: :runtime
63
+ requirement: *id003
65
64
  - !ruby/object:Gem::Dependency
65
+ name: haml
66
66
  prerelease: false
67
- type: :runtime
68
- requirement: &id004 !ruby/object:Gem::Requirement
67
+ version_requirements: &id004 !ruby/object:Gem::Requirement
69
68
  none: false
70
69
  requirements:
71
70
  - - ">="
@@ -74,12 +73,12 @@ dependencies:
74
73
  segments:
75
74
  - 0
76
75
  version: "0"
77
- name: haml
78
- version_requirements: *id004
76
+ type: :runtime
77
+ requirement: *id004
79
78
  - !ruby/object:Gem::Dependency
79
+ name: jeweler
80
80
  prerelease: false
81
- type: :development
82
- requirement: &id005 !ruby/object:Gem::Requirement
81
+ version_requirements: &id005 !ruby/object:Gem::Requirement
83
82
  none: false
84
83
  requirements:
85
84
  - - ">="
@@ -88,12 +87,12 @@ dependencies:
88
87
  segments:
89
88
  - 0
90
89
  version: "0"
91
- name: jeweler
92
- version_requirements: *id005
90
+ type: :development
91
+ requirement: *id005
93
92
  - !ruby/object:Gem::Dependency
93
+ name: rspec
94
94
  prerelease: false
95
- type: :development
96
- requirement: &id006 !ruby/object:Gem::Requirement
95
+ version_requirements: &id006 !ruby/object:Gem::Requirement
97
96
  none: false
98
97
  requirements:
99
98
  - - ">="
@@ -102,8 +101,8 @@ dependencies:
102
101
  segments:
103
102
  - 0
104
103
  version: "0"
105
- name: rspec
106
- version_requirements: *id006
104
+ type: :development
105
+ requirement: *id006
107
106
  description: " C2 aspires to be a simple, drop in, Admin Portal + CMS for apps based on Rails 3 + Mongoid. "
108
107
  email: hexorx@gmail.com
109
108
  executables: []
@@ -200,7 +199,6 @@ files:
200
199
  - spec/fabricators/user_fabricator.rb
201
200
  - spec/models/locus_spec.rb
202
201
  - spec/spec_helper.rb
203
- has_rdoc: true
204
202
  homepage: http://crackersnack.com/Command-And-Control
205
203
  licenses: []
206
204
 
@@ -230,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
228
  requirements: []
231
229
 
232
230
  rubyforge_project:
233
- rubygems_version: 1.6.2
231
+ rubygems_version: 1.8.6
234
232
  signing_key:
235
233
  specification_version: 3
236
234
  summary: Take control of your Rails 3 and Mongoid based site with the Comand & Control Admin Portal + CMS.