Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
platform
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
leap
platform
Commits
e03bfce9
Commit
e03bfce9
authored
Jun 29, 2016
by
elijah
Browse files
Options
Downloads
Patches
Plain Diff
leap cli: remove commands/util.rb (duplicate of common.rb)
parent
796b8893
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/leap_cli/commands/util.rb
+0
-49
0 additions, 49 deletions
lib/leap_cli/commands/util.rb
with
0 additions
and
49 deletions
lib/leap_cli/commands/util.rb
deleted
100644 → 0
+
0
−
49
View file @
796b8893
module
LeapCli
;
module
Commands
extend
self
extend
LeapCli
::
Util
def
path
(
name
)
Path
.
named_path
(
name
)
end
#
# keeps prompting the user for a numbered choice, until they pick a good one or bail out.
#
# block is yielded and is responsible for rendering the choices.
#
def
numbered_choice_menu
(
msg
,
items
,
&
block
)
while
true
say
(
"
\n
"
+
msg
+
':'
)
items
.
each_with_index
&
block
say
(
"q. quit"
)
index
=
ask
(
"number 1-
#{
items
.
length
}
> "
)
if
index
.
empty?
next
elsif
index
=~
/q/
bail!
else
i
=
index
.
to_i
-
1
if
i
<
0
||
i
>=
items
.
length
bail!
else
return
i
end
end
end
end
def
parse_node_list
(
nodes
)
if
nodes
.
is_a?
Config
::
Object
Config
::
ObjectList
.
new
(
nodes
)
elsif
nodes
.
is_a?
Config
::
ObjectList
nodes
elsif
nodes
.
is_a?
String
manager
.
filter!
(
nodes
)
else
bail!
"argument error"
end
end
end
;
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment