summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-01-02 14:57:08 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2015-01-12 19:53:14 +0100
commit1a1f4eded6e9c65435f76aeb1e872664895c2d02 (patch)
treeb944d30d1301caa38c40f9a78017817a658581b3 /app/helpers
parenta40989d27ea8a1c5d23dfd5b82f25e09527b2c80 (diff)
downloadgitlab-ci-1a1f4eded6e9c65435f76aeb1e872664895c2d02.tar.gz
Added Service and SlackService specs
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/routes_helper.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/app/helpers/routes_helper.rb b/app/helpers/routes_helper.rb
new file mode 100644
index 0000000..a7f1dff
--- /dev/null
+++ b/app/helpers/routes_helper.rb
@@ -0,0 +1,27 @@
+module RoutesHelper
+ class Base
+ include Rails.application.routes.url_helpers
+
+ def default_url_options
+ {
+ host: Settings.gitlab_ci['host'],
+ protocol: Settings.gitlab_ci['https'] ? "https" : "http",
+ port: Settings.gitlab_ci['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