diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-04 09:41:26 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-04 09:41:26 +0200 |
commit | 1d180b7a75183ae463769b6bf09ee4eaf3bfc3d8 (patch) | |
tree | 35d4e520ffeb0291c139dd1be4367270edc54754 /lib/gitlab_keys.rb | |
parent | 451b4a64c0a3e39902ad87dfe034c58d8c6d45dc (diff) | |
download | gitlab-shell-1d180b7a75183ae463769b6bf09ee4eaf3bfc3d8.tar.gz |
GitlabConfig. Fixed adding key
Diffstat (limited to 'lib/gitlab_keys.rb')
-rw-r--r-- | lib/gitlab_keys.rb | 8 |
1 files changed, 3 insertions, 5 deletions
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 |