Sha256: 3213a278937d818dabcb835da65f2a37fe9f0cd3acc5a3679cd9095cff1e03b4

Contents?: true

Size: 675 Bytes

Versions: 21

Compression:

Stored size: 675 Bytes

Contents

# frozen_string_literal: true

module PaidUp
  module Generators
    # Generator Utilities
    module Utils
      def output(output, color = :green)
        say("           -  #{output}", color)
      end

      def ask_for(wording, default_value = nil, override_if_present_value = nil)
        if override_if_present_value.present?
          display(
            "Using [#{override_if_present_value}] for question '#{wording}'"
          ) && override_if_present_value
        else
          ask(
            "           ?  #{wording} Press <enter> for [#{default_value}] >",
            :yellow
          ).presence || default_value
        end
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
paid_up-0.13.22 lib/generators/paid_up/utils.rb
paid_up-0.13.21 lib/generators/paid_up/utils.rb
paid_up-0.13.17 lib/generators/paid_up/utils.rb
paid_up-0.13.16 lib/generators/paid_up/utils.rb
paid_up-0.13.14 lib/generators/paid_up/utils.rb
paid_up-0.13.13 lib/generators/paid_up/utils.rb
paid_up-0.13.12 lib/generators/paid_up/utils.rb
paid_up-0.13.11 lib/generators/paid_up/utils.rb
paid_up-0.13.10 lib/generators/paid_up/utils.rb
paid_up-0.13.9 lib/generators/paid_up/utils.rb
paid_up-0.13.8 lib/generators/paid_up/utils.rb
paid_up-0.13.7 lib/generators/paid_up/utils.rb
paid_up-0.13.6 lib/generators/paid_up/utils.rb
paid_up-0.13.5 lib/generators/paid_up/utils.rb
paid_up-0.13.4 lib/generators/paid_up/utils.rb
paid_up-0.13.3 lib/generators/paid_up/utils.rb
paid_up-0.13.2 lib/generators/paid_up/utils.rb
paid_up-0.13.1 lib/generators/paid_up/utils.rb
paid_up-0.13.0 lib/generators/paid_up/utils.rb
paid_up-0.12.4 lib/generators/paid_up/utils.rb