rconf 0.9.19 → 0.9.20

Sign up to get free protection for your applications and to get access to all the features.
@@ -106,7 +106,7 @@ module RightConf
106
106
  def default_install_path
107
107
  path = if File.exist?('/opt')
108
108
  if File.exist?('/opt/nginx')
109
- pick_default_path(File.writable?('/opt/nginx'))
109
+ pick_default_path(File.writable?('/opt/nginx') && File.executable?('/opt/nginx/sbin/nginx'))
110
110
  else
111
111
  res = Command.execute('mkdir', '/opt/nginx')
112
112
  pick_default_path(res.success?)
@@ -152,9 +152,12 @@ module RightConf
152
152
  report_failure
153
153
  else
154
154
  FileUtils.cp(`which rake`.chomp, ruby_dir) unless rake_exist = File.exist?(File.join(ruby_dir, 'rake'))
155
- Command.execute_in_ruby('passenger-install-nginx-module', '--auto',
155
+ FileUtils.mkdir_p(install_path)
156
+ Dir.chdir(install_path) do
157
+ Command.execute_in_ruby('passenger-install-nginx-module', '--auto',
156
158
  '--auto-download', '--prefix', install_path,
157
159
  :abort_on_failure => "Failed to install nginx into #{install_path}")
160
+ end
158
161
  FileUtils.mkdir_p(File.join(install_path, 'logs'))
159
162
  File.open(File.join(install_path, 'conf', 'nginx.conf'), 'w') { |f| f.puts(nginx_config) }
160
163
  if File.writable?('/etc/hosts') && IO.read('/etc/hosts') !~ /hosts_entry/
@@ -13,7 +13,7 @@ module RightConf
13
13
 
14
14
  MAJOR = 0
15
15
  MINOR = 9
16
- BUILD = 19
16
+ BUILD = 20
17
17
 
18
18
  VERSION = [MAJOR, MINOR, BUILD].map(&:to_s).join('.')
19
19
 
@@ -21,6 +21,7 @@ describe RightConf::PassengerConfigurator do
21
21
  flexmock(File).should_receive(:exist?).with('/opt/nginx').once.and_return(true)
22
22
  flexmock(File).should_receive(:exist?).with('/opt').once.and_return(true)
23
23
  flexmock(File).should_receive(:writable?).with('/opt/nginx').once.and_return(true)
24
+ flexmock(File).should_receive(:executable?).with('/opt/nginx/sbin/nginx').once.and_return(true)
24
25
  @configurator.__send__(:default_install_path).should == '/opt/nginx'
25
26
  end
26
27
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rconf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.19
4
+ version: 0.9.20
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-04 00:00:00.000000000Z
12
+ date: 2012-07-06 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70217314208600 !ruby/object:Gem::Requirement
16
+ requirement: &70209399567560 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '2.5'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70217314208600
24
+ version_requirements: *70209399567560
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: flexmock
27
- requirement: &70217314204080 !ruby/object:Gem::Requirement
27
+ requirement: &70209399566940 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0.9'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70217314204080
35
+ version_requirements: *70209399566940
36
36
  description: ! 'rconf configures the environment for a given application. rconf reads
37
37
 
38
38
  the content of an application configuration file and installs and/or