config_templates 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/autoload.rb +1 -0
- data/lib/config_templates/config.rb +10 -1
- data/lib/config_templates/repositories/settings.rb +1 -1
- data/lib/config_templates/version.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c1b9ff19c62bfefb3c61fd89ef48b2ff3a5feb6
|
4
|
+
data.tar.gz: 7725b602720e3a34611bdc7b586c65951a6afa04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94394e6eacd587051745ebd22e0c565f0239e00c2061b419e686c9723ae63f1e39db6f858476b01bed3ac7adaad3337827b97b7757917d14549ab0c7c80604e4
|
7
|
+
data.tar.gz: a93028e855f6bb058aec60e4b23da977ad106926eda030b531d35dbef45a76d31a423d069b74cb5f92a5285d7fa0f305e7d56a185d73e161f1d7ba062936c207
|
data/lib/autoload.rb
CHANGED
@@ -2,7 +2,8 @@ module ConfigTemplates
|
|
2
2
|
class Config
|
3
3
|
attr_accessor :templates_path, :destination_path
|
4
4
|
attr_accessor :settings_path, :settings_file_basename
|
5
|
-
attr_accessor :
|
5
|
+
attr_accessor :stages
|
6
|
+
attr_reader :stage
|
6
7
|
|
7
8
|
def initialize
|
8
9
|
@stages = []
|
@@ -11,6 +12,14 @@ module ConfigTemplates
|
|
11
12
|
@validators = ::ConfigTemplates::Repositories::Validators.new
|
12
13
|
end
|
13
14
|
|
15
|
+
def stage=(stage)
|
16
|
+
if stages.include? stage
|
17
|
+
@stage = stage
|
18
|
+
else
|
19
|
+
raise ConfigTemplates::Errors::StageNotFound, stage.to_s
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
14
23
|
def output(name)
|
15
24
|
@outputs.find_by_name name
|
16
25
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -7,8 +7,8 @@ RSpec.configure do |spec|
|
|
7
7
|
config.destination_path = 'spec/fixtures/dest'
|
8
8
|
config.settings_path = 'spec/fixtures/settings'
|
9
9
|
config.settings_file_basename = 'settings'
|
10
|
-
config.stage = :production
|
11
10
|
config.stages = %i[production prerel staging]
|
11
|
+
config.stage = :production
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|