Class: Ddenv::Goals::ShadowenvInitialized
- Inherits:
-
Ddenv::Goal
- Object
- Ddenv::Goal
- Ddenv::Goals::ShadowenvInitialized
- Defined in:
- lib/ddenv/goals/shadowenv_initialized.rb
Constant Summary collapse
- FISH_LINE =
"shadowenv init fish | source"
Instance Method Summary collapse
- #achieve ⇒ Object
-
#achieved? ⇒ Boolean
TODO: support bash and zsh.
- #message ⇒ Object
Methods inherited from Ddenv::Goal
#==, #eql?, #hash, #initialize, #post_goals, #pre_goals, #props, #with_pre_and_post_goals
Constructor Details
This class inherits a constructor from Ddenv::Goal
Instance Method Details
#achieve ⇒ Object
19 20 21 |
# File 'lib/ddenv/goals/shadowenv_initialized.rb', line 19 def achieve File.write(fish_config_path, "\n\n#{FISH_LINE}", mode: "a+") end |
#achieved? ⇒ Boolean
TODO: support bash and zsh
14 15 16 17 |
# File 'lib/ddenv/goals/shadowenv_initialized.rb', line 14 def achieved? fish_config = File.read(fish_config_path) fish_config.lines.any? { _1.chomp == FISH_LINE } end |
#message ⇒ Object
8 9 10 |
# File 'lib/ddenv/goals/shadowenv_initialized.rb', line 8 def "Initializing Shadowenv" end |