Module: Basilisk::Template

Extended by:
Template
Included in:
Template
Defined in:
lib/basilisk/template.rb

Instance Method Summary collapse

Instance Method Details

#default(options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/basilisk/template.rb', line 5

def default(options={})
  yaml = <<-CONFIG
# This is a basilisk config file.
# Available processors include the following:
#   seo: generates a csv with the following columns: url, title, description, keywords, h1s, h2s
#   sitemap: generates an xml sitemap
#   image: generates a list of broken images and images lacking an alt tag.
#   error: generates a csv of urls returning html response codes other than success and redirect.
#
# Separate processors with a semi-colon:
#   processors: "seo; sitemap; error"
# Separate regex terms with a semi-colon:
#   regex_search_terms: "error\w+;invalid\w+"
# Separate css terms with a semi-colon:
#   css_search_terms: "#error_message; .error"
# Regex patterns separated with semi-colons
#   skip_url_patterns: "[0-9]+;some silly expression\s+;"
# Optionally specify a user agent:
#   user_agent: "sneaky-crawler"

basilisk:
  name: "#{options[:name]}"
  url: "#{options[:url]}"
  processors: "seo; sitemap; error"
  regex_search_terms: ""
  css_search_terms: ""
  skip_url_patterns: ""
  user_agent: "anemone-basilisk"
  CONFIG
end

#output_instructions(search_name, filename, foldername) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/basilisk/template.rb', line 36

def output_instructions(search_name, filename, foldername)
  instruction = <<-INSTRUCTIONS

You just created the following search: #{search_name}

If you'd like to change the default options, edit the file #{filename}

To run your search:

  basil run #{search_name}

Your search results will appear in #{foldername}

  INSTRUCTIONS
  puts instruction
end