class WhatsupGithub::Runner
Public Class Methods
new(date)
click to toggle source
# File lib/whatsup_github/runner.rb, line 11 def initialize(date) @generator = Generator.new date @config = Config.instance @content ||= @generator.content end
Public Instance Methods
check_dir_at(filepath)
click to toggle source
# File lib/whatsup_github/runner.rb, line 32 def check_dir_at(filepath) FileUtils.mkdir_p filepath unless Dir.exist? filepath end
data()
click to toggle source
# File lib/whatsup_github/runner.rb, line 40 def data write_results 'tmp/whats-new.yml', YAMLFormatter.new end
run()
click to toggle source
# File lib/whatsup_github/runner.rb, line 17 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
table()
click to toggle source
# File lib/whatsup_github/runner.rb, line 36 def table write_results 'tmp/whats-new-on-devdocs.md', Table.new end
write_results(file, formatter)
click to toggle source
# File lib/whatsup_github/runner.rb, line 25 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