chef-sudo 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/chef-sudo.gemspec +2 -2
- data/lib/chef-sudo.rb +10 -5
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/chef-sudo.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{chef-sudo}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mariusz Pietrzyk"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-04-02}
|
13
13
|
s.description = %q{Provides chef sudo resource for executing commands with sudo}
|
14
14
|
s.email = %q{wijet@wijet.pl}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/chef-sudo.rb
CHANGED
@@ -34,7 +34,7 @@ class Chef
|
|
34
34
|
)
|
35
35
|
end
|
36
36
|
|
37
|
-
def simulate_initial_login(arg=
|
37
|
+
def simulate_initial_login(arg=nil)
|
38
38
|
set_or_return(
|
39
39
|
:simulate_initial_login,
|
40
40
|
arg,
|
@@ -72,15 +72,20 @@ class Chef
|
|
72
72
|
command << "-u #{@new_resource.user}" if @new_resource.user
|
73
73
|
command << "-g #{@new_resource.group}" if @new_resource.group
|
74
74
|
command << "-i" if @new_resource.simulate_initial_login
|
75
|
-
|
76
|
-
|
75
|
+
|
76
|
+
if @new_resource.cwd
|
77
|
+
command << " -- \"cd #{@new_resource.cwd} && #{@new_resource.command}\""
|
78
|
+
else
|
79
|
+
command << " -- \"#{@new_resource.command}\""
|
80
|
+
end
|
81
|
+
|
77
82
|
options = {:command => command.join(' ')}
|
78
|
-
options[:cwd] = @new_resource.cwd if @new_resource.cwd
|
79
83
|
options[:environment] = @new_resource.environment if @new_resource.environment
|
80
|
-
|
84
|
+
|
81
85
|
Chef::Mixin::Command.run_command(options)
|
82
86
|
Chef::Log.info "Ran sudo [#{@new_resource.name}]"
|
83
87
|
end
|
84
88
|
end
|
85
89
|
end
|
86
90
|
end
|
91
|
+
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Mariusz Pietrzyk
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-04-02 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|