bin/sale in sales-0.0.4 vs bin/sale in sales-0.1.0
- old
+ new
@@ -30,11 +30,11 @@
get and present the last daily summary report
#{'sale'.green}
get and present a daily summary report for a date
- #{'sale.rb YYYYMMDD'.green}
+ #{'sale YYYYMMDD'.green}
EGASU
#require all dependent gems
require 'rubygems'
@@ -351,10 +351,10 @@
#-----------------------------------------------------------------------------------------------------------------------------
#compute alltime stats for daily or weekly reports
#collect the report files
dir_filter = ARGV[0] == "daily" ? "D" : "W" #the daily or the weekly files
reports = Dir["S_#{dir_filter}_*.txt"].uniq.compact
- if reports.empty?
+ if reports.empty? || reports.size<2
#no reports, try downloding them first
puts "\nDownloading reports first...".red
method("get_#{ARGV[0]}_reports".to_sym).call #dynamically instantiating a method and calling on it
reports = Dir["S_#{dir_filter}_*.txt"].uniq.compact #reload reports list
end