whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sam Ruby <ru...@apache.org>
Subject [whimsy.git] [1/1] Commit 405488c: updates for puppet/whimsy_server
Date Thu, 07 Jan 2016 16:16:10 GMT
Commit 405488c4069f9a6204fbe2d2d7ac4f1ca4408d92:
    updates for puppet/whimsy_server
    * Apache configuration uses PassengerRuby
    * Find system bundler using the PATH (different directory than Ruby)
    * $HOME not set, so use '/root'


Branch: refs/heads/master
Author: Sam Ruby <rubys@intertwingly.net>
Committer: Sam Ruby <rubys@intertwingly.net>
Pusher: rubys <rubys@apache.org>

------------------------------------------------------------
Rakefile                                                     | +++ ---
------------------------------------------------------------
6 changes: 3 additions, 3 deletions.
------------------------------------------------------------


diff --git a/Rakefile b/Rakefile
index df4f4b5..6928b45 100644
--- a/Rakefile
+++ b/Rakefile
@@ -13,7 +13,7 @@ task :update do
 
   # locate passenger ruby
   conf = Dir['/etc/apache2/*/passenger.conf'].first
-  conf = File.read(conf)[/PassengerDefaultRuby (.*)/, 1] if conf
+  conf = File.read(conf)[/PassengerRuby "?(.*?)"?$/, 1] if conf
   if conf
     passruby = "#{File.dirname(conf)}/%s#{conf[/ruby([.\d]*)$/, 1]}"
   else
@@ -24,13 +24,13 @@ task :update do
   Dir['**/Gemfile'].each do |gemfile|
     Dir.chdir File.dirname(gemfile) do
       bundler = (File.exist?('config.ru') ? passruby : sysruby) % 'bundle'
-      bundler = (File.exist?(bundler) ? bundler : 'bundle')
+      bundler = 'bundle' unless File.exist?(bundler)
       system "#{bundler} update"
     end
   end
 
   # determine last update time
-  update_file = "#{Dir.home}/.whimsy-update"
+  update_file = "#{Process.uid == 0 ? '/root' : Dir.home}/.whimsy-update"
   new_baseline = Time.now
   old_baseline = File.mtime(update_file) rescue Time.at(0)
 

Mime
View raw message