kameleon-builder 2.8.1 → 2.8.2

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: 7a1cedb45115be7f297f4fa1ce91317044f471e0
4
- data.tar.gz: bff616a9050536f66d9fbd8da0a4878e32906b04
3
+ metadata.gz: def867b869a1c6ed76375aebff04d4853b6c2f82
4
+ data.tar.gz: 3ee480f10fb325ed7a38ba4435276b63c5bba5d1
5
5
  SHA512:
6
- metadata.gz: 52bcf2e7b9a5db08402d5d33d89f866f47511b459629f77afe3650aa6235b6989cc434cf5425a8f8af3a9d98f8b78f8455c04d9f470b7b8be9d285a4cd3d2e61
7
- data.tar.gz: 1cacc98e8c4cd83c01574578e168add311746008a883ec2cd383fdf26f58944cb8247487684cd27d23159a20939e8e0ecbc4480a328b8f739162dba5a774bd06
6
+ metadata.gz: 259d3652480915e9bf0de35d7ee7f64f98a398076656e349a16a83474d11b89d1e484fafd73be2cebc73ceedba92362567f5ed301c1c2f11c2df7c35fab9046e
7
+ data.tar.gz: 92a70030504ab7e5156d40058c39b3c9cbed9e86b6a849aeeba077d0e73e4e4decf5808568ce0b204488de1cf9a1f14da5c67971c849774f80d82e567698c593
data/.bumpversion.cfg CHANGED
@@ -1,7 +1,7 @@
1
1
  [bumpversion]
2
2
  commit = True
3
3
  tag = True
4
- current_version = 2.8.1
4
+ current_version = 2.8.2
5
5
  parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+))?
6
6
  serialize =
7
7
  {major}.{minor}.{patch}.{release}
data/CHANGES CHANGED
@@ -1,6 +1,13 @@
1
1
  Kameleon CHANGELOG
2
2
  ==================
3
3
 
4
+ Version 2.8.2
5
+ -------------
6
+
7
+ Released on September 06th 2016
8
+
9
+ - Make kameleon new and template import works
10
+
4
11
  Version 2.8.1
5
12
  -------------
6
13
 
data/erb/extend.erb CHANGED
@@ -5,13 +5,21 @@
5
5
  # DESCRIPTION: <MY RECIPE DESCRIPTION>
6
6
  #
7
7
  #==============================================================================
8
-
9
8
  ---
10
9
  extend: <%= tpl.relative_path_from_recipe(recipe_path) %>
11
10
 
12
11
  global:
13
- # You can see the base template `<%= tpl.relative_path_from_recipe(recipe_path) %>` to know the
14
- # variables that you can override
12
+ <% if Kameleon.env.global["backend"] %>
13
+ # This is the backend you have imported to switch to an other backend BCKD do:
14
+ #
15
+ # kameleon template import <%= tpl.relative_path_from_recipe(recipe_path) %> --global backend:BCKB
16
+ #
17
+ # and update the following variable.
18
+ backend: <%= Kameleon.env.global["backend"] %>
19
+ <% end %>
20
+ # To see the variables that you can override, use the following command:
21
+ #
22
+ # kameleon info <%= recipe_name %>
15
23
 
16
24
  bootstrap:
17
25
  - "@base"
data/lib/kameleon/cli.rb CHANGED
@@ -33,6 +33,7 @@ module Kameleon
33
33
  map %w(ls) => :list
34
34
  end
35
35
 
36
+
36
37
  class Template < Thor
37
38
  include Thor::Actions
38
39
 
@@ -50,12 +51,19 @@ module Kameleon
50
51
  end
51
52
 
52
53
  desc "import [TEMPLATE_NAME]", "Imports the given template"
54
+ method_option :global, :type => :hash ,
55
+ :default => {}, :aliases => "-g",
56
+ :desc => "Set custom global variables."
53
57
  def import(template_name)
54
58
  Kameleon.env.root_dir = Kameleon.env.repositories_path
55
59
  template_path = File.join(Kameleon.env.repositories_path, template_name)
56
60
  unless template_name.end_with? '.yaml'
57
61
  template_path = template_path + '.yaml'
58
62
  end
63
+ # Manage global as it is not passed to env by default
64
+ if options[:global]
65
+ Kameleon.env.global.merge!(options[:global])
66
+ end
59
67
  begin
60
68
  tpl = RecipeTemplate.new(template_path)
61
69
  tpl.resolve! :strict => false
@@ -83,6 +91,10 @@ module Kameleon
83
91
  unless template_name.end_with? '.yaml'
84
92
  template_path = template_path + '.yaml'
85
93
  end
94
+ # Manage global as it is not passed to env by default
95
+ if options[:global]
96
+ Kameleon.env.global.merge!(options[:global])
97
+ end
86
98
  tpl = RecipeTemplate.new(template_path)
87
99
  tpl.resolve! :strict => false
88
100
  tpl.display_info(false)
@@ -128,31 +140,36 @@ module Kameleon
128
140
  map %w(ls) => :list
129
141
 
130
142
  desc "new [RECIPE_PATH] [TEMPLATE_NAME]", "Creates a new recipe"
131
- def new(recipe_path, template_name)
143
+ method_option :global, :type => :hash ,
144
+ :default => {}, :aliases => "-g",
145
+ :desc => "Set custom global variables."
146
+ def new(recipe_name, template_name)
132
147
  Kameleon.env.root_dir = Kameleon.env.repositories_path
133
148
  unless template_name.end_with? '.yaml'
134
149
  template_name = template_name + '.yaml'
135
150
  end
136
151
 
137
- unless recipe_path.end_with? '.yaml'
138
- recipe_path = recipe_path + '.yaml'
152
+ unless recipe_name.end_with? '.yaml'
153
+ recipe_name = recipe_name + '.yaml'
139
154
  end
140
155
 
141
- if recipe_path == template_name
156
+ if recipe_name == template_name
142
157
  fail RecipeError, "Recipe path should be different from template name"
143
158
  end
144
159
 
145
160
  template_path = File.join(Kameleon.env.repositories_path, template_name)
146
161
 
147
- recipe_path = Pathname.new(Kameleon.env.workspace).join(recipe_path).to_s
162
+ recipe_path = Pathname.new(Kameleon.env.workspace).join(recipe_name).to_s
148
163
 
149
164
  begin
150
165
  tpl = Kameleon::RecipeTemplate.new(template_path)
151
166
  tpl.resolve! :strict => false
152
167
  rescue
153
- raise TemplateNotFound, "Template '#{template_name}' not found. " \
154
- "To see all templates, run the command "\
155
- "`kameleon template list`"
168
+ raise if Kameleon.ui.level("verbose")
169
+ raise TemplateNotFound, "Template '#{template_name}' invalid (try" \
170
+ " --verbose) or not found. To see all templates, run the command "\
171
+ "`kameleon template list`"
172
+
156
173
  else
157
174
  tpl.all_files.each do |path|
158
175
  relative_path = path.relative_path_from(Kameleon.env.repositories_path)
data/version.txt CHANGED
@@ -1 +1 @@
1
- 2.8.1
1
+ 2.8.2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kameleon-builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salem Harrache