Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
773c39cc
Commit
773c39cc
authored
May 04, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed import export reader spec
parent
bc8eebf0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
lib/gitlab/import_export/import_export_reader.rb
lib/gitlab/import_export/import_export_reader.rb
+11
-6
No files found.
lib/gitlab/import_export/import_export_reader.rb
View file @
773c39cc
...
...
@@ -41,7 +41,7 @@ module Gitlab
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
)
add_
to_
class
(
current_key
,
included_classes_hash
,
value
)
else
add_new_class
(
current_key
,
included_classes_hash
,
value
)
end
...
...
@@ -58,13 +58,18 @@ module Gitlab
def
add_new_class
(
current_key
,
included_classes_hash
,
value
)
only_except_hash
=
check_only_and_except
(
value
)
# TODO: refactor this
value
=
(
value
.
is_a?
(
Hash
)
?
value
.
merge
(
only_except_hash
)
:
{
value
=>
only_except_hash
})
if
only_except_hash
new_hash
=
{
include:
value
}
included_classes_hash
[
current_key
]
=
new_hash
parsed_hash
=
{
include:
value
}
unless
only_except_hash
.
empty?
if
value
.
is_a?
(
Hash
)
parsed_hash
=
{
include:
value
.
merge
(
only_except_hash
)
}
else
parsed_hash
=
{
include:
{
value
=>
only_except_hash
}
}
end
end
included_classes_hash
[
current_key
]
=
parsed_hash
end
def
add_class
(
current_key
,
included_classes_hash
,
value
)
def
add_
to_
class
(
current_key
,
included_classes_hash
,
value
)
only_except_hash
=
check_only_and_except
(
value
)
value
=
{
value
=>
only_except_hash
}
unless
only_except_hash
.
empty?
old_values
=
included_classes_hash
[
current_key
][
:include
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment