cap_permission 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc CHANGED
@@ -1,6 +1,14 @@
1
1
  = cap_permission
2
2
 
3
- Description goes here.
3
+ Adds group based permissions to Capistrano tasks.
4
+
5
+ == Installation
6
+
7
+ $ gem install cap_permission
8
+
9
+ Include in your Capfile
10
+ require 'rubygems'
11
+ require 'cap_permission'
4
12
 
5
13
  == Contributing to cap_permission
6
14
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.3
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "cap_permission"
8
- s.version = "0.0.2"
8
+ s.version = "0.0.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Dru Ibarra"]
12
- s.date = "2012-02-12"
12
+ s.date = "2012-02-16"
13
13
  s.description = "adds group based permissions to Capistrano tasks"
14
14
  s.email = "Druwerd@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -17,10 +17,15 @@ Capistrano::Configuration.instance(true).load do
17
17
  return false
18
18
  end
19
19
 
20
+ def deployment_user?()
21
+ user = EVN["SUDO_USER"]
22
+ deployment_users.to_a.include?(user)
23
+ end
24
+
20
25
  namespace :permission do
21
26
  desc "check user's group membership"
22
27
  task :check do
23
- if (not admin_user? and not user_in_group?(group_name))
28
+ if (not admin_user? and not user_in_group?(group_name) and not deployment_user?)
24
29
  abort "\n\n\n\e[0;31m You do not have proper group membership to run this deployment! \e[0m\n\n\n"
25
30
  end
26
31
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cap_permission
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Dru Ibarra
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-02-12 00:00:00 Z
18
+ date: 2012-02-16 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: shoulda