Class: Bundler::CLI
- Inherits:
-
Object
- Object
- Bundler::CLI
- Defined in:
- lib/bundler/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
- #bundle ⇒ Object
- #cache ⇒ Object
- #exec ⇒ Object
-
#initialize(options) ⇒ CLI
constructor
A new instance of CLI.
- #list ⇒ Object
- #list_outdated ⇒ Object
- #prune ⇒ Object
- #run(command) ⇒ Object
Constructor Details
#initialize(options) ⇒ CLI
Returns a new instance of CLI.
33 34 35 36 |
# File 'lib/bundler/cli.rb', line 33 def initialize() = @environment = Bundler::Environment.load([:manifest]) end |
Class Method Details
.run(command, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/bundler/cli.rb', line 5 def self.run(command, = {}) new().run(command) rescue DefaultManifestNotFound => e Bundler.logger.error "Could not find a Gemfile to use" exit 3 rescue InvalidEnvironmentName => e Bundler.logger.error "Gemfile error: #{e.message}" exit 4 rescue InvalidRepository => e Bundler.logger.error e. exit 5 rescue VersionConflict => e Bundler.logger.error e. exit 6 rescue GemNotFound => e Bundler.logger.error e. exit 7 rescue InvalidCacheArgument => e Bundler.logger.error e. exit 8 rescue SourceNotCached => e Bundler.logger.error e. exit 9 rescue ManifestFileNotFound => e Bundler.logger.error e. exit 10 end |
Instance Method Details
#bundle ⇒ Object
38 39 40 |
# File 'lib/bundler/cli.rb', line 38 def bundle @environment.install() end |
#cache ⇒ Object
42 43 44 |
# File 'lib/bundler/cli.rb', line 42 def cache @environment.cache() end |
#exec ⇒ Object
58 59 60 61 62 |
# File 'lib/bundler/cli.rb', line 58 def exec @environment.setup_environment # w0t? super(*$command) end |
#list ⇒ Object
50 51 52 |
# File 'lib/bundler/cli.rb', line 50 def list @environment.list() end |
#list_outdated ⇒ Object
54 55 56 |
# File 'lib/bundler/cli.rb', line 54 def list_outdated @environment.list_outdated() end |
#prune ⇒ Object
46 47 48 |
# File 'lib/bundler/cli.rb', line 46 def prune @environment.prune() end |
#run(command) ⇒ Object
64 65 66 |
# File 'lib/bundler/cli.rb', line 64 def run(command) send(command) end |