Sha256: 606f786bc92937c25de56214b844994e1b2a428ba61bcd8c10161b5e612ec62f

Contents?: true

Size: 653 Bytes

Versions: 12

Compression:

Stored size: 653 Bytes

Contents

# frozen_string_literal: true

module RailsAdmin
  module Generators
    module Utils
      module InstanceMethods
        def display(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
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rails_admin-3.2.1 lib/generators/rails_admin/utils.rb
rails_admin-3.2.0 lib/generators/rails_admin/utils.rb
rails_admin-3.2.0.rc lib/generators/rails_admin/utils.rb
rails_admin-3.2.0.beta lib/generators/rails_admin/utils.rb
rails_admin-3.1.4 lib/generators/rails_admin/utils.rb
rails_admin-3.1.3 lib/generators/rails_admin/utils.rb
rails_admin-3.1.2 lib/generators/rails_admin/utils.rb
rails_admin-3.1.1 lib/generators/rails_admin/utils.rb
rails_admin-3.1.0 lib/generators/rails_admin/utils.rb
rails_admin-3.1.0.rc2 lib/generators/rails_admin/utils.rb
rails_admin-3.1.0.rc lib/generators/rails_admin/utils.rb
rails_admin-3.1.0.beta lib/generators/rails_admin/utils.rb