Sha256: f354ba31d0ff93822e71388cb60065eff014ad71f486b18d2a2b65d75234e540

Contents?: true

Size: 664 Bytes

Versions: 12

Compression:

Stored size: 664 Bytes

Contents

require "vmc/cli"

module VMC
  module User
    class Base < CLI
      def precondition
        check_logged_in
      end

      private

      def validate_password!(password)
        validate_password_verified!(password)
        validate_password_strength!(password)
      end

      def validate_password_verified!(password)
        fail "Passwords do not match." unless force? || password == input[:verify]
      end

      def validate_password_strength!(password)
        strength = client.base.password_score(password)
        msg = "Your password strength is: #{strength}"
        fail msg if strength == :weak
        line msg
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
static-1.0.3 vendor/vmc-0.5.0/lib/vmc/cli/user/base.rb
vmc-0.5.1.rc6 lib/vmc/cli/user/base.rb
static-1.0.1 vendor/vmc-0.5.0/lib/vmc/cli/user/base.rb
vmc-0.5.1.rc5 lib/vmc/cli/user/base.rb
vmc-0.5.1.rc4 lib/vmc/cli/user/base.rb
vmc-0.5.1.rc3 lib/vmc/cli/user/base.rb
vmc-0.5.1.rc2 lib/vmc/cli/user/base.rb
vmc-0.5.1.rc1 lib/vmc/cli/user/base.rb
vmc-0.5.0 lib/vmc/cli/user/base.rb
vmc-0.5.0.rc4 lib/vmc/cli/user/base.rb
vmc-0.5.0.rc3 lib/vmc/cli/user/base.rb
vmc-0.5.0.rc2 lib/vmc/cli/user/base.rb