Module: StupidPassword

Defined in:
lib/stupid_password.rb,
lib/stupid_password/version.rb

Defined Under Namespace

Modules: Base, Modifier Classes: Stupid

Constant Summary collapse

VERSION =
"0.0.1"

Instance Method Summary collapse

Instance Method Details

#is_stupid?(password = self) ⇒ Boolean

Returns:

  • (Boolean)


3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/stupid_password.rb', line 3

def is_stupid? password=self
  StupidPassword::Base.constants.each do |clazz_name|
    clazz = Base.const_get clazz_name
    clazz.guess password
  end

  #TODO check with all permutations of modifiers

  false # Probably not so stupid
rescue Stupid => guessed
  "Is that a #{guessed.message}?"
end