Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Walker <brett@digitalmoksha.com>2018-05-03 17:58:43 +0300
committerRobert Speicher <robert@gitlab.com>2018-05-03 17:58:43 +0300
commitec5489838a90d4997c72a19ea25dd9da4e307642 (patch)
tree334619849d9c962dd89ebbc254f2d31036b45326
parent17f598e9c36944dc98b2967689622f9d374ea6f4 (diff)
Output some useful information when running the rails console
-rw-r--r--changelogs/unreleased/bw-add-console-message.yml5
-rw-r--r--config/initializers/console_message.rb10
2 files changed, 15 insertions, 0 deletions
diff --git a/changelogs/unreleased/bw-add-console-message.yml b/changelogs/unreleased/bw-add-console-message.yml
new file mode 100644
index 00000000000..7994f7caced
--- /dev/null
+++ b/changelogs/unreleased/bw-add-console-message.yml
@@ -0,0 +1,5 @@
+---
+title: Output some useful information when running the rails console
+merge_request: 18697
+author:
+type: added
diff --git a/config/initializers/console_message.rb b/config/initializers/console_message.rb
new file mode 100644
index 00000000000..536ab337d85
--- /dev/null
+++ b/config/initializers/console_message.rb
@@ -0,0 +1,10 @@
+# rubocop:disable Rails/Output
+if defined?(Rails::Console)
+ # note that this will not print out when using `spring`
+ justify = 15
+ puts "-------------------------------------------------------------------------------------"
+ puts " Gitlab:".ljust(justify) + "#{Gitlab::VERSION} (#{Gitlab::REVISION})"
+ puts " Gitlab Shell:".ljust(justify) + Gitlab::Shell.new.version
+ puts " #{Gitlab::Database.adapter_name}:".ljust(justify) + Gitlab::Database.version
+ puts "-------------------------------------------------------------------------------------"
+end