From 1d180b7a75183ae463769b6bf09ee4eaf3bfc3d8 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 4 Feb 2013 09:41:26 +0200 Subject: GitlabConfig. Fixed adding key --- lib/gitlab_keys.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/gitlab_keys.rb') diff --git a/lib/gitlab_keys.rb b/lib/gitlab_keys.rb index 3612bca..7eae17c 100644 --- a/lib/gitlab_keys.rb +++ b/lib/gitlab_keys.rb @@ -1,5 +1,5 @@ require 'open3' -require 'yaml' +require_relative 'gitlab_config' class GitlabKeys attr_accessor :auth_file, :key, :username @@ -8,9 +8,7 @@ class GitlabKeys @command = ARGV.shift @username = ARGV.shift @key = ARGV.shift - - config = YAML.load_file(File.join(ROOT_PATH, 'config.yml')) - @auth_file = config['auth_file'] + @auth_file = GitlabConfig.new.auth_file end def exec @@ -27,7 +25,7 @@ class GitlabKeys def add_key cmd = "command=\"#{ROOT_PATH}/bin/gitlab-shell #{@username}\",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty #{@key}" - cmd = "echo \"#{cmd}\" >> #{auth_file}" + cmd = "echo \'#{cmd}\' >> #{auth_file}" system(cmd) end -- cgit v1.2.1