summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-30 11:26:01 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-30 11:26:01 +0200
commitb34fca92cde3e90ecd883ec3549ea64dc7e5ba80 (patch)
tree5cf3d7249e4e81f802f04877f0ef58128fa77a64
parenta25ec068e2856369ec6fae661e8b2fde7a534c02 (diff)
downloadgitlab-ci-b34fca92cde3e90ecd883ec3549ea64dc7e5ba80.tar.gz
Uppercase constants
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--.gitignore1
-rw-r--r--app/views/admin/runners/index.html.haml2
-rw-r--r--app/views/helps/show.html.haml4
-rw-r--r--config/initializers/2_app.rb6
-rw-r--r--lib/api/helpers.rb2
-rw-r--r--spec/requests/runners_spec.rb2
6 files changed, 9 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index fd8a099..f6e9522 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,3 +16,4 @@ coverage/*
<<<<<<< HEAD
.secret
/vendor
+.DS_Store
diff --git a/app/views/admin/runners/index.html.haml b/app/views/admin/runners/index.html.haml
index ea62b3d..ebe12d0 100644
--- a/app/views/admin/runners/index.html.haml
+++ b/app/views/admin/runners/index.html.haml
@@ -8,7 +8,7 @@
%p.lead
%span To register new runner you should use next token
- %code #{GitlabCi::RunnersToken}
+ %code #{GitlabCi::RUNNERS_TOKEN}
.bs-callout
%p
diff --git a/app/views/helps/show.html.haml b/app/views/helps/show.html.haml
index e37f565..996d16b 100644
--- a/app/views/helps/show.html.haml
+++ b/app/views/helps/show.html.haml
@@ -1,8 +1,8 @@
.jumbotron
%h2
GitLab CI
- %span= GitlabCi::Version
- %small= GitlabCi::Revision
+ %span= GitlabCi::VERSION
+ %small= GitlabCi::REVISION
%p
GitLab CI integrates with your GitLab installation and run tests for your projects.
%br
diff --git a/config/initializers/2_app.rb b/config/initializers/2_app.rb
index 22a95c9..8730519 100644
--- a/config/initializers/2_app.rb
+++ b/config/initializers/2_app.rb
@@ -1,7 +1,7 @@
module GitlabCi
- Version = File.read(Rails.root.join("VERSION"))
- Revision = `git log --pretty=format:'%h' -n 1`
- RunnersToken = SecureRandom.hex(10)
+ VERSION = File.read(Rails.root.join("VERSION")).strip
+ REVISION = `git log --pretty=format:'%h' -n 1`
+ RUNNERS_TOKEN = SecureRandom.hex(10)
def self.config
Settings
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 28a3f2b..fb57938 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -22,7 +22,7 @@ module API
end
def authenticate_runners!
- forbidden! unless params[:token] == GitlabCi::RunnersToken
+ forbidden! unless params[:token] == GitlabCi::RUNNERS_TOKEN
end
def authenticate_runner!
diff --git a/spec/requests/runners_spec.rb b/spec/requests/runners_spec.rb
index dcbe0ff..a6b836a 100644
--- a/spec/requests/runners_spec.rb
+++ b/spec/requests/runners_spec.rb
@@ -40,7 +40,7 @@ describe API::API do
describe "POST /runners/register" do
it "should create a runner if token provided" do
- post api("/runners/register"), token: GitlabCi::RunnersToken, public_key: 'sha-rsa ....'
+ post api("/runners/register"), token: GitlabCi::RUNNERS_TOKEN, public_key: 'sha-rsa ....'
response.status.should == 201
end