Class: StandupMD::Config::Cli
- Inherits:
-
Object
- Object
- StandupMD::Config::Cli
- Defined in:
- lib/standup_md/config/cli.rb
Overview
The configuration class for StandupMD::Cli
Constant Summary collapse
- DEFAULTS =
The default options.
{ date: Date.today, editor: ENV["VISUAL"] || ENV["EDITOR"] || "vim", verbose: false, edit: true, write: true, print: false, auto_fill_previous: true, preference_file: ::File.( ::File.join(ENV["HOME"], ".standuprc") ) }.freeze
Instance Attribute Summary collapse
-
#auto_fill_previous ⇒ Boolean
When writing a new entry, should ‘previous’ be pulled from the last entry?.
-
#date ⇒ Date
The date to use to find the entry.
-
#edit ⇒ Boolean
Should the cli edit?.
-
#editor ⇒ String
The editor to use when opening standup files.
-
#preference_file ⇒ String
The preference file for Cli.
-
#print ⇒ Boolean
Should the cli print the entry to the command line?.
-
#verbose ⇒ Boolean
Should the cli print verbose output?.
-
#write ⇒ Boolean
Should the cli automatically write the new entry to the file?.
Instance Method Summary collapse
-
#initialize ⇒ Cli
constructor
Initializes the config with default values.
-
#reset ⇒ Hash
Sets all config values back to their defaults.
Constructor Details
#initialize ⇒ Cli
Initializes the config with default values.
95 96 97 |
# File 'lib/standup_md/config/cli.rb', line 95 def initialize reset end |
Instance Attribute Details
#auto_fill_previous ⇒ Boolean
When writing a new entry, should ‘previous’ be pulled from the last entry?
91 92 93 |
# File 'lib/standup_md/config/cli.rb', line 91 def auto_fill_previous @auto_fill_previous end |
#date ⇒ Date
The date to use to find the entry.
74 75 76 |
# File 'lib/standup_md/config/cli.rb', line 74 def date @date end |
#edit ⇒ Boolean
Should the cli edit?
50 51 52 |
# File 'lib/standup_md/config/cli.rb', line 50 def edit @edit end |
#editor ⇒ String
The editor to use when opening standup files. If one is not set, the first of $VISUAL, $EDITOR, or vim will be used, in that order.
34 35 36 |
# File 'lib/standup_md/config/cli.rb', line 34 def editor @editor end |
#preference_file ⇒ String
The preference file for Cli.
82 83 84 |
# File 'lib/standup_md/config/cli.rb', line 82 def preference_file @preference_file end |
#print ⇒ Boolean
Should the cli print the entry to the command line?
66 67 68 |
# File 'lib/standup_md/config/cli.rb', line 66 def print @print end |
#verbose ⇒ Boolean
Should the cli print verbose output?
42 43 44 |
# File 'lib/standup_md/config/cli.rb', line 42 def verbose @verbose end |
#write ⇒ Boolean
Should the cli automatically write the new entry to the file?
58 59 60 |
# File 'lib/standup_md/config/cli.rb', line 58 def write @write end |
Instance Method Details
#reset ⇒ Hash
Sets all config values back to their defaults.
103 104 105 |
# File 'lib/standup_md/config/cli.rb', line 103 def reset DEFAULTS.each { |k, v| instance_variable_set("@#{k}", v) } end |