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:
Diffstat (limited to 'metrics_server/override_rails_constants.rb')
-rw-r--r--metrics_server/override_rails_constants.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/metrics_server/override_rails_constants.rb b/metrics_server/override_rails_constants.rb
new file mode 100644
index 00000000000..76e49edfbb0
--- /dev/null
+++ b/metrics_server/override_rails_constants.rb
@@ -0,0 +1,20 @@
+# rubocop:disable Naming/FileName
+# frozen_string_literal: true
+
+require 'active_support/environment_inquirer'
+
+module Rails
+ extend self
+
+ def env
+ @env ||= ActiveSupport::EnvironmentInquirer.new(
+ ENV["RAILS_ENV"].presence || ENV["RACK_ENV"].presence || "development"
+ )
+ end
+
+ def root
+ Pathname.new(File.expand_path('..', __dir__))
+ end
+end
+
+# rubocop:enable Naming/FileName