lib/hasmenu/reporter.rb in hasmenu-0.1.6 vs lib/hasmenu/reporter.rb in hasmenu-0.1.7
- old
+ new
@@ -17,14 +17,19 @@
def get_folder(files)
files.map { |f| File.basename(File.dirname(f)) }
end
def load_data
- @yaml_chains = get_data "chains.yml", "uid"
- @yaml_restaurants = get_data "restaurants.yml", "uid"
- @restaurant_chains = get_data "restaurants.yml", "chain"
- @file_chains = get_folder Dir.glob("#{@location}/menu/chain/**/*.yml")
- @file_restaurants = get_folder Dir.glob("#{@location}/menu/restaurant/**/*.yml")
+ chains = File.join(@location, "data", "chains.yml")
+ restaurants = File.join(@location, "data", "restaurants.yml")
+ chain_menus = File.join(@location, "data", "menu", "chain", "**", "*.yml")
+ restaurant_menus = File.join(@location, "data", "menu", "restaurant", "**", "*.yml")
+
+ @yaml_chains = get_data chains, "uid"
+ @yaml_restaurants = get_data restaurants, "uid"
+ @restaurant_chains = get_data restaurants, "chain"
+ @file_chains = get_folder Dir.glob(chain_menus)
+ @file_restaurants = get_folder Dir.glob(restaurant_menus)
end
def report_chains
print_header "List of Chains"
print_report(@yaml_chains.sort)