class Ruboty::Handlers::Bundler::Install

Public Class Methods

new(gemfile_content) click to toggle source

@param gemfile_content [String] Content of Gemfile.

# File lib/ruboty/handlers/bundler.rb, line 238
def initialize(gemfile_content)
  @gemfile_content = gemfile_content
end

Public Instance Methods

call() click to toggle source

@return [String] Content of Gemfile.lock.

# File lib/ruboty/handlers/bundler.rb, line 243
def call
  File.delete(".bundle/config") rescue nil
  Dir.mktmpdir do |dir|
    Dir.chdir(dir) do
      File.write("Gemfile", @gemfile_content)
      ::Bundler.with_clean_env do
        Ruboty.logger.debug(`bundle install --no-deployment`)
      end
      File.read("Gemfile.lock")
    end
  end
end