kameleon-builder 2.10.6 → 2.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.bumpversion.cfg +1 -1
- data/CHANGES +7 -0
- data/lib/kameleon/cli.rb +2 -2
- data/lib/kameleon/utils.rb +24 -14
- data/lib/kameleon/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa12710602f297326fe8253eab48928c5e527a07bdc91b3f6686375faa83c8c5
|
4
|
+
data.tar.gz: 306b743b116a9a53801208368f54a2e71bcf2b1bdb55f17d7549eac003403e0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a97ddc0ccb77269a2084ad51022b66393300404cd220d1eff6c51e85d2de8f33122d8d44d308c8c27ff4bcda6122076d5ed6e269ca01c2af51059a45eb4aa31b
|
7
|
+
data.tar.gz: 5290bd82ceb90cabe2ee472485feb652c6b653638b45bff99e1869b56c86edf6845241082ea2561a0b33ea6ce52e2130d775dbcf59ec673e749cdedb1fb4612a
|
data/.bumpversion.cfg
CHANGED
data/CHANGES
CHANGED
data/lib/kameleon/cli.rb
CHANGED
@@ -60,7 +60,7 @@ module Kameleon
|
|
60
60
|
method_option :progress, :type => :boolean, :default => true,
|
61
61
|
:desc => "Show progress bar while resolving templates",
|
62
62
|
:aliases => "-p"
|
63
|
-
method_option :filter, :type => :string, :default =>
|
63
|
+
method_option :filter, :type => :string, :default => nil,
|
64
64
|
:desc => "Filter templates with the given regexp",
|
65
65
|
:aliases => "-f"
|
66
66
|
def list
|
@@ -175,7 +175,7 @@ module Kameleon
|
|
175
175
|
method_option :progress, :type => :boolean, :default => false,
|
176
176
|
:desc => "Show progress bar while resolving recipes",
|
177
177
|
:aliases => "-p"
|
178
|
-
method_option :filter, :type => :string, :default =>
|
178
|
+
method_option :filter, :type => :string, :default => nil,
|
179
179
|
:desc => "Filter recipes with the given regexp",
|
180
180
|
:aliases => "-f"
|
181
181
|
def list
|
data/lib/kameleon/utils.rb
CHANGED
@@ -125,11 +125,11 @@ module Kameleon
|
|
125
125
|
end
|
126
126
|
end
|
127
127
|
|
128
|
-
def self.list_recipes(recipes_path, filter
|
128
|
+
def self.list_recipes(recipes_path, filter, do_progressbar = false, is_repository = false, kwargs = {})
|
129
129
|
Kameleon.env.root_dir = recipes_path
|
130
130
|
catch_exception = kwargs.fetch(:catch_exception, true)
|
131
131
|
recipes_hash = []
|
132
|
-
recipes_files = get_recipes(recipes_path
|
132
|
+
recipes_files = get_recipes(recipes_path, filter)
|
133
133
|
if recipes_files.empty?
|
134
134
|
Kameleon.ui.shell.say " <None>", :cyan
|
135
135
|
return
|
@@ -162,7 +162,7 @@ module Kameleon
|
|
162
162
|
desc_width = (80 - name_width - 3) if desc_width < 0
|
163
163
|
end
|
164
164
|
repo_str_old = nil
|
165
|
-
recipes_hash.
|
165
|
+
recipes_hash.each do |r|
|
166
166
|
if is_repository
|
167
167
|
repo_str,recipe_dir_str,recipe_str = r["name"].match(%r{^([^/]+/)(.+/)?([^/]+)$}).to_a[1..3].map{|m| m.to_s}
|
168
168
|
else
|
@@ -184,18 +184,28 @@ module Kameleon
|
|
184
184
|
end
|
185
185
|
end
|
186
186
|
|
187
|
-
def self.get_recipes(path)
|
188
|
-
path
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
187
|
+
def self.get_recipes(path, filter = nil, base = nil)
|
188
|
+
base = path if base.nil?
|
189
|
+
if filter.nil?
|
190
|
+
begin
|
191
|
+
filter = File.read(File.join(path, "/.filter")).chomp
|
192
|
+
Kameleon.ui.verbose("Found filter #{filter} in #{path}")
|
193
|
+
base = path
|
194
|
+
rescue
|
195
|
+
end
|
196
|
+
end
|
197
|
+
recipes = path.children.select{|child| child.file? and child.extname == ".yaml"}.map do |child|
|
198
|
+
recipe = child.to_s.gsub(base.to_s + '/', '').chomp('.yaml')
|
199
|
+
if filter.nil? or Regexp.new(filter).match(recipe)
|
200
|
+
child
|
201
|
+
else
|
202
|
+
Kameleon.ui.verbose("Filters out #{recipe}, does not match #{filter}")
|
203
|
+
nil
|
197
204
|
end
|
198
|
-
end.select { |x| x }.flatten(1)
|
205
|
+
end.select { |x| x }.flatten(1).sort{|a,b| a.to_s <=> b.to_s}
|
206
|
+
recipes + path.children.select{|child| child.directory? and child.basename.to_s != "steps" and child.basename.to_s != ".steps"}.sort{|a,b| a.to_s <=> b.to_s}.map do |child|
|
207
|
+
get_recipes(child, filter, base)
|
208
|
+
end.flatten(1)
|
199
209
|
end
|
200
210
|
|
201
211
|
def self.which(cmd)
|
data/lib/kameleon/version.rb
CHANGED
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.10.
|
4
|
+
version: 2.10.7
|
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: 2021-
|
15
|
+
date: 2021-12-07 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: childprocess
|