Class: DisavowTool::DisavowList

Inherits:
List
  • Object
show all
Includes:
DomainAndUrl
Defined in:
lib/disavow_tool/disavow_list.rb

Instance Attribute Summary

Attributes included from DomainAndUrl

#domains, #links

Instance Method Summary collapse

Methods included from DomainAndUrl

#add_domain, #add_domain_from_url, #add_domain_prefix, #add_url, #clean_line!, #domain_or_url, #finished_import_hook, #is_url?, #remove_domain_prefix, #remove_domain_prefix!, #summary, #total_elements

Methods inherited from List

#add_domain, #add_url, #clean_line!, #comment?, #count, #delete_url, #delete_urls_if_domains, #each, #export, #import, #mass_delete_urls, #new, #restore, #summary, #to_a

Constructor Details

#initialize(import_files = nil) ⇒ DisavowList

Returns a new instance of DisavowList.



9
10
11
12
# File 'lib/disavow_tool/disavow_list.rb', line 9

def initialize(import_files=nil)
  import_files = import_files || OPTIONS.disavow_files
  super(import_files)
end

Instance Method Details

#add_url_message(url) ⇒ Object



17
18
19
# File 'lib/disavow_tool/disavow_list.rb', line 17

def add_url_message(url)
  "+++ Inserting #{is_url?(url).to_s} #{url.on_yellow} in Disavow"
end

#export_write(file) ⇒ Object



26
27
28
29
30
# File 'lib/disavow_tool/disavow_list.rb', line 26

def export_write(file)
  file.puts "# Disavow"
  super(file)
  puts "Writing #{total_elements} elements into the Disavow file".blue if @verbose
end

#import_message(domain) ⇒ Object



14
15
16
# File 'lib/disavow_tool/disavow_list.rb', line 14

def import_message(domain)
  "Importing #{is_url?(domain).to_s} #{remove_domain_prefix(domain)} into Disavow list"
end

#mensaje_sumary_before_exportObject



21
# File 'lib/disavow_tool/disavow_list.rb', line 21

def mensaje_sumary_before_export; "Disavow elements before exporting" end

#message_sumary_domains_importedObject



24
# File 'lib/disavow_tool/disavow_list.rb', line 24

def message_sumary_domains_imported; "Disavowed Domains:" end

#message_sumary_importedObject



20
# File 'lib/disavow_tool/disavow_list.rb', line 20

def message_sumary_imported; "Disavowed elements imported" end


23
# File 'lib/disavow_tool/disavow_list.rb', line 23

def message_sumary_links_imported; "Disavowed URLs:" end