From a070ae4a320f8da830862e1dd11eea8b1281ab8c Mon Sep 17 00:00:00 2001 From: Patricio Cano Date: Tue, 6 Sep 2016 16:13:04 -0500 Subject: Style fixes and better tests. --- lib/gitlab_lfs_authentication.rb | 4 ++-- lib/gitlab_shell.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/gitlab_lfs_authentication.rb b/lib/gitlab_lfs_authentication.rb index 4b36229..196cdd7 100644 --- a/lib/gitlab_lfs_authentication.rb +++ b/lib/gitlab_lfs_authentication.rb @@ -11,11 +11,11 @@ class GitlabLfsAuthentication end def self.build_from_json(json) - values = JSON.parse(json) + values = JSON.parse(json) rescue nil self.new(values['username'], values['lfs_token'], values['repository_http_path']) end - def authenticate! + def authentication_payload authorization = { header: { Authorization: "Basic #{Base64.strict_encode64("#{username}:#{lfs_token}")}" diff --git a/lib/gitlab_shell.rb b/lib/gitlab_shell.rb index d3f9bbe..971b22f 100644 --- a/lib/gitlab_shell.rb +++ b/lib/gitlab_shell.rb @@ -194,7 +194,7 @@ class GitlabShell return unless lfs_access - puts lfs_access.authenticate! + puts lfs_access.authentication_payload end private -- cgit v1.2.1