Class: Shaf::Command::Version

Inherits:
Base
  • Object
show all
Defined in:
lib/shaf/command/version.rb

Constant Summary

Constants included from Utils

Utils::SHAF_VERSION_FILE

Instance Attribute Summary

Attributes inherited from Base

#args, #options

Instance Method Summary collapse

Methods inherited from Base

exit_with_error, identified_by, identifier, inherited, #initialize, options, usage

Methods included from Utils

#bootstrap, deep_symbolize_keys, deep_transform_keys, deep_transform_values, environment, gem_root, iana_link_relations, #in_project_root, #in_project_root?, #is_project_root?, model_name, pluralize, #project_root, #project_root!, rackify_header, read_config, #read_shaf_file, #read_shaf_file!, #read_shaf_upgrade_failure_version, #read_shaf_version, singularize, symbol_or_quoted_string, symbol_string, #write_shaf_file, #write_shaf_file!, #write_shaf_upgrade_failure, #write_shaf_version

Constructor Details

This class inherits a constructor from Shaf::Command::Base

Instance Method Details

#callObject



8
9
10
11
# File 'lib/shaf/command/version.rb', line 8

def call
  print_shaf_version
  print_project_version
end


17
18
19
20
21
22
# File 'lib/shaf/command/version.rb', line 17

def print_project_version
  path = project_root
  return if path.nil?
  project = path.split('/').last
  puts "Project '#{project}' created with Shaf version: #{read_shaf_version}"
end


13
14
15
# File 'lib/shaf/command/version.rb', line 13

def print_shaf_version
  puts "Installed Shaf version: #{Shaf::VERSION}"
end