diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-01-02 14:57:08 +0100 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2015-01-12 19:53:14 +0100 |
commit | 1a1f4eded6e9c65435f76aeb1e872664895c2d02 (patch) | |
tree | b944d30d1301caa38c40f9a78017817a658581b3 /app/helpers | |
parent | a40989d27ea8a1c5d23dfd5b82f25e09527b2c80 (diff) | |
download | gitlab-ci-1a1f4eded6e9c65435f76aeb1e872664895c2d02.tar.gz |
Added Service and SlackService specs
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/routes_helper.rb | 27 |
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 |