BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
8016cefa
Commit
8016cefa
authored
Feb 25, 2014
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the Gitlab::Popen path argument optional
parent
0432bdf1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
popen.rb
lib/gitlab/popen.rb
+2
-1
popen_spec.rb
spec/lib/gitlab/popen_spec.rb
+9
-0
No files found.
lib/gitlab/popen.rb
View file @
8016cefa
...
...
@@ -3,11 +3,12 @@ require 'open3'
module
Gitlab
module
Popen
def
popen
(
cmd
,
path
)
def
popen
(
cmd
,
path
=
nil
)
unless
cmd
.
is_a?
(
Array
)
raise
"System commands must be given as an array of strings"
end
path
||=
Dir
.
pwd
vars
=
{
"PWD"
=>
path
}
options
=
{
chdir:
path
}
...
...
spec/lib/gitlab/popen_spec.rb
View file @
8016cefa
...
...
@@ -32,5 +32,14 @@ describe 'Gitlab::Popen', no_db: true do
end
end
context
'without a directory argument'
do
before
do
@output
,
@status
=
@klass
.
new
.
popen
(
%W(ls)
)
end
it
{
@status
.
should
be_zero
}
it
{
@output
.
should
include
(
'spec'
)
}
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