Sha256: 9dad04deed1662196876c66ebcb6bc848504b3ecbd3bf36cb17a922d0d6ee5f9

Contents?: true

Size: 1.31 KB

Versions: 3

Compression:

Stored size: 1.31 KB

Contents

require "thor"
require "bundler"
require "bundler/cli"

module BundleDepot
  class CLI < Thor
    def self.exit_on_failure?
      true
    end

    desc "fetch", "Fetch cached bundle package from remote storage"
    long_desc <<-D
      Bacon ipsum dolor sit amet fatback rump frankfurter ball tip pork
      meatball. Sausage hamburger bacon short ribs, meatball ball tip biltong
      tenderloin bresaola rump pastrami turkey kevin flank.
    D
    def fetch 
      unless File.exist?("Gemfile.lock")
        say "Couldn't find Gemfile.lock"
        exit 1
      end

      BundleDepot::Cache.new.fetch
    end

    desc "store", "Store bundle to remote location"
    long_desc <<-D
      Bacon ipsum dolor sit amet fatback rump frankfurter ball tip pork
      meatball. Sausage hamburger bacon short ribs, meatball ball tip biltong
      tenderloin bresaola rump pastrami turkey kevin flank.
    D
    def store
      unless File.exist?("Gemfile.lock")
        say "Couldn't find Gemfile.lock"
        exit 1
      end

      BundleDepot::Cache.new.store

    rescue BundleNotFound
      say "Couldn't find the cached bundle. Please run 'bundle-depot fetch' before calling this command..."
      exit 2

      # Calculate Checksum
      # Check local cache
      # Check remote cache
      #   Pack
      #   Upload
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
bundle_depot-0.0.3 lib/bundle_depot/cli.rb
bundle_depot-0.0.2 lib/bundle_depot/cli.rb
bundle_depot-0.0.1 lib/bundle_depot/cli.rb