summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-06 08:20:55 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-06-06 08:20:55 +0200
commit23030439c2cf3b3ad48099eb9a4371b8bf55066f (patch)
tree0b19d3c51e86789d22c7aff02f0c463609f88edb /lib
parentd2b708ac43b0810ea2ce4de196ce46692e536027 (diff)
downloadgitlab-ce-23030439c2cf3b3ad48099eb9a4371b8bf55066f.tar.gz
Rename class that loads CI configuration to Loader
Diffstat (limited to 'lib')
-rw-r--r--lib/ci/gitlab_ci_yaml_processor.rb2
-rw-r--r--lib/gitlab/ci/config.rb10
-rw-r--r--lib/gitlab/ci/config/loader.rb (renamed from lib/gitlab/ci/config/parser.rb)4
3 files changed, 8 insertions, 8 deletions
diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb
index 9a60c5ab842..46a923161c8 100644
--- a/lib/ci/gitlab_ci_yaml_processor.rb
+++ b/lib/ci/gitlab_ci_yaml_processor.rb
@@ -18,7 +18,7 @@ module Ci
initial_parsing
validate!
- rescue Gitlab::Ci::Config::ParserError => e
+ rescue Gitlab::Ci::Config::LoaderError => e
raise ValidationError, e.message
end
diff --git a/lib/gitlab/ci/config.rb b/lib/gitlab/ci/config.rb
index 0baefa70f61..5fc4894311f 100644
--- a/lib/gitlab/ci/config.rb
+++ b/lib/gitlab/ci/config.rb
@@ -1,16 +1,16 @@
module Gitlab
module Ci
class Config
- class ParserError < StandardError; end
+ class LoaderError < StandardError; end
def initialize(config)
- parser = Parser.new(config)
+ loader = Loader.new(config)
- unless parser.valid?
- raise ParserError, 'Invalid configuration format!'
+ unless loader.valid?
+ raise LoaderError, 'Invalid configuration format!'
end
- @config = parser.parse
+ @config = loader.load
end
def to_hash
diff --git a/lib/gitlab/ci/config/parser.rb b/lib/gitlab/ci/config/loader.rb
index 6e1b7ec8267..ed9cc16702c 100644
--- a/lib/gitlab/ci/config/parser.rb
+++ b/lib/gitlab/ci/config/loader.rb
@@ -1,7 +1,7 @@
module Gitlab
module Ci
class Config
- class Parser
+ class Loader
class FormatError < StandardError; end
def initialize(config)
@@ -12,7 +12,7 @@ module Gitlab
@config.is_a?(Hash)
end
- def parse
+ def load
unless valid?
raise FormatError, 'Invalid configuration format'
end