Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
Noah
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Noah
Commits
3f1a3d55
Commit
3f1a3d55
authored
Aug 06, 2011
by
John E. Vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for short-form on 1.8
parent
c5141968
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletion
+11
-1
configurations.rb
lib/noah/models/configurations.rb
+11
-1
No files found.
lib/noah/models/configurations.rb
View file @
3f1a3d55
...
@@ -69,7 +69,17 @@ module Noah
...
@@ -69,7 +69,17 @@ module Noah
if
short
==
false
if
short
==
false
configs
.
each
{
|
x
|
config_hash
[
"
#{
x
.
name
}
"
]
=
x
.
to_hash
.
reject
{
|
k
,
v
|
k
==
:name
}
}
configs
.
each
{
|
x
|
config_hash
[
"
#{
x
.
name
}
"
]
=
x
.
to_hash
.
reject
{
|
k
,
v
|
k
==
:name
}
}
else
else
configs
.
each
{
|
x
|
config_hash
[
"
#{
x
.
name
}
"
]
=
x
.
to_hash
.
select
{
|
k
,
v
|
k
if
short_keys
.
include?
(
k
)}
}
configs
.
each
do
|
x
|
items
=
x
.
to_hash
.
select
{
|
k
,
v
|
k
if
short_keys
.
include?
(
k
)}
# 1.8 fix for Hash#select
if
items
.
is_a?
(
Array
)
items_hash
=
{}
items
.
each
{
|
item
|
items_hash
.
merge!
(
Hash
[
*
item
])}
else
items_hash
=
items
end
config_hash
[
"
#{
x
.
name
}
"
]
=
items_hash
end
end
end
config_hash
config_hash
end
end
...
...
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