Sha256: 9f5387604017195e6ba67293e35d568f76b898ebba88618308950d055ed512ec

Contents?: true

Size: 690 Bytes

Versions: 9

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true

module BootstrapLeather
  module Generators
    # Utilities for generators
    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

9 entries across 9 versions & 1 rubygems

Version Path
bootstrap_leather-0.10.13 lib/generators/bootstrap_leather/utils.rb
bootstrap_leather-0.10.11 lib/generators/bootstrap_leather/utils.rb
bootstrap_leather-0.10.10 lib/generators/bootstrap_leather/utils.rb
bootstrap_leather-0.10.9 lib/generators/bootstrap_leather/utils.rb
bootstrap_leather-0.10.8 lib/generators/bootstrap_leather/utils.rb
bootstrap_leather-0.10.7 lib/generators/bootstrap_leather/utils.rb
bootstrap_leather-0.10.6 lib/generators/bootstrap_leather/utils.rb
bootstrap_leather-0.10.5 lib/generators/bootstrap_leather/utils.rb
bootstrap_leather-0.10.4 lib/generators/bootstrap_leather/utils.rb