Permalink
Browse files

Uppercase constants

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
  • Loading branch information...
1 parent a25ec06 commit b34fca92cde3e90ecd883ec3549ea64dc7e5ba80 @dzaporozhets dzaporozhets committed Jan 30, 2014
View
@@ -16,3 +16,4 @@ coverage/*
<<<<<<< HEAD
.secret
/vendor
+.DS_Store
@@ -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
@@ -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
@@ -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
View
@@ -22,7 +22,7 @@ def authenticate!
end
def authenticate_runners!
- forbidden! unless params[:token] == GitlabCi::RunnersToken
+ forbidden! unless params[:token] == GitlabCi::RUNNERS_TOKEN
end
def authenticate_runner!
@@ -40,7 +40,7 @@
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

0 comments on commit b34fca9

Please sign in to comment.