Class: Gemstash::CLI::Setup

Inherits:
Base
  • Object
show all
Defined in:
lib/gemstash/cli/setup.rb

Overview

This implements the command line setup task:

$ gemstash setup

Instance Method Summary collapse

Constructor Details

#initialize(cli) ⇒ Setup

Returns a new instance of Setup.



12
13
14
15
# File 'lib/gemstash/cli/setup.rb', line 12

def initialize(cli)
  super
  @config = {}
end

Instance Method Details

#runObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/gemstash/cli/setup.rb', line 17

def run
  if setup? && !@cli.options[:redo]
    @cli.say @cli.set_color("Everything is already setup!", :green)
    return
  end

  check_rubygems_version
  ask_storage
  ask_cache
  ask_database
  ask_protected_fetch
  ask_timeout
  check_cache
  check_storage
  check_database
  store_config
  
  @cli.say @cli.set_color("You are all setup!", :green)
end