Sha256: 063a10e7ebc33a2e30f7f91ed4ea80cb6879f0df76af09b56adf39656f697efb

Contents?: true

Size: 784 Bytes

Versions: 10

Compression:

Stored size: 784 Bytes

Contents

# frozen_string_literal: true

require "bundler"
require "bundler/cli"
require "refinements/io"
require "refinements/pathname"

module Rubysmith
  module Extensions
    # Ensures gem dependencies are installed.
    class Bundler
      using Refinements::IO
      using Refinements::Pathname

      def self.call(...) = new(...).call

      def initialize configuration, client: ::Bundler::CLI
        @configuration = configuration
        @client = client
      end

      def call
        configuration.project_root.change_dir do
          client.start %w[install --quiet]
          STDOUT.squelch { client.start %w[lock --add-platform x86_64-linux --update] }
        end

        configuration
      end

      private

      attr_reader :configuration, :client
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rubysmith-6.10.0 lib/rubysmith/extensions/bundler.rb
rubysmith-6.9.0 lib/rubysmith/extensions/bundler.rb
rubysmith-6.6.0 lib/rubysmith/extensions/bundler.rb
rubysmith-6.5.0 lib/rubysmith/extensions/bundler.rb
rubysmith-6.4.0 lib/rubysmith/extensions/bundler.rb
rubysmith-6.3.0 lib/rubysmith/extensions/bundler.rb
rubysmith-6.2.1 lib/rubysmith/extensions/bundler.rb
rubysmith-6.2.0 lib/rubysmith/extensions/bundler.rb
rubysmith-6.1.0 lib/rubysmith/extensions/bundler.rb
rubysmith-6.0.0 lib/rubysmith/extensions/bundler.rb