Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-shell
Commits
ceb23a62
Commit
ceb23a62
authored
May 18, 2013
by
ash
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use :warn instead of :error for invalid commands.
parent
7626d957
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
lib/gitlab_keys.rb
lib/gitlab_keys.rb
+1
-1
lib/gitlab_projects.rb
lib/gitlab_projects.rb
+1
-1
spec/gitlab_keys_spec.rb
spec/gitlab_keys_spec.rb
+2
-2
spec/gitlab_projects_spec.rb
spec/gitlab_projects_spec.rb
+2
-2
No files found.
lib/gitlab_keys.rb
View file @
ceb23a62
...
@@ -18,7 +18,7 @@ class GitlabKeys
...
@@ -18,7 +18,7 @@ class GitlabKeys
when
'add-key'
;
add_key
when
'add-key'
;
add_key
when
'rm-key'
;
rm_key
when
'rm-key'
;
rm_key
else
else
$logger
.
error
"Attempt to execute invalid gitlab-keys command
#{
@command
.
inspect
}
."
$logger
.
warn
"Attempt to execute invalid gitlab-keys command
#{
@command
.
inspect
}
."
puts
'not allowed'
puts
'not allowed'
false
false
end
end
...
...
lib/gitlab_projects.rb
View file @
ceb23a62
...
@@ -32,7 +32,7 @@ class GitlabProjects
...
@@ -32,7 +32,7 @@ class GitlabProjects
when
'import-project'
;
import_project
when
'import-project'
;
import_project
when
'fork-project'
;
fork_project
when
'fork-project'
;
fork_project
else
else
$logger
.
error
"Attempt to execute invalid gitlab-projects command
#{
@command
.
inspect
}
."
$logger
.
warn
"Attempt to execute invalid gitlab-projects command
#{
@command
.
inspect
}
."
puts
'not allowed'
puts
'not allowed'
false
false
end
end
...
...
spec/gitlab_keys_spec.rb
View file @
ceb23a62
...
@@ -63,10 +63,10 @@ describe GitlabKeys do
...
@@ -63,10 +63,10 @@ describe GitlabKeys do
gitlab_keys
.
exec
gitlab_keys
.
exec
end
end
it
'should log a
n error
on unknown commands'
do
it
'should log a
warning
on unknown commands'
do
gitlab_keys
=
build_gitlab_keys
(
'nooope'
)
gitlab_keys
=
build_gitlab_keys
(
'nooope'
)
gitlab_keys
.
stub
(
puts:
nil
)
gitlab_keys
.
stub
(
puts:
nil
)
$logger
.
should_receive
(
:
error
).
with
(
'Attempt to execute invalid gitlab-keys command "nooope".'
)
$logger
.
should_receive
(
:
warn
).
with
(
'Attempt to execute invalid gitlab-keys command "nooope".'
)
gitlab_keys
.
exec
gitlab_keys
.
exec
end
end
end
end
...
...
spec/gitlab_projects_spec.rb
View file @
ceb23a62
...
@@ -180,9 +180,9 @@ describe GitlabProjects do
...
@@ -180,9 +180,9 @@ describe GitlabProjects do
gitlab_projects
.
exec
gitlab_projects
.
exec
end
end
it
'should log a
message
for unknown commands'
do
it
'should log a
warning
for unknown commands'
do
gitlab_projects
=
build_gitlab_projects
(
'hurf-durf'
,
repo_name
)
gitlab_projects
=
build_gitlab_projects
(
'hurf-durf'
,
repo_name
)
$logger
.
should_receive
(
:
error
).
with
(
'Attempt to execute invalid gitlab-projects command "hurf-durf".'
)
$logger
.
should_receive
(
:
warn
).
with
(
'Attempt to execute invalid gitlab-projects command "hurf-durf".'
)
gitlab_projects
.
exec
gitlab_projects
.
exec
end
end
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