Copied initial project structure from Raven
This commit is contained in:
20
lib/config.rb
Normal file
20
lib/config.rb
Normal file
@ -0,0 +1,20 @@
|
||||
require 'yaml'
|
||||
|
||||
class Config
|
||||
|
||||
def initialize(config_path)
|
||||
@data = YAML::load_file(config_path)
|
||||
end
|
||||
|
||||
def get(key, depth = 0)
|
||||
bits = key.split('.')
|
||||
value = @data
|
||||
|
||||
bits.each do |bit|
|
||||
value = value[bit]
|
||||
end
|
||||
|
||||
return value
|
||||
end
|
||||
|
||||
end
|
21
lib/helpers.rb
Normal file
21
lib/helpers.rb
Normal file
@ -0,0 +1,21 @@
|
||||
helpers do
|
||||
|
||||
def nullable(value)
|
||||
if (value) and (value != '')
|
||||
return value
|
||||
else
|
||||
return 'N/a'
|
||||
end
|
||||
end
|
||||
|
||||
def date_format(date)
|
||||
dt = date.to_datetime
|
||||
return dt.strftime('%B %d, %Y @ %I:%M:%S %p %Z')
|
||||
end
|
||||
|
||||
def date_format_input(date)
|
||||
dt = date.to_datetime
|
||||
return dt.strftime('%Y-%m-%dT%H:%M:%S')
|
||||
end
|
||||
|
||||
end
|
1
lib/routes.rb
Normal file
1
lib/routes.rb
Normal file
@ -0,0 +1 @@
|
||||
require_relative 'routes/index.rb'
|
10
lib/routes/index.rb
Normal file
10
lib/routes/index.rb
Normal file
@ -0,0 +1,10 @@
|
||||
namespace '/' do
|
||||
|
||||
get '' do
|
||||
erb :index, :locals => {
|
||||
:title => 'Dashboard'
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
Reference in New Issue
Block a user