Class: Shards::Workflow::Terminal

Inherits:
Base
  • Object
show all
Defined in:
lib/shards/workflow/terminal.rb

Instance Attribute Summary

Attributes inherited from Base

#answer, #blank_db, #client, #config, #current_loop, #domain, #flow, #location, #params, #pointer, #pointer_history, #site, #stage, #step, #success, #wf

Instance Method Summary collapse

Methods inherited from Base

#add_ask_blank_db_step, #application_reload_shards_task, #ask_blank_db, #ask_for_exit, #ask_for_exit_and_restart, #ask_for_repeat, #ask_question, #check_database_presence_in_server, #check_domain_dns_presence, #check_domain_presence_in_sites, #check_fingerprints, #check_fingerprints2, #check_shard_presence_in_shards, #choose_one, #clean_repo_and_exit, #commit_changes, #create_database, #decamelize, #default_path, #dns_upsert, #file, #finish_successfully, #format_options, #get_file, #host, #initialize, #loop_step, #output_message, #path, #previous_pointer, #puppet_agent_update, #raise_wrong_text, #run_step, #shared_file, #shared_steps, #start, #start_at, #validate_blank_db_shard, #validate_client, #validate_domain, #validate_in_index, #validate_location, #validate_min_size, #validate_regex, #validate_stage, #validation, #write_yaml_files, #yaml

Constructor Details

This class inherits a constructor from Shards::Workflow::Base

Instance Method Details

#ask_clientObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/shards/workflow/terminal.rb', line 8

def ask_client

  ask_question

  @answer=answer.strip

  @wrong_text=false

  validate_min_size answer, @step['min_size']

  @client=answer

end

#ask_domainObject



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/shards/workflow/terminal.rb', line 34

def ask_domain

  ask_question

  @answer=answer.strip

  @wrong_text=false

  validate_min_size answer, @step['min_size']

  validate_regex answer, @step['regex']

  @domain=answer

end

#ask_locationObject



22
23
24
25
26
# File 'lib/shards/workflow/terminal.rb', line 22

def ask_location
  locations=config.locations.keys
  choose_one "Locations:", locations
  @location=config.locations[locations[answer.to_i]]
end

#ask_stageObject



28
29
30
31
32
# File 'lib/shards/workflow/terminal.rb', line 28

def ask_stage
  stages=location.stages.keys
  choose_one "Stages:", stages
  @stage=location.stages[stages[answer.to_i]]
end