Class: Ruboty::Handlers::Bundler::Install

Inherits:
Object
  • Object
show all
Defined in:
lib/ruboty/handlers/bundler.rb

Instance Method Summary collapse

Constructor Details

#initialize(gemfile_content) ⇒ Install

Returns a new instance of Install.

Parameters:

  • gemfile_content (String)

    Content of Gemfile.



234
235
236
# File 'lib/ruboty/handlers/bundler.rb', line 234

def initialize(gemfile_content)
  @gemfile_content = gemfile_content
end

Instance Method Details

#callString

Returns Content of Gemfile.lock.

Returns:

  • (String)

    Content of Gemfile.lock.



239
240
241
242
243
244
245
246
247
248
249
# File 'lib/ruboty/handlers/bundler.rb', line 239

def call
  Dir.mktmpdir do |dir|
    Dir.chdir(dir) do
      File.write("Gemfile", @gemfile_content)
      ::Bundler.with_clean_env do
        Ruboty.logger.debug(`bundle install`)
      end
      File.read("Gemfile.lock")
    end
  end
end