Sha256: d546e58826e57ef84659f26ef83e60327267cfaf43a2539a4caad8cd2b5831db

Contents?: true

Size: 735 Bytes

Versions: 188

Compression:

Stored size: 735 Bytes

Contents

# shamelessly stolen from https://github.com/sferik/rails_admin/blob/master/lib/generators/rails_admin/utils.rb

module RocketCms
  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

188 entries across 188 versions & 2 rubygems

Version Path
rocket_cms-0.10.1 lib/generators/rocket_cms/utils.rb
rocket_cms-0.10.0 lib/generators/rocket_cms/utils.rb
rocket_cms-0.9.9 lib/generators/rocket_cms/utils.rb
rocket_cms-0.9.8 lib/generators/rocket_cms/utils.rb
ack_rocket_cms-0.9.2 lib/generators/rocket_cms/utils.rb
rocket_cms-0.9.7 lib/generators/rocket_cms/utils.rb
rocket_cms-0.9.5 lib/generators/rocket_cms/utils.rb
rocket_cms-0.9.4 lib/generators/rocket_cms/utils.rb
rocket_cms-0.9.3 lib/generators/rocket_cms/utils.rb
rocket_cms-0.9.2 lib/generators/rocket_cms/utils.rb
ack_rocket_cms-0.9.1.3 lib/generators/rocket_cms/utils.rb
ack_rocket_cms-0.9.1.2 lib/generators/rocket_cms/utils.rb
ack_rocket_cms-0.9.1.1 lib/generators/rocket_cms/utils.rb
ack_rocket_cms-0.9.1 lib/generators/rocket_cms/utils.rb
ack_rocket_cms-0.9 lib/generators/rocket_cms/utils.rb
rocket_cms-0.9.1 lib/generators/rocket_cms/utils.rb
rocket_cms-0.8.13 lib/generators/rocket_cms/utils.rb
ack_rocket_cms-0.8.2 lib/generators/rocket_cms/utils.rb
rocket_cms-0.8.12 lib/generators/rocket_cms/utils.rb
rocket_cms-0.8.11 lib/generators/rocket_cms/utils.rb