Sha256: 18df49bff48f1df7bf90d7c37b2c6c34463dcb876ca74b2cdc06e09f0e2168ea

Contents?: true

Size: 463 Bytes

Versions: 15

Compression:

Stored size: 463 Bytes

Contents

class TerminalInputManager

    def get_validated(message)
        loop do
            print message.green
            user_input = STDIN.gets.chomp

            if yield(user_input)
                return user_input
            end
        end
    end

    def get(message)
        loop do
            print message.green
            user_input = STDIN.gets.chomp
            return user_input unless user_input.nil? || user_input.empty?
        end
    end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
solara-0.7.4 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.7.3 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.7.2 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.7.1 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.7.0 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.6.0 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.5.0 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.4.0 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.3.0 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.2.4 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.2.3 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.2.2 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.2.1 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.2.0 solara/lib/core/scripts/terminal_input_manager.rb
solara-0.1.0 solara/lib/core/scripts/terminal_input_manager.rb