Class: Codelog::Command::Setup

Inherits:
Object
  • Object
show all
Includes:
FileUtils
Defined in:
lib/codelog/command/setup.rb

Constant Summary collapse

TEMPLATE_FILE_PATH =
File.dirname(__FILE__) + '/../../fixtures/template.yml'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.runObject



10
11
12
# File 'lib/codelog/command/setup.rb', line 10

def self.run
  Codelog::Command::Setup.new.run
end

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/codelog/command/setup.rb', line 14

def run
  chdir Dir.pwd do
    # This script provides the initial setup for the gem usage.

    puts '== Creating folder structure and template =='
    system! 'mkdir changelogs/'
    system! 'mkdir changelogs/unreleased'
    system! 'mkdir changelogs/releases'
    system! "cp #{TEMPLATE_FILE_PATH} changelogs/template.yml"
    system! 'touch changelogs/unreleased/.gitkeep'
    system! 'touch changelogs/releases/.gitkeep'
  end
end