Method: Scribo::Configuration#initialize

Defined in:
lib/scribo/configuration.rb

#initializeConfiguration

Returns a new instance of Configuration.



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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/scribo/configuration.rb', line 7

def initialize
  @logger = Logger.new(STDOUT)
  @logger.level = Logger::INFO
  @base_controller = '::ApplicationController'
  @supported_mime_types = {
    image: %w[image/gif image/png image/jpeg image/bmp image/webp image/svg+xml],
    text: %w[text/plain text/html application/json application/xml],
    style: %w[text/css],
    script: %w[text/javascript application/javascript application/x-javascript],
    audio: %w[audio/midi audio/mpeg audio/webm audio/ogg audio/wav],
    video: %w[video/webm video/ogg video/mp4],
    document: %w[application/msword application/vnd.ms-powerpoint application/vnd.ms-excel application/pdf
                 application/zip],
    font: %w[font/collection font/otf font/sfnt font/ttf font/woff font/woff2 application/font-ttf
             application/x-font-ttf application/vnd.ms-fontobject application/font-woff],
    other: %w[application/octet-stream]
  }
  @default_404_txt = '404 Not Found'
  @default_humans_txt = "    /* TEAM */\n    Your title: Your name.\n    Site: email, link to a contact form, etc.\n    Twitter: your Twitter username.\n    Location: City, Country.\n\n                            [...]\n\n    /* THANKS */\n    Name: name or url\n\n                            [...]\n\n    /* SITE */\n    Last update: YYYY/MM/DD\n    Standards: HTML5, CSS3,..\n    Components: Modernizr, jQuery, etc.\n    Software: Software used for the development\n  HUMANS_TXT\n  @default_robots_txt = <<~ROBOTS_TXT\n    # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file\n    #\n    # To ban all spiders from the entire site uncomment the next two lines:\n    # User-agent: *\n    # Disallow: /\n  ROBOTS_TXT\n\n  # Base64 encoded image/x-icon\n  @default_favicon_ico = 'AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA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3YG/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAt3YG/wAAAAC3dgb/t3YG/7d2Bv+3dgb/t3YG/7d2Bv+3dgb/t3YG8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAt3YG/7d2Bv+3dgb/t3YG/7d2Bv+3dgb/t3YG/7d2Bv8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC3dgb/t3YG/2hDA3O3dgb/t3YG/7d2Bv+3dgb/t3YG/QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC4dgeJAAAAALd2Bv+3dgb/t3YG/7d2Bv+zcgZ3//8AAL//AADB/wAAgn8AAIA/AACAHwAAgH8AAMAPAADABwAAwAcAAOAHAADgDwAA9AMAAPwDAAD+QQAA/6EAAA=='\n\n  # This needs an array of hashes, each hash MUST include an id, thumbnail and a url:\n  # [\n  #   { id: '7becd952-ae77-43ad-9bf7-ed4f8feb59fa', thumbnail: 'https://mysite.net/template1.png', url: 'https://mysite.net/template1.zip' }\n  # ]\n  #\n  # The id can be generated using: `SecureRandom.uuid`, or you can use integers\n  @templates = []\n\n  # Default site if no site is found, this can be nil, an actual site instance or a proc which will resolve a site instance.\n  @default_site = nil\nend\n"