Sha256: 71eaf4758d7393b64e46072b7d8648cfb6fc6a904ce8ef31e558820e28366ddc

Contents?: true

Size: 680 Bytes

Versions: 3

Compression:

Stored size: 680 Bytes

Contents

require 'fileutils'

module Codelog
  module Command
    class New
      include FileUtils

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

      def run
        chdir Dir.pwd do
          # This script create a change file for the changelog documentation.

          full_file_name = "changelogs/unreleased/#{Time.now.strftime('%Y%m%d%H%M%S%L')}_change.yml"

          puts "== Creating #{full_file_name} change file based on example =="
          system! "cp changelogs/template.yml #{full_file_name}"
        end
      end

      private

      def system!(*args)
        system(*args) || abort("\n== Command #{args} failed ==")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
codelog-0.4.0 lib/codelog/command/new.rb
codelog-0.3.1 lib/codelog/command/new.rb
codelog-0.3.0 lib/codelog/command/new.rb