diff options
author | Patricio Cano <suprnova32@gmail.com> | 2015-09-16 19:54:18 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2015-09-16 19:54:18 -0500 |
commit | 1ddefa3beabed00f08c893ca66b9f004e3b4e4df (patch) | |
tree | 12c0546f4246b8ee5090c32996f3301207bcf93f /app/helpers/ci/routes_helper.rb | |
parent | 1ef2ce95d507c3d21598f26dd8a0e77dfc3c33cf (diff) | |
parent | cac969229aab74ab5dcd7682c4f1c3a74a17b9d6 (diff) | |
download | gitlab-ce-1ddefa3beabed00f08c893ca66b9f004e3b4e4df.tar.gz |
Merge branch 'master' into notification-levels
Diffstat (limited to 'app/helpers/ci/routes_helper.rb')
-rw-r--r-- | app/helpers/ci/routes_helper.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/app/helpers/ci/routes_helper.rb b/app/helpers/ci/routes_helper.rb new file mode 100644 index 00000000000..42cd54b064f --- /dev/null +++ b/app/helpers/ci/routes_helper.rb @@ -0,0 +1,29 @@ +module Ci + module RoutesHelper + class Base + include Gitlab::Application.routes.url_helpers + + def default_url_options + { + host: Settings.gitlab['host'], + protocol: Settings.gitlab['https'] ? "https" : "http", + port: Settings.gitlab['port'] + } + end + end + + def url_helpers + @url_helpers ||= Base.new + end + + def self.method_missing(method, *args, &block) + @url_helpers ||= Base.new + + if @url_helpers.respond_to?(method) + @url_helpers.send(method, *args, &block) + else + super method, *args, &block + end + end + end +end |