Class: Rubomop::Mop::DeleteOption

Inherits:
Struct
  • Object
show all
Defined in:
lib/rubomop/mop.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#copObject

Returns the value of attribute cop

Returns:

  • (Object)

    the current value of cop



69
70
71
# File 'lib/rubomop/mop.rb', line 69

def cop
  @cop
end

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



69
70
71
# File 'lib/rubomop/mop.rb', line 69

def file
  @file
end

#run_rubocopObject

Returns the value of attribute run_rubocop

Returns:

  • (Object)

    the current value of run_rubocop



69
70
71
# File 'lib/rubomop/mop.rb', line 69

def run_rubocop
  @run_rubocop
end

#verboseObject

Returns the value of attribute verbose

Returns:

  • (Object)

    the current value of verbose



69
70
71
# File 'lib/rubomop/mop.rb', line 69

def verbose
  @verbose
end

Instance Method Details

#delete!Object



75
76
77
# File 'lib/rubomop/mop.rb', line 75

def delete!
  cop.delete!(file)
end


70
71
72
73
# File 'lib/rubomop/mop.rb', line 70

def print_message
  return unless verbose
  print "Deleting #{file} from #{cop.name}" if verbose
end

#rubocop_runnerObject



79
80
81
82
83
# File 'lib/rubomop/mop.rb', line 79

def rubocop_runner
  return unless run_rubocop
  print "\nbundle exec rubocop #{file} -aD\n"
  system("bundle exec rubocop #{file} -aD")
end