cryptum.gemspec in cryptum-0.0.370 vs cryptum.gemspec in cryptum-0.0.372

- old
+ new

@@ -23,18 +23,17 @@ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } spec_tests = spec.files.grep(%r{^spec/}) cryptum_modules = spec.files.grep(%r{^lib/}) missing_rspec = false - cryptum_modules.each do |cryptum_path| - spec_test_for_mod = "#{File.dirname(cryptum_path)}/#{File.basename(cryptum_path).split('.').first}_spec.rb" + cryptum_modules.each do |mod_path| + spec_dirname_for_mod = "spec/#{File.dirname(mod_path)}" + spec_test_for_mod = "#{File.basename(mod_path).split('.').first}_spec.rb" + spec_path_for_mod = "#{spec_dirname_for_mod}/#{spec_test_for_mod}" + next unless spec_tests.grep(/#{spec_path_for_mod}/).empty? - next unless spec_tests.grep(/#{spec_test_for_mod}/).empty? - missing_rspec = true - cryptum_mod_dir = File.dirname(cryptum_path) - spec_test = "spec/#{cryptum_mod_dir}/#{spec_test_for_mod}" - error_msg = "ERROR: RSpec: #{spec_test} missing for Cryptum Module: #{cryptum_path}" + error_msg = "ERROR: No RSpec: #{spec_path_for_mod} for Cryptum Module: #{mod_path}" # Display error message in red (octal encoded ansi sequence) puts "\001\e[1m\002\001\e[31m\002#{error_msg}\001\e[0m\002" end raise if missing_rspec