bin/apstrings in apstrings-0.2.7 vs bin/apstrings in apstrings-0.3.0

- old
+ new

@@ -1,9 +1,13 @@ #!/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. + # (If you use this, don't forget to add pry to your Gemfile!) # require "pry" # Pry.start @@ -19,19 +23,25 @@ files_to_validate["files"] << File.expand_path(file) end } success = true +any_file = false files_to_validate["files"].each { |file| + any_file = true if !Apstrings::validate(file,files_to_validate["master"]) success = false end } -if success - p "Success, well done!" +if success && any_file + Apstrings::log_info("Success, well done! 🍻 🍻") exit(0) +else if !any_file + Apstrings::log_info("Nothing to validate.") + exit(0) else - p "Failed: You'd better know what r u doing..." + Apstrings::log_error("Failed: You'd better know what u r doing...") exit(1) +end end \ No newline at end of file