Module: DuckMap::ConfigHelpers

Extended by:
ActiveSupport::Concern
Defined in:
lib/duck_map/config.rb

Overview

A mixin the provide helper methods that gain access for configuration values from config/routes.rb.

Instance Method Summary collapse

Instance Method Details

#acts_as_sitemap(*args) ⇒ Object



349
350
351
# File 'lib/duck_map/config.rb', line 349

def acts_as_sitemap(*args)
  Config.acts_as_sitemap(*args)
end

#canonical(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



295
296
297
# File 'lib/duck_map/config.rb', line 295

def canonical(value)
  Config.canonical = value
end

#canonical_host(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



301
302
303
# File 'lib/duck_map/config.rb', line 301

def canonical_host(value)
  Config.canonical_host = value
end

#canonical_port(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



307
308
309
# File 'lib/duck_map/config.rb', line 307

def canonical_port(value)
  Config.canonical_port = value
end

#changefreq(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



275
276
277
# File 'lib/duck_map/config.rb', line 275

def changefreq(value)
  Config.changefreq = value
end

#compression(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



313
314
315
# File 'lib/duck_map/config.rb', line 313

def compression(value)
  Config.compression = value
end

#description(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



263
264
265
# File 'lib/duck_map/config.rb', line 263

def description(value)
  Config.description = value
end

#keywords(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



257
258
259
# File 'lib/duck_map/config.rb', line 257

def keywords(value)
  Config.keywords = value
end

#lastmod(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



269
270
271
# File 'lib/duck_map/config.rb', line 269

def lastmod(value)
  Config.lastmod = LastMod.to_date(value)
end

#log_level(value, options = {}) ⇒ Object

Sets the logging level.

# sets the logging level to :debug and full stack traces for exceptions.
MyApp::Application.routes.draw do
  log_level :debug, full: true
end

Parameters:

  • value (Symbol)

    The logger level to use. Valid values are:

    • :debug

    • :info

    • :warn

    • :error

    • :fatal

    • :unknown

  • options (Hash) (defaults to: {})

    Options Hash.

Options Hash (options):

  • :full (Symbol)

    Including full: true will include full stack traces for exceptions. Otherwise, stack traces are stripped and attempt to only include application traces.



242
243
244
245
246
247
# File 'lib/duck_map/config.rb', line 242

def log_level(value, options = {})
  DuckMap::Logger.log_level = value
  if options.has_key?(:full)
    DuckMap.logger.full_exception = options[:full]
  end
end

#priority(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



281
282
283
284
285
# File 'lib/duck_map/config.rb', line 281

def priority(value)
  unless value.blank?
    Config.priority = value.to_s
  end
end

#sitemap_content(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



319
320
321
# File 'lib/duck_map/config.rb', line 319

def sitemap_content(value)
  Config.sitemap_content = value
end

#sitemap_handler(*args) ⇒ Object



355
356
357
# File 'lib/duck_map/config.rb', line 355

def sitemap_handler(*args)
  Config.sitemap_handler(*args)
end

#sitemap_segments(*args) ⇒ Object



361
362
363
# File 'lib/duck_map/config.rb', line 361

def sitemap_segments(*args)
  Config.sitemap_segments(*args)
end

#static_host(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



325
326
327
# File 'lib/duck_map/config.rb', line 325

def static_host(value)
  Config.static_host = value
end

#static_port(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



331
332
333
# File 'lib/duck_map/config.rb', line 331

def static_port(value)
  Config.static_port = value
end

#static_target(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



337
338
339
# File 'lib/duck_map/config.rb', line 337

def static_target(value)
  Config.static_target = value
end

#title(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



251
252
253
# File 'lib/duck_map/config.rb', line 251

def title(value)
  Config.title = value
end

#url_format(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



289
290
291
# File 'lib/duck_map/config.rb', line 289

def url_format(value)
  Config.url_format = value
end

#url_limit(value) ⇒ Object

See DuckMap::ConfigHelpers Overview for details.



343
344
345
# File 'lib/duck_map/config.rb', line 343

def url_limit(value)
  Config.url_limit = value
end