Sha256: 72323074ef58f1f8bf5cd124ea00d2bfdc6a25452e1da4b55d63f726daf0b592

Contents?: true

Size: 1023 Bytes

Versions: 35

Compression:

Stored size: 1023 Bytes

Contents

module Bundler
  class CLI::Exec
    attr_reader :options, :args

    def initialize(options, args)
      @options = options
      @args = args
    end

    def run
      Bundler.definition.validate_ruby!
      Bundler.load.setup_environment

      begin
        if RUBY_VERSION >= "2.0"
          @args << { :close_others => !options.keep_file_descriptors? }
        elsif options.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

  end
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
bundler-1.7.15 lib/bundler/cli/exec.rb
bundler-1.7.14 lib/bundler/cli/exec.rb
bundler-1.7.13 lib/bundler/cli/exec.rb
bundler-1.7.12 lib/bundler/cli/exec.rb
bundler-1.7.11 lib/bundler/cli/exec.rb
bundler-1.7.10 lib/bundler/cli/exec.rb
bundler-1.7.9 lib/bundler/cli/exec.rb
bundler-1.7.8 lib/bundler/cli/exec.rb
bundler-1.7.7 lib/bundler/cli/exec.rb
bundler-1.7.6 lib/bundler/cli/exec.rb
bundler-1.6.9 lib/bundler/cli/exec.rb
bundler-1.7.5 lib/bundler/cli/exec.rb
bundler-1.6.8 lib/bundler/cli/exec.rb
bundler-1.7.4 lib/bundler/cli/exec.rb
bundler-1.6.7 lib/bundler/cli/exec.rb
bundler-1.7.3 lib/bundler/cli/exec.rb
bundler-1.6.6 lib/bundler/cli/exec.rb
bundler-1.7.2 lib/bundler/cli/exec.rb
bundler-1.7.1 lib/bundler/cli/exec.rb
bundler-1.7.1.pre.3 lib/bundler/cli/exec.rb