Class: About::Server

Inherits:
Sinatra::Base
  • Object
show all
Includes:
TextUtils::HypertextHelper
Defined in:
lib/about/server.rb

Constant Summary collapse

PUBLIC_FOLDER =
"#{About.root}/lib/about/public"
VIEWS_FOLDER =
"#{About.root}/lib/about/views"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details



18
19
20
# File 'lib/about/server.rb', line 18

def self.banner
  "about #{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] on Sinatra/#{Sinatra::VERSION} (#{ENV['RACK_ENV']})"
end

Instance Method Details

#/Object

todo: add page for threads/thread list ?? why? why not?



81
82
83
# File 'lib/about/server.rb', line 81

get '/' do
  redirect( ruby_path )
end

#env_pathObject



56
57
58
# File 'lib/about/server.rb', line 56

def env_path
  "#{path_prefix}/env"
end

#path_prefixObject



44
45
46
# File 'lib/about/server.rb', line 44

def path_prefix
  request.script_name   # request.env['SCRIPT_NAME']
end

#rack_pathObject



52
53
54
# File 'lib/about/server.rb', line 52

def rack_path
  "#{path_prefix}/rack"
end

#rails_pathObject



64
65
66
# File 'lib/about/server.rb', line 64

def rails_path
  "#{path_prefix}/rails"
end

#root_pathObject



68
69
70
# File 'lib/about/server.rb', line 68

def root_path
  "#{path_prefix}/"
end

#ruby_pathObject



48
49
50
# File 'lib/about/server.rb', line 48

def ruby_path
  "#{path_prefix}/ruby"
end

#sinatra_pathObject



60
61
62
# File 'lib/about/server.rb', line 60

def sinatra_path
  "#{path_prefix}/sinatra"
end