/usr/lib/ruby/vendor_ruby/simple_navigation/config_file.rb is in ruby-simple-navigation 4.0.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 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 35 36 | require 'active_support/core_ext/string'
module SimpleNavigation
# Internal: Encapsulates the config file naming knowledge.
class ConfigFile
# Internal: Initializes a ConfigFile.
#
# context - The navigation context for this ConfigFile.
def initialize(context)
@prefix = prefix_for_context(context)
end
# Internal: Returns the name of the configuration file on disk.
#
# Based on the the initialization context the outcome may differ.
#
# Examples
#
# ConfigFile.new.name # => "navigation.rb"
# ConfigFile.new(:default).name # => "navigation.rb"
# ConfigFile.new(:other).name # => "other_navigation.rb"
#
# Returns a String representing the name of the configuration file on disk.
def name
@name ||= "#{prefix}navigation.rb"
end
private
attr_reader :prefix
def prefix_for_context(context)
context == :default ? '' : "#{context.to_s.underscore}_"
end
end
end
|