[ARVADOS] updated: 28c07cc661b01747d4a3b090d0cac2e68067ad80
git at public.curoverse.com
git at public.curoverse.com
Mon Apr 14 16:31:16 EDT 2014
Summary of changes:
sdk/ruby/lib/arvados.rb | 32 ++++++++++++++++++--------------
1 files changed, 18 insertions(+), 14 deletions(-)
via 28c07cc661b01747d4a3b090d0cac2e68067ad80 (commit)
from 97279656db75b9b7f8282e3b98774a60935d39f3 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 28c07cc661b01747d4a3b090d0cac2e68067ad80
Author: Ward Vandewege <ward at curoverse.com>
Date: Mon Apr 14 16:31:07 2014 -0400
Do not blow up when HOME is not set.
diff --git a/sdk/ruby/lib/arvados.rb b/sdk/ruby/lib/arvados.rb
index 5d1f489..a94eb1d 100644
--- a/sdk/ruby/lib/arvados.rb
+++ b/sdk/ruby/lib/arvados.rb
@@ -152,22 +152,26 @@ class Arvados
config['ARVADOS_API_HOST_INSECURE'] = ENV['ARVADOS_API_HOST_INSECURE']
config['ARVADOS_API_VERSION'] = ENV['ARVADOS_API_VERSION']
- expanded_path = File.expand_path config_file_path
- if File.exist? expanded_path
- # Load settings from the config file.
- lineno = 0
- File.open(expanded_path).each do |line|
- lineno = lineno + 1
- # skip comments and blank lines
- next if line.match('^\s*#') or not line.match('\S')
- var, val = line.chomp.split('=', 2)
- # allow environment settings to override config files.
- if var and val
- config[var] ||= val
- else
- warn "#{expanded_path}: #{lineno}: could not parse `#{line}'"
+ begin
+ expanded_path = File.expand_path config_file_path
+ if File.exist? expanded_path
+ # Load settings from the config file.
+ lineno = 0
+ File.open(expanded_path).each do |line|
+ lineno = lineno + 1
+ # skip comments and blank lines
+ next if line.match('^\s*#') or not line.match('\S')
+ var, val = line.chomp.split('=', 2)
+ # allow environment settings to override config files.
+ if var and val
+ config[var] ||= val
+ else
+ warn "#{expanded_path}: #{lineno}: could not parse `#{line}'"
+ end
end
end
+ rescue
+ debuglog "HOME environment variable (#{ENV['HOME']}) not set, not using #{config_file_path}", 0
end
@@config = config
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list