Sha256: dfc9b404717ae17316b2cfd9c466c6205258395703c4ef2c9ad6ee82eb586b8d

Contents?: true

Size: 875 Bytes

Versions: 68

Compression:

Stored size: 875 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/envs/command'
require 'eac_ruby_utils/ruby/on_clean_environment'

module EacRubyUtils
  module Ruby
    # A [EacRubyUtils::Envs::Command] which runs in a clean Ruby environment.
    class Command < ::EacRubyUtils::Envs::Command
      def initialize(bundle_args, extra_options = {})
        super(::EacRubyUtils::Envs.local, bundle_args, extra_options)
      end

      %w[system execute].each do |method_prefix|
        [method_prefix, "#{method_prefix}!"].each do |method_name|
          define_method method_name do |*args, &block|
            ::EacRubyUtils::Ruby.on_clean_environment do
              super(*args, &block)
            end
          end
        end
      end

      protected

      def duplicate(command, extra_options)
        self.class.new(gem, command, extra_options)
      end
    end
  end
end

Version data entries

68 entries across 68 versions & 3 rubygems

Version Path
avm-tools-0.70.2 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
ehbrs-tools-0.15.0 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
ehbrs-tools-0.14.1 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
avm-tools-0.70.1 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
avm-tools-0.70.0 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
avm-tools-0.69.3 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
ehbrs-tools-0.14.0 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
avm-tools-0.69.2 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
avm-tools-0.69.1 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_ruby_utils-0.46.0 lib/eac_ruby_utils/ruby/command.rb
avm-tools-0.69.0 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_ruby_utils-0.45.2 lib/eac_ruby_utils/ruby/command.rb
eac_ruby_utils-0.45.1 lib/eac_ruby_utils/ruby/command.rb
eac_ruby_utils-0.45.0 lib/eac_ruby_utils/ruby/command.rb
ehbrs-tools-0.13.1 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
avm-tools-0.68.0 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_ruby_utils-0.44.0 lib/eac_ruby_utils/ruby/command.rb
avm-tools-0.67.0 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
avm-tools-0.66.0 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
avm-tools-0.65.0 vendor/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb