Class: Ddenv::Goals::ShadowenvDirCreated

Inherits:
Ddenv::Goal show all
Defined in:
lib/ddenv/goals/shadowenv_dir_created.rb

Constant Summary collapse

PATH =
".shadowenv.d"

Instance Method Summary collapse

Methods inherited from Ddenv::Goal

#==, #eql?, #hash, #initialize, #props, #with_pre_and_post_goals

Constructor Details

This class inherits a constructor from Ddenv::Goal

Instance Method Details

#achieveObject



16
17
18
# File 'lib/ddenv/goals/shadowenv_dir_created.rb', line 16

def achieve
  FileUtils.mkdir_p(PATH)
end

#achieved?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/ddenv/goals/shadowenv_dir_created.rb', line 12

def achieved?
  Pathname.new(PATH).directory?
end

#messageObject



8
9
10
# File 'lib/ddenv/goals/shadowenv_dir_created.rb', line 8

def message
  "Creating .shadowenv.d"
end

#post_goalsObject



26
27
28
29
30
31
# File 'lib/ddenv/goals/shadowenv_dir_created.rb', line 26

def post_goals
  [
    Ddenv::Goals::ShadowenvDirGitIgnored.new,
    Ddenv::Goals::ShadowenvTrusted.new
  ]
end

#pre_goalsObject



20
21
22
23
24
# File 'lib/ddenv/goals/shadowenv_dir_created.rb', line 20

def pre_goals
  [
    Ddenv::Goals::ShadowenvInitialized.new
  ]
end