Class: Rookout::Augs::Locations::LocationFileLine

Inherits:
Location
  • Object
show all
Defined in:
lib/rookout/augs/locations/location_file_line.rb

Constant Summary collapse

NAME =
"file_line".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Location

#execute, #id, #notify_active, #notify_error, #notify_pending, #notify_removed, #notify_warning

Constructor Details

#initialize(arguments, output, aug) ⇒ LocationFileLine

Returns a new instance of LocationFileLine.



13
14
15
16
17
18
19
20
21
22
# File 'lib/rookout/augs/locations/location_file_line.rb', line 13

def initialize arguments, output, aug
  super output, aug
  @filename = arguments["filename"]
  @lineno = arguments["lineno"]

  # NOTE: Hashes are only used for suggestions, not for verification
  @file_hash = arguments["sha256"]
  @line_crc = arguments["line_crc32_2"]
  @line_unique = arguments["line_unique"] || false
end

Instance Attribute Details

#file_hashObject (readonly)

Returns the value of attribute file_hash.



26
27
28
# File 'lib/rookout/augs/locations/location_file_line.rb', line 26

def file_hash
  @file_hash
end

#filenameObject (readonly)

Returns the value of attribute filename.



24
25
26
# File 'lib/rookout/augs/locations/location_file_line.rb', line 24

def filename
  @filename
end

#line_crcObject (readonly)

Returns the value of attribute line_crc.



27
28
29
# File 'lib/rookout/augs/locations/location_file_line.rb', line 27

def line_crc
  @line_crc
end

#line_uniqueObject (readonly)

Returns the value of attribute line_unique.



28
29
30
# File 'lib/rookout/augs/locations/location_file_line.rb', line 28

def line_unique
  @line_unique
end

#linenoObject (readonly)

Returns the value of attribute lineno.



25
26
27
# File 'lib/rookout/augs/locations/location_file_line.rb', line 25

def lineno
  @lineno
end

Instance Method Details

#add_aug(trigger_services) ⇒ Object



30
31
32
33
34
35
36
37
38
# File 'lib/rookout/augs/locations/location_file_line.rb', line 30

def add_aug trigger_services
  trigger_services.get_service("position").add_aug self
rescue SystemExit
  raise
rescue Exception => e
  message = "Exception when adding aug"
  Logger.instance.error message, e
  notify_error Processor::RookError.new e, message
end