From 75e815c304bff4fbc544cc3faa379d09e46df67b Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 6 Nov 2023 10:21:54 +0100 Subject: [PATCH] Increment brix11 version and simplified the usage * brix11/lib/brix11.rb: * brix11/lib/brix11/base.rb: * brix11/lib/brix11/options.rb: --- brix11/lib/brix11.rb | 5 +---- brix11/lib/brix11/base.rb | 14 +++++++++----- brix11/lib/brix11/options.rb | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/brix11/lib/brix11.rb b/brix11/lib/brix11.rb index 6e8cccb..2dd1357 100644 --- a/brix11/lib/brix11.rb +++ b/brix11/lib/brix11.rb @@ -8,10 +8,7 @@ #-------------------------------------------------------------------- module BRIX11 - VERSION = '1.1.0' - VERSION_MAJOR, - VERSION_MINOR, - VERSION_RELEASE, = VERSION.split('.').collect { |e| e.to_i } + VERSION = { major: 2, minor: 6, release: 0 } COPYRIGHT = "Copyright (c) 2014-#{Time.now.year} Remedy IT Expertise BV, The Netherlands".freeze def self.root_path diff --git a/brix11/lib/brix11/base.rb b/brix11/lib/brix11/base.rb index 4aea3d9..c907bd5 100644 --- a/brix11/lib/brix11/base.rb +++ b/brix11/lib/brix11/base.rb @@ -29,6 +29,10 @@ def set_reporter(rep) @reporter = rep end + def version + "#{VERSION[:major]}.#{VERSION[:minor]}.#{VERSION[:release]}" + end + private # # Configuration handling @@ -121,7 +125,7 @@ def self.init_optparser 'List available project types (with compiler options) and active default') { options.load_config load_brix - puts "BRIX11 pluggable scaffolding tool #{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_RELEASE}" + puts "BRIX11 pluggable scaffolding tool #{version}" puts COPYRIGHT puts puts ' %-45s | %-35s' % ['Project type [compilers]', 'Description'] @@ -181,7 +185,7 @@ def self.init_optparser 'Print specified or active config and exit.', "Default: active configuration") { |v| options.load_config unless String === v - puts "BRIX11 pluggable scaffolding tool #{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_RELEASE}" + puts "BRIX11 pluggable scaffolding tool #{version}" puts COPYRIGHT puts puts options.print_config(String === v ? v : nil) @@ -193,7 +197,7 @@ def self.init_optparser 'List available brix collections and exit.') { options.load_config load_brix - puts "BRIX11 pluggable scaffolding tool #{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_RELEASE}" + puts "BRIX11 pluggable scaffolding tool #{version}" puts COPYRIGHT puts print ' ' @@ -207,7 +211,7 @@ def self.init_optparser BRIX11.log_fatal("Invalid switch -L#{v}") unless v == true || v == 'all' options.load_config load_brix - puts "BRIX11 pluggable scaffolding tool #{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_RELEASE}" + puts "BRIX11 pluggable scaffolding tool #{version}" puts COPYRIGHT puts print ' ' @@ -230,7 +234,7 @@ def self.init_optparser 'Show version information and exit.') { options.load_config load_brix - puts "BRIX11 pluggable scaffolding tool #{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_RELEASE}" + puts "BRIX11 pluggable scaffolding tool #{version}" puts COPYRIGHT puts puts '--- [Brix collections] ---' diff --git a/brix11/lib/brix11/options.rb b/brix11/lib/brix11/options.rb index 4dfcbba..8d38519 100644 --- a/brix11/lib/brix11/options.rb +++ b/brix11/lib/brix11/options.rb @@ -116,7 +116,7 @@ def _defaults help_proc: lambda { options.load_config load_brix - puts "BRIX11 pluggable scaffolding tool #{VERSION_MAJOR}.#{VERSION_MINOR}.#{VERSION_RELEASE}" + puts "BRIX11 pluggable scaffolding tool #{version}" puts COPYRIGHT puts puts BRIX11.options.optparser