Class: Bundler::CLI::Exec
- Inherits:
-
Object
- Object
- Bundler::CLI::Exec
- Defined in:
- lib/bundler/cli/exec.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options, args) ⇒ Exec
constructor
A new instance of Exec.
- #run ⇒ Object
Constructor Details
#initialize(options, args) ⇒ Exec
Returns a new instance of Exec.
5 6 7 8 |
# File 'lib/bundler/cli/exec.rb', line 5 def initialize(, args) = @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
3 4 5 |
# File 'lib/bundler/cli/exec.rb', line 3 def args @args end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/bundler/cli/exec.rb', line 3 def end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/bundler/cli/exec.rb', line 10 def run Bundler.definition.validate_ruby! Bundler.load.setup_environment begin if RUBY_VERSION >= "2.0" @args << { :close_others => !.keep_file_descriptors? } elsif .keep_file_descriptors? Bundler.ui.warn "Ruby version #{RUBY_VERSION} defaults to keeping non-standard file descriptors on Kernel#exec." end # Run Kernel.exec(*args) rescue Errno::EACCES Bundler.ui.error "bundler: not executable: #{args.first}" exit 126 rescue Errno::ENOENT Bundler.ui.error "bundler: command not found: #{args.first}" Bundler.ui.warn "Install missing gem executables with `bundle install`" exit 127 rescue ArgumentError Bundler.ui.error "bundler: exec needs a command to run" exit 128 end end |