Skip to content

Commit

Permalink
Merge pull request #3 from nebulab/dp/support-subdirectories
Browse files Browse the repository at this point in the history
Add subdirectories support
  • Loading branch information
DanielePalombo committed Apr 17, 2023
2 parents 435ee4e + 13fa693 commit 315c718
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/tasks/deprecations/combine.rake
Expand Up @@ -7,9 +7,10 @@ namespace :deprecations do
task :combine, [:matrix_folder, :matrix_filename] do |_t, args|
matrix_folder = args[:matrix_folder].to_s

combined_matrix = Dir.entries(matrix_folder).select { |f| !f.start_with?('.') }.inject({}) do |temp_matrix, file_name|
yaml_files = Dir.glob("#{matrix_folder}/**/*.yml").reject { |f| File.directory?(f) }
combined_matrix = yaml_files.inject({}) do |temp_matrix, file_name|
begin
matrix = YAML.load_file("#{matrix_folder}/#{file_name}")
matrix = YAML.load_file(file_name)

temp_matrix.merge(matrix) do |file, oldval, newval|
oldval.merge(newval) do |line, old_deprecation, new_deprecation|
Expand Down

0 comments on commit 315c718

Please sign in to comment.