module DistribBuilder module Versioner class Logger attr_accessor :verbose def initialize(verbose=false) @verbose = verbose end def missing_files raise "DistribBuilder.yml or CMakeLists.txt is missing in current directory" end def show_current_version(version) puts "Current version: #{version}" end def show_current_build(build) puts "Current build: #{build}" end def new_version(version) puts "New version: #{version}" if @verbose end def build_changed(build) puts "Build changed to #{build}" if @verbose end def version_changed(version) puts "Version changed to #{version}" if @verbose end def file_not_found(path) raise "File not found: #{path}" end def found_and_replace_pattern_in_text(pattern, path) puts "Pattern '#{pattern}' was found and replaced in the file '#{path}'" if @verbose end def write_changes_into_file(path) puts "Write new changes into file '#{path}'" if @verbose end def start_increment_build puts "Start increment build process" if @verbose end def start_decrement_build puts "Start decrement build process" if @verbose end def start_setup_build puts "Start setup build process" if @verbose end def start_setup_version puts "Start setup version process" if @verbose end def pattern_not_match(pattern, path) raise "Pattern '#{pattern}' was not matched in file '#{path}'" end def missing_mandatory_sections_in_config raise "DistribBuilder.yml must contains both files and patterns sections. See lib/distrib_builder/templates/DistribBuilder.yml for more information" end def incorrect_setup_build(build) raise "Incorrect build number. It must be digit but it was '#{build}'" end def incorrect_setup_version(version) raise "Incorrect version number. It must be in format X.X.X but it was '#{version}'" end end end end