Class: Gemshine::Command
- Inherits:
-
Object
- Object
- Gemshine::Command
- Includes:
- UI, Thor::Actions, Thor::Base, Thor::Shell
- Defined in:
- lib/gemshine/command.rb
Constant Summary
Constants included from UI
UI::MSG_BUNDLE_ERROR, UI::MSG_BUNDLE_OUTDATED, UI::MSG_BUNDLE_UP_TO_DATE, UI::MSG_GATHER_OUTDATED, UI::MSG_MISSING_GEMFILE, UI::MSG_PATH_STATS, UI::MSG_UP_TO_DATE
Instance Attribute Summary collapse
-
#bundle_outdated_output ⇒ Object
Returns the value of attribute bundle_outdated_output.
-
#gemfile_path ⇒ Object
Returns the value of attribute gemfile_path.
-
#project_dir ⇒ Object
Returns the value of attribute project_dir.
-
#project_name ⇒ Object
Returns the value of attribute project_name.
-
#projects ⇒ Object
Returns the value of attribute projects.
Instance Method Summary collapse
-
#initialize(root_path = '', options = {}) ⇒ Command
constructor
A new instance of Command.
- #path ⇒ Object
- #version ⇒ Object
Methods included from UI
#detect_outdated_color, #gem_table, #log_bundle_message, #log_missing, #log_path_stats, #log_project, #log_up_to_date, #run_bundle_outdated
Constructor Details
#initialize(root_path = '', options = {}) ⇒ Command
Returns a new instance of Command.
14 15 16 17 18 19 20 |
# File 'lib/gemshine/command.rb', line 14 def initialize(root_path = '', = {}) @root_path = root_path @options = self.destination_root = Dir.pwd @behavior = :invoke end |
Instance Attribute Details
#bundle_outdated_output ⇒ Object
Returns the value of attribute bundle_outdated_output.
12 13 14 |
# File 'lib/gemshine/command.rb', line 12 def bundle_outdated_output @bundle_outdated_output end |
#gemfile_path ⇒ Object
Returns the value of attribute gemfile_path.
12 13 14 |
# File 'lib/gemshine/command.rb', line 12 def gemfile_path @gemfile_path end |
#project_dir ⇒ Object
Returns the value of attribute project_dir.
12 13 14 |
# File 'lib/gemshine/command.rb', line 12 def project_dir @project_dir end |
#project_name ⇒ Object
Returns the value of attribute project_name.
12 13 14 |
# File 'lib/gemshine/command.rb', line 12 def project_name @project_name end |
#projects ⇒ Object
Returns the value of attribute projects.
12 13 14 |
# File 'lib/gemshine/command.rb', line 12 def projects @projects end |
Instance Method Details
#path ⇒ Object
22 23 24 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/gemshine/command.rb', line 22 def path ruby_project_directories.each do |project_dir| @project_dir = project_dir @project_name = File.basename(@project_dir) @gemfile_path = File.join(@project_dir, 'Gemfile') log_project unless File.exists?(@gemfile_path) log_missing next end @bundle_outdated_output = run_bundle_outdated if @bundle_outdated_output.match(/\b#{MSG_BUNDLE_UP_TO_DATE}\b/) log_up_to_date next end unless @bundle_outdated_output.match(/\b#{MSG_BUNDLE_OUTDATED}\b/) @bundle_outdated_output next end gem_table valid_gem_list end end |
#version ⇒ Object
51 52 53 |
# File 'lib/gemshine/command.rb', line 51 def version puts "Gemshine version #{VERSION}" end |