Class: Stairs::InteractiveConfiguration

Inherits:
Step
  • Object
show all
Defined in:
lib/stairs/interactive_configuration.rb

Instance Attribute Summary

Attributes inherited from Step

#options, #step_description, #step_title

Instance Method Summary collapse

Methods inherited from Step

#bundle, #choice, description, #env, #finish, #initialize, #provide, #rake, #setup, #stairs_info, title, #write, #write_line

Constructor Details

This class inherits a constructor from Stairs::Step

Instance Method Details

#run!Object



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/stairs/interactive_configuration.rb', line 6

def run!
  choice prompt do |yes|
    if yes
      Stairs.configuration.env_adapter = recommended_adapter.new
    else
      choice "Which would you prefer?", adapter_names do |name|
        adapter_class = Stairs::EnvAdapters::ADAPTERS[name.to_sym]
        Stairs.configuration.env_adapter = adapter_class.new
      end
    end
  end
end