Class: Mortar::Command::Version
- Includes:
- Helpers
- Defined in:
- lib/mortar/command/version.rb
Overview
display version
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#index ⇒ Object
version.
-
#upgrade ⇒ Object
upgrade [OPTIONAL_VERSION_NUMBER] version:upgrade [OPTIONAL_VERSION_NUMBER].
Methods included from Helpers
#action, #ask, #confirm, #copy_if_not_present_at_dest, #default_host, #deprecate, #display, #display_header, #display_object, #display_row, #display_table, #display_with_indent, #download_to_file, #ensure_dir_exists, #error, error_with_failure, error_with_failure=, extended, extended_into, #format_bytes, #format_date, #format_with_bang, #get_terminal_environment, #home_directory, #host, #hprint, #hputs, included, included_into, #installed_with_omnibus?, #json_decode, #json_encode, #line_formatter, #longest, #output_with_bang, #quantify, #redisplay, #retry_on_exception, #running_on_a_mac?, #running_on_windows?, #set_buffer, #shell, #spinner, #status, #string_distance, #styled_array, #styled_error, #styled_hash, #styled_header, #suggestion, #test_name, #ticking, #time_ago, #truncate, #warning, #with_tty, #write_to_file
Methods inherited from Base
#api, #ask_public, #config_parameters, #get_error_message_context, #git, #initialize, #initialize_embedded_project, namespace, #pig_parameters, #project, #register_api_call, #register_do, #register_project, #validate_project_name, #validate_project_structure
Constructor Details
This class inherits a constructor from Mortar::Command::Base
Instance Method Details
#index ⇒ Object
version
show mortar client version
34 35 36 37 38 |
# File 'lib/mortar/command/version.rb', line 34 def index validate_arguments! display(Mortar::USER_AGENT) end |
#upgrade ⇒ Object
upgrade [OPTIONAL_VERSION_NUMBER] version:upgrade [OPTIONAL_VERSION_NUMBER]
Upgrade the Mortar development framework
-v, –version VERSION_NUMBER # specify which version to upgrade to
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/mortar/command/version.rb', line 46 def upgrade validate_arguments! if installed_with_omnibus? version_number = '' if [:version] version_number = " -v " + [:version] end shell_url = ENV.fetch("MORTAR_INSTALL", "http://install.mortardata.com") dir = "/opt/mortar/installer" begin cmd = "echo 'Upgrading will prompt for your sudo password.\n' && sudo mkdir -p #{dir} && sudo curl -sS -L -o #{dir}/install.sh #{shell_url} && sudo bash #{dir}/install.sh#{version_number}" Kernel.system cmd ensure end else error("mortar upgrade is only for installations not conducted with ruby gem. Please upgrade by running 'gem install mortar'.") end end |