Class: Sleet::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/sleet/config.rb

Overview

rubocop:disable Metrics/ClassLength

Defined Under Namespace

Classes: ConfigOption

Constant Summary collapse

OPTION_FILENAME =
'.sleet.yml'
HIDDEN_UNLESS_IN_CLI_OPTIONS =
%w[show_sensitive print_config].freeze

Instance Method Summary collapse

Constructor Details

#initialize(dir:, cli_hash: {}) ⇒ Config

Returns a new instance of Config.



9
10
11
12
# File 'lib/sleet/config.rb', line 9

def initialize(dir:, cli_hash: {})
  @dir = dir
  @cli_hash = cli_hash
end

Instance Method Details

#branchObject



34
35
36
# File 'lib/sleet/config.rb', line 34

def branch
  options_hash[:branch]
end

#circle_ci_tokenObject



42
43
44
# File 'lib/sleet/config.rb', line 42

def circle_ci_token
  options_hash[:circle_ci_token]
end

#input_fileObject



18
19
20
# File 'lib/sleet/config.rb', line 18

def input_file
  options_hash[:input_file]
end

#output_fileObject



22
23
24
# File 'lib/sleet/config.rb', line 22

def output_file
  options_hash[:output_file]
end

#print!Object



46
47
48
# File 'lib/sleet/config.rb', line 46

def print!
  puts Terminal::Table.new headings: %w[Option Value Source], rows: table_rows
end

#projectObject



30
31
32
# File 'lib/sleet/config.rb', line 30

def project
  options_hash[:project]
end

#source_dirObject



14
15
16
# File 'lib/sleet/config.rb', line 14

def source_dir
  options_hash[:source_dir]
end

#usernameObject



26
27
28
# File 'lib/sleet/config.rb', line 26

def username
  options_hash[:username]
end

#workflowsObject



38
39
40
# File 'lib/sleet/config.rb', line 38

def workflows
  options_hash[:workflows]
end