Class: Ddenv::Goals::ShadowenvDirGitIgnored

Inherits:
Ddenv::Goal
  • Object
show all
Defined in:
lib/ddenv/goals/shadowenv_dir_git_ignored.rb

Constant Summary collapse

PATH =
".shadowenv.d/.gitignore"
CONTENTS =
"*\n"

Instance Method Summary collapse

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

#achieveObject



17
18
19
# File 'lib/ddenv/goals/shadowenv_dir_git_ignored.rb', line 17

def achieve
  File.write(PATH, CONTENTS)
end

#achieved?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/ddenv/goals/shadowenv_dir_git_ignored.rb', line 13

def achieved?
  File.file?(PATH) && File.read(PATH) == CONTENTS
end

#messageObject



9
10
11
# File 'lib/ddenv/goals/shadowenv_dir_git_ignored.rb', line 9

def message
  "Adding .shadowenv.d to .gitignore"
end