Class: Greenhouse::Commands::Pull
- Inherits:
-
Object
- Object
- Greenhouse::Commands::Pull
- Includes:
- Command
- Defined in:
- lib/greenhouse/commands/pull.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Command
Class Method Details
.usage ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/greenhouse/commands/pull.rb', line 10 def 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
#force? ⇒ Boolean
23 24 25 |
# File 'lib/greenhouse/commands/pull.rb', line 23 def force? arguments.map(&:key).include?("-f") end |
#pull_all ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/greenhouse/commands/pull.rb', line 27 def pull_all if Projects.projects.empty? puts "No projects defined." return end Projects.projects.each do |project| Tasks::PullProject.perform(project, force?) end end |
#pull_project(project) ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/greenhouse/commands/pull.rb', line 38 def pull_project(project) unless project.exists? puts "Project #{project.title.cyan} does not exist. Try initializing it with `greenhouse init`" return end Tasks::PullProject.perform(project, force?) end |