sambot 0.1.130 → 0.1.131

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f417d900528b581f8042ea65940b1dfef9618d2
4
- data.tar.gz: c00d8d29969bf49566baee2af586f47b692fc4c7
3
+ metadata.gz: de423259030fee9c9401e242a3c386b2274cba44
4
+ data.tar.gz: dd369f17c622c893738e54bbd80db09bb5f143fe
5
5
  SHA512:
6
- metadata.gz: c64393f70886ca30650b72451fdcfb120256f44e5a2676095c59076ab90d01a7f33886f49d34f820382fe9282fc502db9bee2b3ae6197146f121596ab9368ca8
7
- data.tar.gz: ed3ed704bfd4a3a41fc57ab3cdc312a7879ec5d1a0ec5b40f0e42f7cb0d89da1015c05d867caa4e9d91ceb879cb064af61345e2c81be29a11f5917752e00f0ad
6
+ metadata.gz: 1fa889e9fca672d6cbdb6539b8e0b90f418a0392185e0b59870ddc5a15aafc070996636d9a1d736b282c0f58850908a199d89c0c637f78f3303eff16aa4e8edd
7
+ data.tar.gz: abb70a788ba8cb96fe5ac1706f92e5c0dd6eb122d28099eb5c057aeb20aa2d76f32b4577fddb039d3e8ebb65626f7fb9bc3f5414c3abaae45e54b5c8dbdc6207
@@ -32,7 +32,7 @@ module Sambot
32
32
  class << self
33
33
 
34
34
  def build(config)
35
- Generator.from_templates(config['platforms'], ESSENTIAL_FILES, GENERATED_FILES)
35
+ Generator.from_templates(config, ESSENTIAL_FILES, GENERATED_FILES)
36
36
  Kitchen.setup(config)
37
37
  Metadata.generate(config)
38
38
  Hooks.copy()
@@ -4,15 +4,28 @@ module Sambot
4
4
  module Chef
5
5
  class Generator
6
6
 
7
- def self.from_templates(platforms, cookbook_essentials, cookbook_generated_files)
7
+ def self.from_templates(config, cookbook_essentials, cookbook_generated_files)
8
+ platforms = config['platforms']
8
9
  cookbook_essentials.each { |path| exists!(path) } if cookbook_essentials
9
10
  cookbook_generated_files.each do |template_name, opts|
10
11
  generate_from_template(template_name.to_s, opts, platforms)
11
12
  end
13
+ override_bootstrap_mechanism(config['bootstrap']) if config['bootstrap']
12
14
  end
13
15
 
14
16
  private
15
17
 
18
+ def self.override_bootstrap_mechanism(config)
19
+ if config['centos']
20
+ raise ApplicationError, "The file #{config['centos']} does not exist" unless File.exist?(config['centos'])
21
+ FileUtils.mv(config['centos'], 'bootstrap.sh')
22
+ end
23
+ if config['windows']
24
+ raise ApplicationError, "The file #{config['centos']} does not exist" unless File.exist?(config['windows'])
25
+ FileUtils.mv(config['windows'], 'bootstrap.ps1')
26
+ end
27
+ end
28
+
16
29
  def self.exists!(path)
17
30
  return if File.exist?(path) || Dir.exist?(path)
18
31
  raise ApplicationError, "The file or directory #{path} was not found in the current directory."
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Sambot
4
- VERSION = '0.1.130'.freeze
4
+ VERSION = '0.1.131'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sambot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.130
4
+ version: 0.1.131
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier Kouame
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-03 00:00:00.000000000 Z
11
+ date: 2017-07-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor-hollaback