kameleon-builder 2.3.2 → 2.3.3

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: 3502f7bd5d33a589f771b80c5e3be99c8c80a800
4
- data.tar.gz: 39aab439f0edd4f124ed6497f7bc924b0dfb41a3
3
+ metadata.gz: 1f207b02d46c496660b255e40159798760304278
4
+ data.tar.gz: 7f7833890e5fe3a60bf922b99a5e84603cf34ac9
5
5
  SHA512:
6
- metadata.gz: 4777200f4ef5b2ccae8afc2cb0f5d5d7017921954a204bda4718cc3722424eb53f00fddfc9b8a96bab45cf886a388cb574a48747669d77d23c253b34b6cde802
7
- data.tar.gz: 8eb860cbf58b0f43622b26073e0151bab552b0726a25992636839ba42bf3cd6f7a52a6212e208dbac9780cd7b8091c161ec2bf761dd4a6a0585fdb0c331903c9
6
+ metadata.gz: ad4db58b04ddcd23868e650712603be2345237278b75698062de0c146c3cf54800bb92d97f40b5f71329adba9ad8bc00c26c3fa10ad53df372ab17d42f8df752
7
+ data.tar.gz: 46e1f4e26176f3658840a46969b78de8ff2646ce595cf937f90296b939d61f4c6ee908edeb9d8531da5f3439ac3efb6514b4eb10d953a11c292676f0bc7d7a7f
data/CHANGELOG.rst CHANGED
@@ -1,6 +1,14 @@
1
1
  Kameleon CHANGELOG
2
2
  ==================
3
3
 
4
+ version 2.3.3
5
+ -------------
6
+
7
+ Released on Nov 26th 2014
8
+
9
+ - Minor improvements
10
+ - Fixed issue with listing the templates avaiable in a repository
11
+
4
12
  version 2.3.2
5
13
  -------------
6
14
 
@@ -22,6 +22,7 @@ module Kameleon
22
22
  :build_path => Pathname.new(build_path),
23
23
  :cache_path => Pathname.new(cache_path),
24
24
  :repositories_path => Pathname.new(repositories_path),
25
+ :root_dir => Pathname.new(workspace),
25
26
  }
26
27
  options = Kameleon.default_values.merge(options).merge(env_options)
27
28
  Kameleon.ui.debug("Environment initialized (#{self})")
@@ -38,13 +38,31 @@ module Kameleon
38
38
  @files = []
39
39
  Kameleon.ui.debug("Initialize new recipe (#{path})")
40
40
  @base_recipes_files = [@path]
41
- @steps_dirs = [
42
- File.expand_path(File.join(Kameleon.env.workspace, 'steps')),
43
- File.expand_path(File.join(Kameleon.env.workspace, '.steps')),
44
- ]
41
+ @steps_dirs = []
42
+ steps_dir = get_default_steps_dir
43
+ @steps_dirs.push(steps_dir) unless steps_dir.nil?
45
44
  load! :strict => false
46
45
  end
47
46
 
47
+ def get_default_steps_dir
48
+ relative_path = @path.to_path.gsub(Kameleon.env.root_dir.to_path + '/', '')
49
+ last_dir = Kameleon.env.root_dir
50
+ subdirs = [last_dir]
51
+ relative_path.split("/")[0...-1].each do |p|
52
+ subdir = last_dir.join(p)
53
+ subdirs.push(subdir)
54
+ last_dir = subdir
55
+ end
56
+ steps_dirs = []
57
+ subdirs.reverse_each do |p|
58
+ steps_dirs.push(File.expand_path(File.join(p.to_path, 'steps')))
59
+ steps_dirs.push(File.expand_path(File.join(p.to_path, '.steps')))
60
+ end
61
+ steps_dirs.each do |p|
62
+ return p if File.exist? p
63
+ end
64
+ end
65
+
48
66
  def load!(kwargs = {})
49
67
  # Find recipe path
50
68
  Kameleon.ui.debug("Loading #{@path}")
@@ -61,8 +79,10 @@ module Kameleon
61
79
  # Where we can find steps
62
80
  @base_recipes_files.each do |recipe_path|
63
81
  dirname = File.dirname(recipe_path)
64
- @steps_dirs.push(File.expand_path(File.join(dirname, 'steps')))
65
- @steps_dirs.push(File.expand_path(File.join(dirname, '.steps')))
82
+ ['steps', '.steps'].each do |p|
83
+ dir = File.expand_path(File.join(dirname, p))
84
+ @steps_dirs.push(dir) if File.exists? dir
85
+ end
66
86
  end
67
87
  @steps_dirs.uniq!
68
88
 
@@ -86,7 +106,8 @@ module Kameleon
86
106
  [File.join(steps_dir, section.name, path),
87
107
  File.join(steps_dir, path)]
88
108
  end
89
- end.flatten
109
+ end.flatten.select { |x| File.exists? x }
110
+
90
111
  if yaml_recipe.key? section.name
91
112
  yaml_section = yaml_recipe.fetch(section.name)
92
113
  next unless yaml_section.kind_of? Array
@@ -584,6 +605,11 @@ module Kameleon
584
605
  end
585
606
 
586
607
  class RecipeTemplate < Recipe
608
+
609
+ def initialize(path, kwargs = {})
610
+ super(path, kwargs)
611
+ end
612
+
587
613
  def relative_path_from_recipe(recipe_path)
588
614
  recipe_path = Pathname.new(recipe_path)
589
615
  relative_path_tpl_repo = @path.relative_path_from(Kameleon.env.repositories_path)
@@ -53,6 +53,7 @@ module Kameleon
53
53
  end
54
54
 
55
55
  def self.list_recipes(repository_path, kwargs = {})
56
+ Kameleon.env.root_dir = repository_path
56
57
  catch_exception = kwargs.fetch(:catch_exception, true)
57
58
  recipes_hash = []
58
59
  recipes_files = get_recipes(repository_path)
data/version.txt CHANGED
@@ -1 +1 @@
1
- 2.3.2
1
+ 2.3.3
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.3.2
4
+ version: 2.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Salem Harrache
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2014-11-20 00:00:00.000000000 Z
15
+ date: 2014-11-26 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: childprocess