Commit 5d642fb7 authored by James Lopez's avatar James Lopez

fix rubocop warnings

parent de6c44e9
......@@ -38,7 +38,8 @@ module Projects
def process_include(hash, included_classes_hash = {})
hash.values.flatten.each do |value|
current_key, value = process_current_class(hash, included_classes_hash, value)
current_key = hash.keys.first
value = process_current_class(hash, included_classes_hash, value)
if included_classes_hash[current_key]
add_class(current_key, included_classes_hash, value)
else
......@@ -50,14 +51,13 @@ module Projects
def process_current_class(hash, included_classes_hash, value)
value = value.is_a?(Hash) ? process_include(hash, included_classes_hash) : value
current_key = hash.keys.first
only_except_hash = check_only_and_except(current_key)
included_classes_hash[current_key] ||= only_except_hash unless only_except_hash.empty?
return current_key, value
only_except_hash = check_only_and_except(hash.keys.first)
included_classes_hash[hash.keys.first] ||= only_except_hash unless only_except_hash.empty?
value
end
def add_new_class(current_key, included_classes_hash, value)
new_hash = { :include => value }
new_hash = { include: value }
new_hash.merge!(check_only_and_except(value))
included_classes_hash[current_key] = new_hash
end
......@@ -88,4 +88,4 @@ module Projects
end
end
end
end
\ No newline at end of file
end
......@@ -5,14 +5,14 @@ describe Projects::ImportExport::ImportExportReader do
let(:test_config) { 'spec/support/import_export/import_export.yml' }
let(:project_tree_hash) do
{
:only => [:name, :path],
:include => [:issues, :labels,
{ :merge_requests => {
:only => [:id],
:except => [:iid],
:include => [:merge_request_diff, :merge_request_test]
} },
{ :commit_statuses => { :include => :commit } }]
only: [:name, :path],
include: [:issues, :labels,
{ merge_requests: {
only: [:id],
except: [:iid],
include: [:merge_request_diff, :merge_request_test]
} },
{ commit_statuses: { include: :commit } }]
}
end
......@@ -21,4 +21,4 @@ describe Projects::ImportExport::ImportExportReader do
expect(described_class.project_tree).to eq(project_tree_hash)
end
end
\ No newline at end of file
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