require 'pry'
require 'json'
require 'differ'
require 'levenshtein'
require 'erb'

require_relative 'summary'

require_relative 'utils'

require_relative 'related'
require_relative 'counters'
require_relative 'curator'
require_relative 'condense'
require_relative 'presenter'

title = ARGV[0].scan(/\/(\w+)_p/).flatten.first
  .gsub(/(.)([A-Z])/,'\1 \2').split(" ").map(&:capitalize).join(" ")
lines = File.open(ARGV[0]).readlines
topics = lines.first.split(",").map(&:strip)
points = lines[2..-1].map { |l| JSON.parse(l) }
summary = Summary.new(title, points, topics, 3)
summary.build

@title = title
@summary = summary
erb = ERB.new(File.open("template.html.erb").read, 0, '>')
html = erb.result binding
File.open(title.downcase + "_summary.html", "w").write(html)

File.open(title.downcase + "_summary.json", "w").write(summary.to_h.to_json)

require 'pry'
require 'json'
require 'differ'
require 'levenshtein'
require 'erb'

require_relative 'summary'

require_relative 'utils'

require_relative 'related'
require_relative 'counters'
require_relative 'curator'
require_relative 'condense'
require_relative 'presenter'

title = ARGV[0].scan(/\/(\w+)_p/).flatten.first
  .gsub(/(.)([A-Z])/,'\1 \2').split(" ").map(&:capitalize).join(" ")
lines = File.open(ARGV[0]).readlines
topics = lines.first.split(",").map(&:strip)
points = lines[2..-1].map { |l| JSON.parse(l) }
summary = Summary.new(title, points, topics, 3)
summary.build

@title = title
@summary = summary
erb = ERB.new(File.open("template.html.erb").read, 0, '>')
html = erb.result binding
File.open(title.downcase.gsub(/\W+/, "_") + "_summary.html", "w").write(html)

File.open(title.downcase.gsub(/\W+/, "_") + "_summary.json", "w").write(summary.to_h.to_json)

Correct naming of generated files
Correct naming of generated files

In order to make titles nicer in the summaries a space was added. This wasn't fixed in the file names that needed to be parameterized.
