Class: Sleet::Config
- Inherits:
-
Object
- Object
- Sleet::Config
- 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
- #branch ⇒ Object
- #circle_ci_token ⇒ Object
-
#initialize(dir:, cli_hash: {}) ⇒ Config
constructor
A new instance of Config.
- #input_file ⇒ Object
- #output_file ⇒ Object
- #print! ⇒ Object
- #project ⇒ Object
- #source_dir ⇒ Object
- #username ⇒ Object
- #workflows ⇒ Object
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
#branch ⇒ Object
34 35 36 |
# File 'lib/sleet/config.rb', line 34 def branch [:branch] end |
#circle_ci_token ⇒ Object
42 43 44 |
# File 'lib/sleet/config.rb', line 42 def circle_ci_token [:circle_ci_token] end |
#input_file ⇒ Object
18 19 20 |
# File 'lib/sleet/config.rb', line 18 def input_file [:input_file] end |
#output_file ⇒ Object
22 23 24 |
# File 'lib/sleet/config.rb', line 22 def output_file [: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 |
#project ⇒ Object
30 31 32 |
# File 'lib/sleet/config.rb', line 30 def project [:project] end |
#source_dir ⇒ Object
14 15 16 |
# File 'lib/sleet/config.rb', line 14 def source_dir [:source_dir] end |
#username ⇒ Object
26 27 28 |
# File 'lib/sleet/config.rb', line 26 def username [:username] end |
#workflows ⇒ Object
38 39 40 |
# File 'lib/sleet/config.rb', line 38 def workflows [:workflows] end |