config/defaults.rb in nagira-0.5.1 vs config/defaults.rb in nagira-0.5.2
- old
+ new
@@ -10,14 +10,14 @@
# and should be changed here.
DEFAULT = {
format_extensions: '\.(json|yaml|xml)$', # Regex for available
- # formats: xml, json, yaml
+ # formats: xml, json, yaml
format: :xml, # default format for application to send output, if
- # format is not specified
+ # format is not specified
# No path to file configuration file by default. Main nagios config
# is defined by +nagios_cfg_glob+ or by Sintra's
# +settings.nagios_cfg+ variable.
@@ -74,20 +74,28 @@
hostname_regex: ENV['NAGIOS_HOST_CUSTOM_REGEX'] || '\w([\w\-\.]+)?\w'
}
-require 'sinatra'
class Nagira < Sinatra::Base
-##
-# For every key in the DEFAULT hash create setting with the same name
-# and value. Values can be overrriden in environment.rb file if
-# required.
-# @method define_methods_for_defaults
-configure do
- ::DEFAULT.each do |key,val|
- set key,val
+ BASE = File.dirname(__dir__).freeze
+
+ VERSION = File.read("#{BASE}/version.txt").strip.freeze
+ GITHUB = "http://dmytro.github.com/nagira/".freeze
+ ##
+ # For every key in the DEFAULT hash create setting with the same name
+ # and value. Values can be overrriden in environment.rb file if
+ # required.
+ # @method define_methods_for_defaults
+ configure do
+ ::DEFAULT.each do |key,val|
+ set key,val
+ end
end
-end
+ ##
+ # When this prefix added to routes convert output to ActiveResource
+ # compatible format (basically Array instead of Hash).
+ #
+ AR_PREFIX = "/ar"
end