Sha256: fdbe82359257ed0c78a9e07016a8d6db71a4a51b054275f8549ddb02f1d1fa7c

Contents?: true

Size: 767 Bytes

Versions: 2

Compression:

Stored size: 767 Bytes

Contents

module Releasetool
  module Util

    DIR = "release_notes"
    VERSION_FILE = ENV['RELEASETOOL_VERSION_FILE'] || "config/initializers/00-version.rb" #rails out of box
    TEMPLATE_FILE = "__TEMPLATE__.md" # relative to DIR
    RELEASE_MARKER_FILE = ".RELEASE_NEW_VERSION" # should be a config var

    def stored_version
      fail Thor::Error.new("No stored version... did you forget to do release start?") unless File.exist?(RELEASE_MARKER_FILE)
      File.read(RELEASE_MARKER_FILE).strip
    end

    def remove_stored_version
      guarded_system("rm #{RELEASE_MARKER_FILE}") if File.exist?(RELEASE_MARKER_FILE)
    end

    def guarded_system(command)
      puts command
      system(command) or raise Thor::Error.new("Couldn't '#{command}'")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
releasetool-0.3.0 lib/releasetool/util.rb
releasetool-0.2.0 lib/releasetool/util.rb