Sha256: bf25c1f965a05c1e89b280c14ea4d7b4532e7fb13bdf2bd126657cbee2607dff

Contents?: true

Size: 938 Bytes

Versions: 311

Compression:

Stored size: 938 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 = {})
        host_env = extra_options.delete(:host_env)
        super(host_env || ::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

311 entries across 311 versions & 4 rubygems

Version Path
eac_tools-0.52.0 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_tools-0.51.0 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_tools-0.50.0 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_ruby_utils-0.110.1 lib/eac_ruby_utils/ruby/command.rb
eac_tools-0.49.0 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_ruby_utils-0.110.0 lib/eac_ruby_utils/ruby/command.rb
eac_ruby_utils-0.109.1 lib/eac_ruby_utils/ruby/command.rb
eac_tools-0.48.1 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_tools-0.48.0 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_tools-0.47.2 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_ruby_utils-0.109.0 lib/eac_ruby_utils/ruby/command.rb
eac_tools-0.47.1 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_ruby_utils-0.108.0 lib/eac_ruby_utils/ruby/command.rb
eac_tools-0.47.0 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_tools-0.46.0 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_tools-0.45.2 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_tools-0.45.1 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_tools-0.45.0 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb
eac_ruby_utils-0.107.1 lib/eac_ruby_utils/ruby/command.rb
eac_tools-0.44.0 sub/eac_ruby_utils/lib/eac_ruby_utils/ruby/command.rb