Class: GFSM::Commands::Version
Instance Attribute Summary
Attributes inherited from BaseCommand
#stderr, #stdout
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from BaseCommand
#initialize
Class Method Details
.help ⇒ Object
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/commands/version.rb', line 7
def self.help
cli_info = GFSM::Tools::VersionBumperSettings.cli_info
" Usage:\n gfsm version [help|bump|current] \#{cli_info[:usage]}\n\n Commands:\n help # Prints this help\n bump # Bump the current version based on the commits changelog trailer and the configuration file\n current # Print the current version, without bumping it\n\n Options: \\n\#{cli_info[:options]}\n\n Environment variables: \\n\#{cli_info[:environment_variables]}\n HELP\nend\n"
|
Instance Method Details
#run(args = []) ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/commands/version.rb', line 25
def run(args = [])
case args.shift
when 'bump'
settings = GFSM::Tools::VersionBumperSettings.new(args)
version_bumper = GFSM::Tools::VersionBumper.new(settings)
version = version_bumper.execute
GFSM::Output.puts(version)
when 'current'
settings = GFSM::Tools::VersionBumperSettings.new(args)
version = GFSM::Tools::CurrentVersionLoader.load_current_version(settings.repository, settings.initial_version)
if settings.prerelease
version.add_prerelease_suffix!(settings.prerelease_name)
end
GFSM::Output.puts(version)
when 'help'
GFSM::Output.puts(GFSM::Commands::Version.help)
else
GFSM::Output.warn(GFSM::Commands::Version.help)
end
true
end
|