Class: MSPRelease::CLI::Status

Inherits:
Command
  • Object
show all
Includes:
WorkingCopyCommand
Defined in:
lib/msp_release/cli/status.rb

Constant Summary

Constants included from Helpers

Helpers::PROJECT_FILE

Instance Attribute Summary

Attributes included from WorkingCopyCommand

#git, #project

Instance Method Summary collapse

Methods included from WorkingCopyCommand

#initialize

Methods included from Helpers

#author, #changelog, #data, #data=, #data_exists?, #fail_if_modified_wc, #fail_if_push_pending, #git_version, #load_data, #msp_version, #on_release_branch?, #remove_data, #save_data, #time, #time_rfc, #timestamp

Methods included from Exec::Helpers

#exec

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/msp_release/cli/status.rb', line 8

def run
  bits = []

  if data_exists?
    load_data
    puts "Awaiting push.  Please update the changelog, then run vershunt push "
    bits.push(["Pending", data[:version]])
  else
    bits.push(["Project says", msp_version]) if msp_version
    bits.push(["Release branch", on_release_branch?? git_version : nil])

    if changelog
      changelog_version = changelog.version
      bits.push(["Changelog says", changelog_version])
    end

  end

  bits.push(["Release commit", release_name_for_output])

  format_bits(bits)
end