Skip to content

Commit

Permalink
Updates for added RuboCop checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmorgan committed Sep 27, 2020
1 parent 248a743 commit 9c6fe65
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Metrics/AbcSize:
RSpec/MultipleExpectations:
Enabled: false

RSpec/MultipleMemoizedHelpers:
Max: 8

RSpec/ExampleLength:
Enabled: false

Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
language: ruby
os: osx
osx_image: xcode11
osx_image: xcode12
rvm:
- 2.6.3
- ruby-head
Expand Down
10 changes: 5 additions & 5 deletions lib/awskeyring/input.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require 'io/console'

# Awskeyring Module,
module Awskeyring
# Input methods for Awskeyring
Expand All @@ -15,18 +13,20 @@ def self.read_secret(prompt)
end

private_class_method def self.hide_input # rubocop:disable Metrics/MethodLength
require 'io/console'
password = +''
loop do
character = $stdin.getch
break unless character

if ["\n", "\r"].include? character
case character
when "\n", "\r"
puts ''
break
elsif ["\b", "\u007f"].include? character
when "\b", "\u007f"
password.chop!
print "\b\e[P"
elsif character == "\u0003"
when "\u0003"
exit 1
else
print '*'
Expand Down

0 comments on commit 9c6fe65

Please sign in to comment.