summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-02-22 15:36:16 -0600
committerDouwe Maan <douwe@selenight.nl>2017-02-23 09:32:42 -0600
commit32a7041030dcb95d9476b3cbcc5d3c036aae81f3 (patch)
treeb13c14588e826c5ff0313eeda722837195d8a743
parent56c5b2114021f395d4507bed8ad328ae2a35aa45 (diff)
downloadgitlab-ce-32a7041030dcb95d9476b3cbcc5d3c036aae81f3.tar.gz
ActiveSupport delegation is preferred over Forwardable
-rw-r--r--app/models/concerns/cache_markdown_field.rb9
-rw-r--r--lib/gitlab/git/repository.rb2
2 files changed, 5 insertions, 6 deletions
diff --git a/app/models/concerns/cache_markdown_field.rb b/app/models/concerns/cache_markdown_field.rb
index 6dc8c88a14d..8ea95beed79 100644
--- a/app/models/concerns/cache_markdown_field.rb
+++ b/app/models/concerns/cache_markdown_field.rb
@@ -11,14 +11,15 @@ module CacheMarkdownField
# Knows about the relationship between markdown and html field names, and
# stores the rendering contexts for the latter
class FieldData
- extend Forwardable
-
def initialize
@data = {}
end
- def_delegators :@data, :[], :[]=
- def_delegator :@data, :keys, :markdown_fields
+ delegate :[], :[]=, to: :@data
+
+ def markdown_fields
+ @data.keys
+ end
def html_field(markdown_field)
"#{markdown_field}_html"
diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb
index e1fabff4e29..d1dd3da5ed2 100644
--- a/lib/gitlab/git/repository.rb
+++ b/lib/gitlab/git/repository.rb
@@ -1,5 +1,4 @@
# Gitlab::Git::Repository is a wrapper around native Rugged::Repository object
-require 'forwardable'
require 'tempfile'
require 'forwardable'
require "rubygems/package"
@@ -7,7 +6,6 @@ require "rubygems/package"
module Gitlab
module Git
class Repository
- extend Forwardable
include Gitlab::Git::Popen
SEARCH_CONTEXT_LINES = 3