Class: StandupMD::Config::File
- Inherits:
-
Object
- Object
- StandupMD::Config::File
- Defined in:
- lib/standup_md/config/file.rb
Overview
The configuration class for StandupMD::File
Constant Summary collapse
- DEFAULTS =
The default options.
{ header_date_format: "%Y-%m-%d", header_depth: 1, sub_header_depth: 2, current_header: "Current", previous_header: "Previous", impediments_header: "Impediments", notes_header: "Notes", sub_header_order: %w[previous current impediments notes], directory: ::File.join(ENV["HOME"], ".cache", "standup_md"), bullet_character: "-", indent_width: 2, name_format: "%Y_%m.md", create: true }.freeze
Instance Attribute Summary collapse
-
#bullet_character ⇒ String
Character used as bullets for list entries.
-
#create ⇒ boolean
Should the file be created if it doesn’t exist?.
-
#current_header ⇒ String
String to be used as “Current” header.
-
#directory ⇒ String
The directory in which the files are located.
-
#header_date_format ⇒ String
The date format for entry headers.
-
#header_depth ⇒ Integer
Number of octothorps that should preface entry headers.
-
#impediments_header ⇒ String
String to be used as “Impediments” header.
-
#indent_width ⇒ Integer
Number of spaces used for each nested task level.
-
#name_format ⇒ String
Format to be used for standup file names.
-
#notes_header ⇒ String
String to be used as “Notes” header.
-
#previous_header ⇒ String
String to be used as “Previous” header.
-
#sub_header_depth ⇒ Integer
Number of octothorps that should preface sub-headers.
-
#sub_header_order ⇒ Array
Preferred order for sub-headers.
Instance Method Summary collapse
-
#initialize ⇒ File
constructor
Initializes the config with default values.
-
#reset ⇒ Hash
Sets all config values back to their defaults.
Constructor Details
#initialize ⇒ File
Initializes the config with default values.
147 148 149 |
# File 'lib/standup_md/config/file.rb', line 147 def initialize reset end |
Instance Attribute Details
#bullet_character ⇒ String
Character used as bullets for list entries.
58 59 60 |
# File 'lib/standup_md/config/file.rb', line 58 def bullet_character @bullet_character end |
#create ⇒ boolean
Should the file be created if it doesn’t exist?
143 144 145 |
# File 'lib/standup_md/config/file.rb', line 143 def create @create end |
#current_header ⇒ String
String to be used as “Current” header.
76 77 78 |
# File 'lib/standup_md/config/file.rb', line 76 def current_header @current_header end |
#directory ⇒ String
The directory in which the files are located.
50 51 52 |
# File 'lib/standup_md/config/file.rb', line 50 def directory @directory end |
#header_date_format ⇒ String
The date format for entry headers. Will be parsed by strftime.
135 136 137 |
# File 'lib/standup_md/config/file.rb', line 135 def header_date_format @header_date_format end |
#header_depth ⇒ Integer
Number of octothorps that should preface entry headers.
34 35 36 |
# File 'lib/standup_md/config/file.rb', line 34 def header_depth @header_depth end |
#impediments_header ⇒ String
String to be used as “Impediments” header.
96 97 98 |
# File 'lib/standup_md/config/file.rb', line 96 def impediments_header @impediments_header end |
#indent_width ⇒ Integer
Number of spaces used for each nested task level.
66 67 68 |
# File 'lib/standup_md/config/file.rb', line 66 def indent_width @indent_width end |
#name_format ⇒ String
Format to be used for standup file names. Should be parse-able by strftime, and should be a monthly date.
127 128 129 |
# File 'lib/standup_md/config/file.rb', line 127 def name_format @name_format end |
#notes_header ⇒ String
String to be used as “Notes” header.
106 107 108 |
# File 'lib/standup_md/config/file.rb', line 106 def notes_header @notes_header end |
#previous_header ⇒ String
String to be used as “Previous” header.
86 87 88 |
# File 'lib/standup_md/config/file.rb', line 86 def previous_header @previous_header end |
#sub_header_depth ⇒ Integer
Number of octothorps that should preface sub-headers.
42 43 44 |
# File 'lib/standup_md/config/file.rb', line 42 def sub_header_depth @sub_header_depth end |
#sub_header_order ⇒ Array
Preferred order for sub-headers.
116 117 118 |
# File 'lib/standup_md/config/file.rb', line 116 def sub_header_order @sub_header_order end |
Instance Method Details
#reset ⇒ Hash
Sets all config values back to their defaults.
155 156 157 |
# File 'lib/standup_md/config/file.rb', line 155 def reset DEFAULTS.each { |k, v| instance_variable_set("@#{k}", v) } end |