Class: Teapot::Command::Fetch
- Inherits:
-
Samovar::Command
- Object
- Samovar::Command
- Teapot::Command::Fetch
- Defined in:
- lib/teapot/command/fetch.rb
Overview
A command to fetch remote packages and dependencies.
Instance Method Summary collapse
-
#call ⇒ Object
Update packages by pulling latest changes from their git remotes, subject to lock file constraints.
-
#context ⇒ Object
Get the context for this command.
Instance Method Details
#call ⇒ Object
Update packages by pulling latest changes from their git remotes, subject to lock file constraints.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/teapot/command/fetch.rb', line 46 def call selection = context.select packages = selection.configuration.packages if specified_packages = self.packages packages = packages.slice(specified_packages) end logger = parent.logger # If no additional packages were resolved, we have reached a fixed point: while packages.any? packages.each do |package| fetch_package(context, selection.configuration, package, logger, **@options) end selection = context.select # If there are no unresolved packages, we are done. if selection.unresolved.empty? break end packages = selection.unresolved end if selection.unresolved.count > 0 logger.error(self) do |buffer| buffer.puts "Could not fetch all packages!" selection.unresolved.each do |package| buffer.puts "\t#{package}" end end else logger.info "Completed fetch successfully." end end |
#context ⇒ Object
Get the context for this command.
41 42 43 |
# File 'lib/teapot/command/fetch.rb', line 41 def context parent.context end |