From 79f60e2b5cf388416cdc5948e19ae0401f97d353 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 19 Sep 2016 13:42:10 +0200 Subject: Move Gitlab::Auth.Result to separate file --- lib/gitlab/auth.rb | 14 -------------- lib/gitlab/auth/result.rb | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 lib/gitlab/auth/result.rb diff --git a/lib/gitlab/auth.rb b/lib/gitlab/auth.rb index 1e0a7ec253a..ca2a0920c00 100644 --- a/lib/gitlab/auth.rb +++ b/lib/gitlab/auth.rb @@ -1,19 +1,5 @@ module Gitlab module Auth - Result = Struct.new(:actor, :project, :type, :authentication_abilities) do - def ci? - type == :ci - end - - def lfs_deploy_token? - type == :lfs_deploy_token - end - - def success? - actor.present? || type == :ci - end - end - class MissingPersonalTokenError < StandardError; end class << self diff --git a/lib/gitlab/auth/result.rb b/lib/gitlab/auth/result.rb new file mode 100644 index 00000000000..e4786b12676 --- /dev/null +++ b/lib/gitlab/auth/result.rb @@ -0,0 +1,17 @@ +module Gitlab + module Auth + Result = Struct.new(:actor, :project, :type, :authentication_abilities) do + def ci? + type == :ci + end + + def lfs_deploy_token? + type == :lfs_deploy_token + end + + def success? + actor.present? || type == :ci + end + end + end +end -- cgit v1.2.1