Commit 32a70410 authored by Douwe Maan's avatar Douwe Maan

ActiveSupport delegation is preferred over Forwardable

parent 56c5b211
...@@ -11,14 +11,15 @@ module CacheMarkdownField ...@@ -11,14 +11,15 @@ module CacheMarkdownField
# Knows about the relationship between markdown and html field names, and # Knows about the relationship between markdown and html field names, and
# stores the rendering contexts for the latter # stores the rendering contexts for the latter
class FieldData class FieldData
extend Forwardable
def initialize def initialize
@data = {} @data = {}
end end
def_delegators :@data, :[], :[]= delegate :[], :[]=, to: :@data
def_delegator :@data, :keys, :markdown_fields
def markdown_fields
@data.keys
end
def html_field(markdown_field) def html_field(markdown_field)
"#{markdown_field}_html" "#{markdown_field}_html"
......
# Gitlab::Git::Repository is a wrapper around native Rugged::Repository object # Gitlab::Git::Repository is a wrapper around native Rugged::Repository object
require 'forwardable'
require 'tempfile' require 'tempfile'
require 'forwardable' require 'forwardable'
require "rubygems/package" require "rubygems/package"
...@@ -7,7 +6,6 @@ require "rubygems/package" ...@@ -7,7 +6,6 @@ require "rubygems/package"
module Gitlab module Gitlab
module Git module Git
class Repository class Repository
extend Forwardable
include Gitlab::Git::Popen include Gitlab::Git::Popen
SEARCH_CONTEXT_LINES = 3 SEARCH_CONTEXT_LINES = 3
......
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