Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-02-02 16:35:09 +0300
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-02-02 16:35:09 +0300
commit0a4db90d36870211df2dc1e606b01602666706c8 (patch)
tree69f5758ac0bb01051380159fa53c6f30b70eaf76
parentc76e6b982bb171f24592b62264b28eb3fbe1bafc (diff)
Use begin/end instead of defined?
-rw-r--r--app/models/ci/commit.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/ci/commit.rb b/app/models/ci/commit.rb
index 96786ac4573..ecbd2078b1d 100644
--- a/app/models/ci/commit.rb
+++ b/app/models/ci/commit.rb
@@ -205,11 +205,11 @@ module Ci
end
def ci_yaml_file
- return @ci_yaml_file if defined?(@ci_yaml_file)
-
- blob = project.repository.blob_at(sha, '.gitlab-ci.yml')
- blob.load_all_data!(project.repository)
- @ci_yaml_file = blob.data
+ @ci_yaml_file ||= begin
+ blob = project.repository.blob_at(sha, '.gitlab-ci.yml')
+ blob.load_all_data!(project.repository)
+ blob.data
+ end
rescue
nil
end