Class: BundleDepot::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/bundle_depot/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/bundle_depot/cli.rb', line 7

def self.exit_on_failure?
  true
end

Instance Method Details

#fetchObject



17
18
19
20
21
22
# File 'lib/bundle_depot/cli.rb', line 17

def fetch 
  BundleDepot::Cache.new.fetch
rescue GemfileNotFound
  say "Couldn't find Gemfile.lock"
  exit 1
end

#storeObject



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/bundle_depot/cli.rb', line 30

def store
  BundleDepot::Cache.new.store
rescue GemfileNotFound
  say "Couldn't find Gemfile.lock"
  exit 1
rescue BundleNotFound
  say "Couldn't find the cached bundle. Please run 'bundle-depot fetch' before calling this command..."
  exit 2
rescue RemoteConfigurationMissing
  say "Remote cache is not configured. Configured the SCP environment variables to run 'bundle-depot store'"
  exit 3
end