Class: EasyCreds::Onboarding::ProjectWizard

Inherits:
Object
  • Object
show all
Defined in:
lib/easy_creds/onboarding/project_wizard.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prompt:, root: nil, force: false, non_interactive: false) ⇒ ProjectWizard

Returns a new instance of ProjectWizard.



11
12
13
14
15
16
17
# File 'lib/easy_creds/onboarding/project_wizard.rb', line 11

def initialize(prompt:, root: nil, force: false, non_interactive: false)
  @prompt          = prompt
  @root            = root ? Pathname.new(root) : detect_root
  @force           = force
  @non_interactive = non_interactive
  @rails           = @root.join('config/application.rb').exist?
end

Class Method Details

.run(prompt:, root: nil, force: false, non_interactive: false) ⇒ Object



6
7
8
9
# File 'lib/easy_creds/onboarding/project_wizard.rb', line 6

def self.run(prompt:, root: nil, force: false, non_interactive: false)
  new(prompt: prompt, root: root, force: force,
      non_interactive: non_interactive).run
end

Instance Method Details

#runObject



19
20
21
22
23
24
25
26
# File 'lib/easy_creds/onboarding/project_wizard.rb', line 19

def run
  show_detected_mode
  template   = pick_template
  dest       = pick_destination_path
  customised = customise(template)
  write_example(customised, dest)
  offer_bootstrap if @rails && !@non_interactive
end