bin/apstrings in apstrings-0.3.6 vs bin/apstrings in apstrings-0.3.7

- old
+ new

@@ -1,8 +1,6 @@ #!/usr/bin/env ruby - -require "bundler/setup" require "apstrings" # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. @@ -10,12 +8,14 @@ # require "pry" # Pry.start $ROOT = ARGV[0] - +$VALID = true +$SUMMARYS = [] Dir::chdir($ROOT) +Apstrings::log_info("\n----------------\n Entering #{$ROOT}...") files_to_validate = {"master"=> nil,"files" => []} Dir.glob(File.join("**", "*.strings")) { |file| p File.basename(file) if File.basename(file) == "zh-Hans.strings" files_to_validate["master"] = File.expand_path(file) @@ -26,22 +26,24 @@ success = true any_file = false files_to_validate["files"].each { |file| any_file = true - if !Apstrings::validate(file,files_to_validate["master"]) + $VALID,summary = Apstrings::validate(file,files_to_validate["master"]) + $SUMMARYS << summary + if !$VALID success = false end } if success && any_file - Apstrings::log_info("Well done! 🍻 🍻\n") + Apstrings::log_info("Validate passed. Well done! 🍻 🍻 \n ----------------") exit(0) else if !any_file - Apstrings::log_info("Nothing to validate.") - exit(0) -else - Apstrings::log_error("Validate failed, See above for details\n") - exit(1) -end + Apstrings::log_info("Nothing to validate. \n ----------------") + exit(0) + else + Apstrings::log_error("Validate failed, See above for details.\n ----------------") + exit(1) + end end \ No newline at end of file