lib/gitlab/shell.rb in gitlab-4.2.0 vs lib/gitlab/shell.rb in gitlab-4.3.0
- old
+ new
@@ -61,24 +61,21 @@
proc { |str| actions.map(&:to_s).grep(/^#{Regexp.escape(str)}/) }
end
# Execute a given command with arguements
def execute(cmd=command, args=arguments)
- if actions.include?(cmd.to_sym)
- confirm_command(cmd)
- gitlab_helper(cmd, args)
- else
- fail "Unknown command: #{cmd}. " \
- "See the 'help' for a list of valid commands."
- end
+ raise "Unknown command: #{cmd}. See the 'help' for a list of valid commands." unless actions.include?(cmd.to_sym)
+
+ confirm_command(cmd)
+ gitlab_helper(cmd, args)
end
def quit_shell
history.save
exit
end
def history
@history ||= History.new
end
- end # class << self
+ end
end