Skip to content
Browse files

Added some default words that the aspell en dictionaries seem to be m…

…issing
  • Loading branch information...
1 parent 032e185 commit 5be4781c8c17617830dfd2a9a7b1cd925920867e @drbrain drbrain committed Apr 5, 2012
Showing with 26 additions and 1 deletion.
  1. +18 −1 lib/rdoc/generator/spellcheck.rb
  2. +8 −0 test/test_rdoc_generator_spellcheck.rb
View
19 lib/rdoc/generator/spellcheck.rb
@@ -16,6 +16,19 @@ class RDoc::Generator::Spellcheck
VERSION = '1.0'
##
+ # A list of common words that aspell may not include, but are commonly used
+ # in ruby programs.
+ #--
+ # Please keep this list sorted in your pull requests
+
+ DEFAULT_WORDS = %w[
+ https
+ newb
+ sudo
+ validator
+ ]
+
+ ##
# OptionParser validator for Aspell language dictionaries
SpellLanguage = Object.new
@@ -180,8 +193,12 @@ def misspellings_for name, comment, location
# documentation tree to the session spelling dictionary.
def setup_dictionary
+ DEFAULT_WORDS.each do |word|
+ @spell.add_to_session word
+ end
+
RDoc::TopLevel.all_classes_and_modules.each do |mod|
- @spell.add_to_session mod.name
+ add_name mod.name
mod.each_include do |incl|
add_name incl.name
View
8 test/test_rdoc_generator_spellcheck.rb
@@ -292,6 +292,14 @@ def test_setup_dictionary_constant
assert @sc.spell.check('THINGUS'), 'THINGUS not added to wordlist'
end
+ def test_setup_dictionary_defaults
+ @sc.setup_dictionary
+
+ word = RDoc::Generator::Spellcheck::DEFAULT_WORDS.first
+
+ assert @sc.spell.check(word), "#{word} not added to wordlist"
+ end
+
def test_setup_dictionary_file
RDoc::TopLevel.new 'funkify_thingus.rb'

0 comments on commit 5be4781

Please sign in to comment.
Something went wrong with that request. Please try again.