Commit 7a020bf2 authored by Jonathon Reinhart's avatar Jonathon Reinhart

Remove unused lib/names_helper.rb

As of 7eb45672, NamesHelper is no longer used.
parent 528960c8
require_relative 'gitlab_init'
require_relative 'gitlab_net'
require_relative 'gitlab_access_status'
require_relative 'names_helper'
require_relative 'gitlab_metrics'
require_relative 'object_dirs_helper'
require 'json'
......@@ -9,8 +8,6 @@ require 'json'
class GitlabAccess
class AccessDeniedError < StandardError; end
include NamesHelper
attr_reader :config, :gl_repository, :repo_path, :changes, :protocol
def initialize(gl_repository, repo_path, actor, changes, protocol)
......
......@@ -6,8 +6,6 @@ require 'base64'
require 'securerandom'
class GitlabPostReceive
include NamesHelper
attr_reader :config, :gl_repository, :repo_path, :changes, :jid
def initialize(gl_repository, repo_path, actor, changes)
......
module NamesHelper
def extract_ref_name(ref)
ref.gsub(/\Arefs\/(tags|heads)\//, '')
end
end
require 'spec_helper'
require 'names_helper'
describe NamesHelper do
include NamesHelper
describe :extract_ref_name do
it { expect(extract_ref_name('refs/heads/awesome-feature')).to eq('awesome-feature') }
it { expect(extract_ref_name('refs/tags/v2.2.1')).to eq('v2.2.1') }
it { expect(extract_ref_name('refs/tags/releases/v2.2.1')).to eq('releases/v2.2.1') }
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment