lib/whatsup_github/runner.rb in whatsup_github-0.3.1 vs lib/whatsup_github/runner.rb in whatsup_github-0.4.0
- old
+ new
@@ -1,27 +1,29 @@
+# frozen_string_literal: true
+
require 'fileutils'
require_relative 'generator'
-require_relative 'config-reader'
-require_relative 'yaml-formatter'
+require_relative 'config_reader'
+require_relative 'yaml_formatter'
require_relative 'table'
module WhatsupGithub
class Runner
-
def initialize(date)
@generator = Generator.new date
@config = Config.instance
@content ||= @generator.content
end
def run
format = @config.output_format
raise 'Cannot find "output_format" in config.yml' unless format
+
table if format.include? 'markdown'
data if format.include? 'yaml'
end
- def write_results file, formatter
+ def write_results(file, formatter)
formatted_content = @generator.run formatter, @content
check_dir_at File.dirname file
File.write file, formatted_content
puts "Done!\nOpen \"#{file}\" to see the result."
end