From 92f7f16b866579e2248e3b9fe1094135dbb5884e Mon Sep 17 00:00:00 2001 From: Andy Fleener Date: Mon, 20 Apr 2015 07:40:16 -0500 Subject: [PATCH] Stop using an attr_accessor in favor of setting instance variables and an attr_reader --- lib/gem-empty/command.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/gem-empty/command.rb b/lib/gem-empty/command.rb index e6c57a2..7e7b67a 100644 --- a/lib/gem-empty/command.rb +++ b/lib/gem-empty/command.rb @@ -5,11 +5,11 @@ require 'fileutils' class EmptyCommand < Gem::Command - attr_accessor :options + attr_reader :options def initialize super 'empty', 'Remove all gems from current GEM_HOME.' - self.options = { :install_dir => Gem.dir, :force => true, :executables => true } + @default_options = { :install_dir => Gem.dir, :force => true, :executables => true } end def arguments # :nodoc: @@ -31,7 +31,7 @@ def description # :nodoc: end def execute(opts = {}) - self.options = options.merge(opts) + @options = @default_options.merge(opts) uninstaller = Gem::Uninstaller.new(nil, options) uninstaller.remove_all(gem_dir_specs)