Class: Logchange::Initialize

Inherits:
Object
  • Object
show all
Defined in:
lib/logchange/initialize.rb

Overview

Creates the changes directory if it doesn’t exist, and logs the initialization.

Instance Method Summary collapse

Instance Method Details

#executeObject



6
7
8
9
10
11
12
13
14
15
# File 'lib/logchange/initialize.rb', line 6

def execute
  path = File.join(Logchange.configuration.changelog_directory_path, 'unreleased')

  if File.directory?(path)
    puts 'The changelog directory already exists. Cancelling.'
  else
    FileUtils.mkdir_p(path)
    Logchange::Logger.new('Added logchange to project.').execute
  end
end