Sha256: 2c0dad32dbd30844eb176477073bb46b77efa35091cc3eea25b8c353fac2e46e

Contents?: true

Size: 1.61 KB

Versions: 12

Compression:

Stored size: 1.61 KB

Contents

# Author::    Eric Crane  (mailto:eric.crane@mac.com)
# Copyright:: Copyright (c) 2019 Eric Crane.  All rights reserved.
#
# Show the current application version.
#

module Gloo
  module Verbs
    class Version < Gloo::Core::Verb

      KEYWORD = 'version'.freeze
      KEYWORD_SHORT = 'v'.freeze
      NOTES = 'notes'.freeze
      NOTES_SHORT = 'n'.freeze

      #
      # Run the verb.
      #
      def run
        vers_notes? ? show_vers_notes : show_vers
      end

      #
      # Get the Verb's keyword.
      #
      def self.keyword
        return KEYWORD
      end

      #
      # Get the Verb's keyword shortcut.
      #
      def self.keyword_shortcut
        return KEYWORD_SHORT
      end


      # ---------------------------------------------------------------------
      #    Private functions
      # ---------------------------------------------------------------------

      private

      # 
      # Show basic version numbers.
      # 
      def show_vers
        @engine.log.show Gloo::App::Info.full_version
        @engine.log.show "\nUse `#{KEYWORD} #{NOTES}` to see version notes."
      end

      # 
      # Show version notes.
      # 
      def show_vers_notes
        @engine.log.show "Gloo version notes..."
        notes = Gloo::App::Info.get_version_notes
        @engine.platform.show( notes, false, true )
      end

      # 
      # Is the request to show version notes?
      # 
      def vers_notes?
        if ( @tokens.token_count > 1 ) && ( 
          ( @tokens.last == NOTES ) || ( @tokens.last == NOTES_SHORT ) )
          return true
        end

        return false
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
gloo-3.3.0 lib/gloo/verbs/version.rb
gloo-3.2.0 lib/gloo/verbs/version.rb
gloo-3.1.1 lib/gloo/verbs/version.rb
gloo-3.1.0 lib/gloo/verbs/version.rb
gloo-3.0.1 lib/gloo/verbs/version.rb
gloo-3.0.0 lib/gloo/verbs/version.rb
gloo-2.5.0 lib/gloo/verbs/version.rb
gloo-2.4.3 lib/gloo/verbs/version.rb
gloo-2.4.2 lib/gloo/verbs/version.rb
gloo-2.4.1 lib/gloo/verbs/version.rb
gloo-2.4.0 lib/gloo/verbs/version.rb
gloo-2.3.1 lib/gloo/verbs/version.rb