Class: Greenhouse::Commands::Status
- Inherits:
-
Object
- Object
- Greenhouse::Commands::Status
- Includes:
- Command
- Defined in:
- lib/greenhouse/commands/status.rb
Class Method Summary collapse
Instance Method Summary collapse
- #ecosystem_status ⇒ Object
- #project ⇒ Object
- #project_status ⇒ Object
- #project_type ⇒ Object
- #remote? ⇒ Boolean
- #run ⇒ Object
- #verbose? ⇒ Boolean
- #with_git? ⇒ Boolean
Methods included from Command
Class Method Details
.usage ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/greenhouse/commands/status.rb', line 16 def self.usage puts <<USAGE usage: #{::Greenhouse::CLI.command_name} #{command_name} [<project>] #{valid_arguments.to_s} Arguments: #{valid_arguments.to_help} Projects: #{project_arguments.to_help} USAGE end |
Instance Method Details
#ecosystem_status ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/greenhouse/commands/status.rb', line 52 def ecosystem_status if Projects::send(project_type).empty? puts "No #{project_type} in your ecosystem." return end Projects::send(project_type).each do |project| Tasks::ProjectStatus.perform(project, with_git?, verbose?, remote?) end end |
#project ⇒ Object
32 33 34 |
# File 'lib/greenhouse/commands/status.rb', line 32 def project Projects::projects.select { |project| arguments.map(&:key).include?(project.name) }.first end |
#project_status ⇒ Object
63 64 65 |
# File 'lib/greenhouse/commands/status.rb', line 63 def project_status Tasks::ProjectStatus.perform(project, with_git?, verbose?, remote?) end |
#project_type ⇒ Object
48 49 50 |
# File 'lib/greenhouse/commands/status.rb', line 48 def project_type arguments.map(&:key).include?("--apps") ? 'applications' : (arguments.map(&:key).include?("--gems") ? 'gems' : 'projects') end |
#remote? ⇒ Boolean
40 41 42 |
# File 'lib/greenhouse/commands/status.rb', line 40 def remote? arguments.map(&:key).include?("-r") end |
#run ⇒ Object
28 29 30 |
# File 'lib/greenhouse/commands/status.rb', line 28 def run project.nil? ? ecosystem_status : project_status end |
#verbose? ⇒ Boolean
44 45 46 |
# File 'lib/greenhouse/commands/status.rb', line 44 def verbose? arguments.map(&:key).include?("-v") end |
#with_git? ⇒ Boolean
36 37 38 |
# File 'lib/greenhouse/commands/status.rb', line 36 def with_git? arguments.map(&:key).include?("-g") end |