Skip to content

Instantly share code, notes, and snippets.

@bogdan
Created April 10, 2018 11:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bogdan/7013a6a439c8977e4c726a8f2e5b4f46 to your computer and use it in GitHub Desktop.
Save bogdan/7013a6a439c8977e4c726a8f2e5b4f46 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
new_words = ARGV
file_name = File.dirname(__FILE__) + "/../.pronto_spell.pws"
lines = File.read(file_name)
words = lines.split("\n")
header = words.shift
new_words.each do |word|
unless words.include?(word)
words << word
end
end
words.compact!
words.sort!
words.unshift(header)
File.write(file_name, words.join("\n") + "\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment