Commits

Bożydar Sobczak committed 52a0db5

refactor: Using rvm-gem to avoid hardcoded paths to rvm

Comments (0)

Files changed (3)

 syntax: glob
 *~
 *.kate-swp
+*.swp
+require 'rvm'
+gemset = 'ruby-1.9.3-p194@app0'
+
+env = RVM.environment(gemset).info[gemset]['environment']
+
 God.watch do |w|
   w.name = "app0"
-  
-  gemsets_path = [
-        "/home/bozydar/.rvm/gems/ruby-1.9.3-p194@app0/bin",
-        "/home/bozydar/.rvm/gems/ruby-1.9.3-p194@global/bin/",
-        "/home/bozydar/.rvm/rubies/ruby-1.9.3-p194/bin",
-        "/home/bozydar/.rvm/bin",
-        ENV['PATH'] # inherit this
-    ].join(':')
-
-  w.env      = {
-    "PATH"        => gemsets_path,
-        "GEM_PATH"    => 
-	  ["/home/bozydar/.rvm/gems/ruby-1.9.3-p194@app0",
-	   "/home/bozydar/.rvm/gems/ruby-1.9.3-p194@global"
-	  ].join(":")
+  w.env = {
+      "PATH"        => env['PATH'],
+      "GEM_PATH"    => env['GEM_PATH'] 
     }
   w.dir = "/home/bozydar/workspaces/god-research/app0"
   w.start = "rackup"
   w.keepalive
-end
+end
+require 'rvm'
+gemset = 'ree-1.8.7-2011.03@app1' 
+
+env = RVM.environment(gemset).info[gemset]['environment']
+
 God.watch do |w|
   w.name = "app1"
-  
-  gemsets_path = [
-        "/home/bozydar/.rvm/gems/ree-1.8.7-2011.03@app1/bin",
-        "/home/bozydar/.rvm/gems/ree-1.8.7-2011.03@global/bin/",
-        "/home/bozydar/.rvm/rubies/ree-1.8.7-2011.03/bin",
-        "/home/bozydar/.rvm/bin",
-        ENV['PATH'] # inherit this
-    ].join(':')
 
-  w.env      = {
-    "PATH"        => gemsets_path,
-        "GEM_PATH"    => 
-	  ["/home/bozydar/.rvm/gems/ree-1.8.7-2011.03@app1",
-	   "/home/bozydar/.rvm/gems/ree-1.8.7-2011.03@global"
-	  ].join(":")
+  w.env = {
+    "PATH" => env['PATH'],
+    "GEM_PATH" => env['GEM_PATH'] 
     }
   w.dir = "/home/bozydar/workspaces/god-research/app1"
   w.start = "rackup -p 9293"
   w.keepalive
-end
+end
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.