tartarus 2.0.4 → 2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.rvmrc +1 -1
- data/Gemfile +7 -7
- data/Gemfile.lock +104 -85
- data/README.rdoc +1 -1
- data/lib/generators/tartarus/templates/app/views/exceptions/details.html.erb +3 -3
- data/lib/tartarus/logger.rb +2 -2
- data/spec/rails_app/.gitignore +15 -4
- data/spec/rails_app/Gemfile +35 -9
- data/spec/rails_app/Gemfile.lock +102 -83
- data/spec/rails_app/Rakefile +1 -1
- data/spec/rails_app/app/assets/javascripts/application.js +15 -0
- data/spec/rails_app/app/assets/stylesheets/application.css +13 -0
- data/spec/rails_app/app/controllers/logged_exceptions_controller.rb +5 -1
- data/spec/rails_app/app/views/layouts/application.html.erb +3 -3
- data/spec/rails_app/app/views/logged_exceptions/details.html.erb +3 -3
- data/spec/rails_app/config/application.rb +26 -7
- data/spec/rails_app/config/boot.rb +3 -10
- data/spec/rails_app/config/database.yml +4 -1
- data/spec/rails_app/config/environments/development.rb +17 -4
- data/spec/rails_app/config/environments/production.rb +31 -13
- data/spec/rails_app/config/environments/test.rb +9 -7
- data/spec/rails_app/config/exceptions.yml +2 -3
- data/spec/rails_app/config/initializers/inflections.rb +5 -0
- data/spec/rails_app/config/initializers/secret_token.rb +1 -1
- data/spec/rails_app/config/initializers/session_store.rb +1 -1
- data/spec/rails_app/config/initializers/wrap_parameters.rb +14 -0
- data/spec/rails_app/config/locales/en.yml +1 -1
- data/spec/rails_app/config/routes.rb +2 -2
- data/spec/rails_app/db/schema.rb +2 -1
- data/spec/rails_app/db/seeds.rb +2 -2
- data/spec/rails_app/public/500.html +0 -1
- data/spec/rails_app/public/index.html +241 -0
- data/spec/rails_app/spec/spec_helper.rb +0 -4
- data/spec/tartarus/logger_spec.rb +9 -3
- data/tartarus.gemspec +3 -4
- metadata +66 -95
- data/lib/tartarus/version.rb +0 -3
- data/spec/rails_app/.rspec +0 -1
- data/spec/rails_app/README +0 -256
- data/spec/rails_app/doc/README_FOR_APP +0 -2
- data/spec/rails_app/public/javascripts/application.js +0 -2
- data/spec/rails_app/public/javascripts/controls.js +0 -965
- data/spec/rails_app/public/javascripts/dragdrop.js +0 -974
- data/spec/rails_app/public/javascripts/effects.js +0 -1123
- data/spec/rails_app/public/javascripts/prototype.js +0 -6001
- data/spec/rails_app/public/javascripts/rails.js +0 -175
- data/spec/rails_app/vendor/plugins/.gitkeep +0 -0
- /data/spec/rails_app/{public → app/assets}/images/rails.png +0 -0
- /data/spec/rails_app/{lib/tasks → app/mailers}/.gitkeep +0 -0
- /data/spec/rails_app/{public/stylesheets → app/models}/.gitkeep +0 -0
- /data/spec/rails_app/db/migrate/{20101230191040_add_logged_exception_table.rb → 20120828161925_add_logged_exception_table.rb} +0 -0
@@ -23,7 +23,7 @@
|
|
23
23
|
<div id="request_information" class="togglable">
|
24
24
|
<h3><a class="toggle_link" href="javascript:void(0);">Request</a></h3>
|
25
25
|
<ul class="toggle_data">
|
26
|
-
<% @exception.request[
|
26
|
+
<% @exception.request['http_details'].each_pair do |key, value| %>
|
27
27
|
<% unless value.blank? %>
|
28
28
|
<li><strong><%= key %></strong> :
|
29
29
|
<% if value.is_a?(Hash) %>
|
@@ -51,7 +51,7 @@
|
|
51
51
|
<div id="session_information" class="togglable">
|
52
52
|
<h3><a class="toggle_link" href="javascript:void(0);">Session & Cookies</a></h3>
|
53
53
|
<ul class="toggle_data">
|
54
|
-
<% @exception.request[
|
54
|
+
<% @exception.request['session'].each_pair do |key, value| %>
|
55
55
|
<% unless value.blank? %>
|
56
56
|
<li><strong><%= key %></strong> :
|
57
57
|
<% if value.is_a?(Hash) %>
|
@@ -74,7 +74,7 @@
|
|
74
74
|
<div id="enviroment_information" class="togglable">
|
75
75
|
<h3><a class="toggle_link" href="javascript:void(0);">Enviroment</a></h3>
|
76
76
|
<ul class="toggle_data">
|
77
|
-
<% @exception.request[
|
77
|
+
<% @exception.request['enviroment'].each_pair do |key, value| %>
|
78
78
|
<% unless value.blank? %>
|
79
79
|
<li><strong><%= key%></strong> : <%= value %></li>
|
80
80
|
<% end %>
|
@@ -2,9 +2,12 @@ require File.expand_path('../boot', __FILE__)
|
|
2
2
|
|
3
3
|
require 'rails/all'
|
4
4
|
|
5
|
-
|
6
|
-
# you
|
7
|
-
Bundler.require(
|
5
|
+
if defined?(Bundler)
|
6
|
+
# If you precompile assets before deploying to production, use this line
|
7
|
+
Bundler.require(*Rails.groups(:assets => %w(development test)))
|
8
|
+
# If you want your assets lazily compiled in production, use this line
|
9
|
+
# Bundler.require(:default, :assets, Rails.env)
|
10
|
+
end
|
8
11
|
|
9
12
|
module RailsApp
|
10
13
|
class Application < Rails::Application
|
@@ -30,14 +33,30 @@ module RailsApp
|
|
30
33
|
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
31
34
|
# config.i18n.default_locale = :de
|
32
35
|
|
33
|
-
# JavaScript files you want as :defaults (application.js is always included).
|
34
|
-
# config.action_view.javascript_expansions[:defaults] = %w(jquery rails)
|
35
|
-
|
36
36
|
# Configure the default encoding used in templates for Ruby 1.9.
|
37
37
|
config.encoding = "utf-8"
|
38
38
|
|
39
39
|
# Configure sensitive parameters which will be filtered from the log file.
|
40
40
|
config.filter_parameters += [:password]
|
41
|
-
|
41
|
+
|
42
|
+
# Enable escaping HTML in JSON.
|
43
|
+
config.active_support.escape_html_entities_in_json = true
|
44
|
+
|
45
|
+
# Use SQL instead of Active Record's schema dumper when creating the database.
|
46
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
47
|
+
# like if you have constraints or database-specific column types
|
48
|
+
# config.active_record.schema_format = :sql
|
49
|
+
|
50
|
+
# Enforce whitelist mode for mass assignment.
|
51
|
+
# This will create an empty whitelist of attributes available for mass-assignment for all models
|
52
|
+
# in your app. As such, your models will need to explicitly whitelist or blacklist accessible
|
53
|
+
# parameters by using an attr_accessible or attr_protected declaration.
|
54
|
+
config.active_record.whitelist_attributes = true
|
55
|
+
|
56
|
+
# Enable the asset pipeline
|
57
|
+
config.assets.enabled = true
|
58
|
+
|
59
|
+
# Version of your assets, change this if you want to expire all your assets
|
60
|
+
config.assets.version = '1.0'
|
42
61
|
end
|
43
62
|
end
|
@@ -1,13 +1,6 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
|
3
3
|
# Set up gems listed in the Gemfile.
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
require 'bundler'
|
8
|
-
Bundler.setup
|
9
|
-
rescue Bundler::GemNotFound => e
|
10
|
-
STDERR.puts e.message
|
11
|
-
STDERR.puts "Try running `bundle install`."
|
12
|
-
exit!
|
13
|
-
end if File.exist?(gemfile)
|
4
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
5
|
+
|
6
|
+
require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
|
@@ -2,8 +2,8 @@ RailsApp::Application.configure do
|
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
4
|
# In the development environment your application's code is reloaded on
|
5
|
-
# every request.
|
6
|
-
# since you don't have to restart the
|
5
|
+
# every request. This slows down response time but is perfect for development
|
6
|
+
# since you don't have to restart the web server when you make code changes.
|
7
7
|
config.cache_classes = false
|
8
8
|
|
9
9
|
# Log error messages when you accidentally call methods on nil.
|
@@ -11,7 +11,6 @@ RailsApp::Application.configure do
|
|
11
11
|
|
12
12
|
# Show full error reports and disable caching
|
13
13
|
config.consider_all_requests_local = true
|
14
|
-
config.action_view.debug_rjs = true
|
15
14
|
config.action_controller.perform_caching = false
|
16
15
|
|
17
16
|
# Don't care if the mailer can't send
|
@@ -22,5 +21,19 @@ RailsApp::Application.configure do
|
|
22
21
|
|
23
22
|
# Only use best-standards-support built into browsers
|
24
23
|
config.action_dispatch.best_standards_support = :builtin
|
25
|
-
end
|
26
24
|
|
25
|
+
# Raise exception on mass assignment protection for Active Record models
|
26
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
27
|
+
|
28
|
+
# Log the query plan for queries taking more than this (works
|
29
|
+
# with SQLite, MySQL, and PostgreSQL)
|
30
|
+
config.active_record.auto_explain_threshold_in_seconds = 0.5
|
31
|
+
|
32
|
+
# Do not compress assets
|
33
|
+
config.assets.compress = false
|
34
|
+
|
35
|
+
# Expands the lines which load the assets
|
36
|
+
config.assets.debug = true
|
37
|
+
|
38
|
+
config.middleware.use 'Tartarus::Rack'
|
39
|
+
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
RailsApp::Application.configure do
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
|
-
# The production environment is meant for finished, "live" apps.
|
5
4
|
# Code is not reloaded between requests
|
6
5
|
config.cache_classes = true
|
7
6
|
|
@@ -9,31 +8,46 @@ RailsApp::Application.configure do
|
|
9
8
|
config.consider_all_requests_local = false
|
10
9
|
config.action_controller.perform_caching = true
|
11
10
|
|
12
|
-
#
|
13
|
-
config.
|
11
|
+
# Disable Rails's static asset server (Apache or nginx will already do this)
|
12
|
+
config.serve_static_assets = false
|
13
|
+
|
14
|
+
# Compress JavaScripts and CSS
|
15
|
+
config.assets.compress = true
|
16
|
+
|
17
|
+
# Don't fallback to assets pipeline if a precompiled asset is missed
|
18
|
+
config.assets.compile = false
|
19
|
+
|
20
|
+
# Generate digests for assets URLs
|
21
|
+
config.assets.digest = true
|
22
|
+
|
23
|
+
# Defaults to nil and saved in location specified by config.assets.prefix
|
24
|
+
# config.assets.manifest = YOUR_PATH
|
14
25
|
|
15
|
-
#
|
16
|
-
# config.action_dispatch.x_sendfile_header =
|
26
|
+
# Specifies the header that your server uses for sending files
|
27
|
+
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
|
28
|
+
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
|
17
29
|
|
18
|
-
#
|
19
|
-
#
|
30
|
+
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
31
|
+
# config.force_ssl = true
|
20
32
|
|
21
33
|
# See everything in the log (default is :info)
|
22
34
|
# config.log_level = :debug
|
23
35
|
|
36
|
+
# Prepend all log lines with the following tags
|
37
|
+
# config.log_tags = [ :subdomain, :uuid ]
|
38
|
+
|
24
39
|
# Use a different logger for distributed setups
|
25
|
-
# config.logger = SyslogLogger.new
|
40
|
+
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
|
26
41
|
|
27
42
|
# Use a different cache store in production
|
28
43
|
# config.cache_store = :mem_cache_store
|
29
44
|
|
30
|
-
#
|
31
|
-
# In production, Apache or nginx will already do this
|
32
|
-
config.serve_static_assets = false
|
33
|
-
|
34
|
-
# Enable serving of images, stylesheets, and javascripts from an asset server
|
45
|
+
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
35
46
|
# config.action_controller.asset_host = "http://assets.example.com"
|
36
47
|
|
48
|
+
# Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
|
49
|
+
# config.assets.precompile += %w( search.js )
|
50
|
+
|
37
51
|
# Disable delivery errors, bad email addresses will be ignored
|
38
52
|
# config.action_mailer.raise_delivery_errors = false
|
39
53
|
|
@@ -46,4 +60,8 @@ RailsApp::Application.configure do
|
|
46
60
|
|
47
61
|
# Send deprecation notices to registered listeners
|
48
62
|
config.active_support.deprecation = :notify
|
63
|
+
|
64
|
+
# Log the query plan for queries taking more than this (works
|
65
|
+
# with SQLite, MySQL, and PostgreSQL)
|
66
|
+
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
49
67
|
end
|
@@ -2,12 +2,16 @@ RailsApp::Application.configure do
|
|
2
2
|
# Settings specified here will take precedence over those in config/application.rb
|
3
3
|
|
4
4
|
# The test environment is used exclusively to run your application's
|
5
|
-
# test suite.
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
6
|
# your test database is "scratch space" for the test suite and is wiped
|
7
|
-
# and recreated between test runs.
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
8
|
config.cache_classes = true
|
9
9
|
|
10
|
-
#
|
10
|
+
# Configure static asset server for tests with Cache-Control for performance
|
11
|
+
config.serve_static_assets = true
|
12
|
+
config.static_cache_control = "public, max-age=3600"
|
13
|
+
|
14
|
+
# Log error messages when you accidentally call methods on nil
|
11
15
|
config.whiny_nils = true
|
12
16
|
|
13
17
|
# Show full error reports and disable caching
|
@@ -25,10 +29,8 @@ RailsApp::Application.configure do
|
|
25
29
|
# ActionMailer::Base.deliveries array.
|
26
30
|
config.action_mailer.delivery_method = :test
|
27
31
|
|
28
|
-
#
|
29
|
-
|
30
|
-
# like if you have constraints or database-specific column types
|
31
|
-
# config.active_record.schema_format = :sql
|
32
|
+
# Raise exception on mass assignment protection for Active Record models
|
33
|
+
config.active_record.mass_assignment_sanitizer = :strict
|
32
34
|
|
33
35
|
# Print deprecation notices to the stderr
|
34
36
|
config.active_support.deprecation = :stderr
|
@@ -4,15 +4,14 @@ development:
|
|
4
4
|
notification_address:
|
5
5
|
notification_sender: noreply@example.com
|
6
6
|
notification_threshold: 10
|
7
|
+
notification_prefix: (dev)
|
7
8
|
test:
|
8
9
|
logging_enabled: false
|
9
10
|
logger_class: LoggedException
|
10
|
-
notification_address:
|
11
|
-
notification_sender: noreply@example.com
|
12
|
-
notification_threshold: 10
|
13
11
|
production:
|
14
12
|
logging_enabled: true
|
15
13
|
logger_class: LoggedException
|
16
14
|
notification_address:
|
17
15
|
notification_sender: noreply@example.com
|
18
16
|
notification_threshold: 10
|
17
|
+
notification_prefix: (production)
|
@@ -4,4 +4,4 @@
|
|
4
4
|
# If you change this key, all old signed cookies will become invalid!
|
5
5
|
# Make sure the secret is at least 30 characters and all random,
|
6
6
|
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
-
RailsApp::Application.config.secret_token = '
|
7
|
+
RailsApp::Application.config.secret_token = '8b3716da7c155753562df175c4e622c49a76469adeeb4ff78046a54e38d054dc91d1780a74539510c26c3ae02798a35db2ac767ef2426d6d8e0272454c1c499f'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# Be sure to restart your server when you modify this file.
|
2
2
|
|
3
|
-
RailsApp::Application.config.session_store :cookie_store, :
|
3
|
+
RailsApp::Application.config.session_store :cookie_store, key: '_rails_app_session'
|
4
4
|
|
5
5
|
# Use the database for sessions instead of the cookie-based default,
|
6
6
|
# which shouldn't be used to store highly confidential information
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
#
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json]
|
9
|
+
end
|
10
|
+
|
11
|
+
# Disable root element in JSON by default.
|
12
|
+
ActiveSupport.on_load(:active_record) do
|
13
|
+
self.include_root_in_json = false
|
14
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
# Sample localization file for English. Add more files in this directory for other locales.
|
2
|
-
# See
|
2
|
+
# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
3
3
|
|
4
4
|
en:
|
5
5
|
hello: "Hello world"
|
@@ -48,11 +48,11 @@ RailsApp::Application.routes.draw do
|
|
48
48
|
|
49
49
|
# You can have the root of your site routed with "root"
|
50
50
|
# just remember to delete public/index.html.
|
51
|
-
root :to =>
|
51
|
+
# root :to => 'welcome#index'
|
52
52
|
|
53
53
|
# See how all your routes lay out with "rake routes"
|
54
54
|
|
55
55
|
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
56
56
|
# Note: This route will make all actions in every controller accessible via GET requests.
|
57
|
-
match ':controller(/:action(/:id(.:format)
|
57
|
+
match ':controller(/:action(/:id))(.:format)'
|
58
58
|
end
|
data/spec/rails_app/db/schema.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: UTF-8
|
1
2
|
# This file is auto-generated from the current state of the database. Instead
|
2
3
|
# of editing this file, please use the migrations feature of Active Record to
|
3
4
|
# incrementally modify your database, and then regenerate this schema definition.
|
@@ -10,7 +11,7 @@
|
|
10
11
|
#
|
11
12
|
# It's strongly recommended to check this file into your version control system.
|
12
13
|
|
13
|
-
ActiveRecord::Schema.define(:version =>
|
14
|
+
ActiveRecord::Schema.define(:version => 20120828161925) do
|
14
15
|
|
15
16
|
create_table "logged_exceptions", :force => true do |t|
|
16
17
|
t.string "group_id"
|
data/spec/rails_app/db/seeds.rb
CHANGED
@@ -3,5 +3,5 @@
|
|
3
3
|
#
|
4
4
|
# Examples:
|
5
5
|
#
|
6
|
-
# cities = City.create([{ :
|
7
|
-
# Mayor.create(:
|
6
|
+
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
|
7
|
+
# Mayor.create(name: 'Emanuel', city: cities.first)
|
@@ -0,0 +1,241 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Ruby on Rails: Welcome aboard</title>
|
5
|
+
<style type="text/css" media="screen">
|
6
|
+
body {
|
7
|
+
margin: 0;
|
8
|
+
margin-bottom: 25px;
|
9
|
+
padding: 0;
|
10
|
+
background-color: #f0f0f0;
|
11
|
+
font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
|
12
|
+
font-size: 13px;
|
13
|
+
color: #333;
|
14
|
+
}
|
15
|
+
|
16
|
+
h1 {
|
17
|
+
font-size: 28px;
|
18
|
+
color: #000;
|
19
|
+
}
|
20
|
+
|
21
|
+
a {color: #03c}
|
22
|
+
a:hover {
|
23
|
+
background-color: #03c;
|
24
|
+
color: white;
|
25
|
+
text-decoration: none;
|
26
|
+
}
|
27
|
+
|
28
|
+
|
29
|
+
#page {
|
30
|
+
background-color: #f0f0f0;
|
31
|
+
width: 750px;
|
32
|
+
margin: 0;
|
33
|
+
margin-left: auto;
|
34
|
+
margin-right: auto;
|
35
|
+
}
|
36
|
+
|
37
|
+
#content {
|
38
|
+
float: left;
|
39
|
+
background-color: white;
|
40
|
+
border: 3px solid #aaa;
|
41
|
+
border-top: none;
|
42
|
+
padding: 25px;
|
43
|
+
width: 500px;
|
44
|
+
}
|
45
|
+
|
46
|
+
#sidebar {
|
47
|
+
float: right;
|
48
|
+
width: 175px;
|
49
|
+
}
|
50
|
+
|
51
|
+
#footer {
|
52
|
+
clear: both;
|
53
|
+
}
|
54
|
+
|
55
|
+
#header, #about, #getting-started {
|
56
|
+
padding-left: 75px;
|
57
|
+
padding-right: 30px;
|
58
|
+
}
|
59
|
+
|
60
|
+
|
61
|
+
#header {
|
62
|
+
background-image: url("assets/rails.png");
|
63
|
+
background-repeat: no-repeat;
|
64
|
+
background-position: top left;
|
65
|
+
height: 64px;
|
66
|
+
}
|
67
|
+
#header h1, #header h2 {margin: 0}
|
68
|
+
#header h2 {
|
69
|
+
color: #888;
|
70
|
+
font-weight: normal;
|
71
|
+
font-size: 16px;
|
72
|
+
}
|
73
|
+
|
74
|
+
|
75
|
+
#about h3 {
|
76
|
+
margin: 0;
|
77
|
+
margin-bottom: 10px;
|
78
|
+
font-size: 14px;
|
79
|
+
}
|
80
|
+
|
81
|
+
#about-content {
|
82
|
+
background-color: #ffd;
|
83
|
+
border: 1px solid #fc0;
|
84
|
+
margin-left: -55px;
|
85
|
+
margin-right: -10px;
|
86
|
+
}
|
87
|
+
#about-content table {
|
88
|
+
margin-top: 10px;
|
89
|
+
margin-bottom: 10px;
|
90
|
+
font-size: 11px;
|
91
|
+
border-collapse: collapse;
|
92
|
+
}
|
93
|
+
#about-content td {
|
94
|
+
padding: 10px;
|
95
|
+
padding-top: 3px;
|
96
|
+
padding-bottom: 3px;
|
97
|
+
}
|
98
|
+
#about-content td.name {color: #555}
|
99
|
+
#about-content td.value {color: #000}
|
100
|
+
|
101
|
+
#about-content ul {
|
102
|
+
padding: 0;
|
103
|
+
list-style-type: none;
|
104
|
+
}
|
105
|
+
|
106
|
+
#about-content.failure {
|
107
|
+
background-color: #fcc;
|
108
|
+
border: 1px solid #f00;
|
109
|
+
}
|
110
|
+
#about-content.failure p {
|
111
|
+
margin: 0;
|
112
|
+
padding: 10px;
|
113
|
+
}
|
114
|
+
|
115
|
+
|
116
|
+
#getting-started {
|
117
|
+
border-top: 1px solid #ccc;
|
118
|
+
margin-top: 25px;
|
119
|
+
padding-top: 15px;
|
120
|
+
}
|
121
|
+
#getting-started h1 {
|
122
|
+
margin: 0;
|
123
|
+
font-size: 20px;
|
124
|
+
}
|
125
|
+
#getting-started h2 {
|
126
|
+
margin: 0;
|
127
|
+
font-size: 14px;
|
128
|
+
font-weight: normal;
|
129
|
+
color: #333;
|
130
|
+
margin-bottom: 25px;
|
131
|
+
}
|
132
|
+
#getting-started ol {
|
133
|
+
margin-left: 0;
|
134
|
+
padding-left: 0;
|
135
|
+
}
|
136
|
+
#getting-started li {
|
137
|
+
font-size: 18px;
|
138
|
+
color: #888;
|
139
|
+
margin-bottom: 25px;
|
140
|
+
}
|
141
|
+
#getting-started li h2 {
|
142
|
+
margin: 0;
|
143
|
+
font-weight: normal;
|
144
|
+
font-size: 18px;
|
145
|
+
color: #333;
|
146
|
+
}
|
147
|
+
#getting-started li p {
|
148
|
+
color: #555;
|
149
|
+
font-size: 13px;
|
150
|
+
}
|
151
|
+
|
152
|
+
|
153
|
+
#sidebar ul {
|
154
|
+
margin-left: 0;
|
155
|
+
padding-left: 0;
|
156
|
+
}
|
157
|
+
#sidebar ul h3 {
|
158
|
+
margin-top: 25px;
|
159
|
+
font-size: 16px;
|
160
|
+
padding-bottom: 10px;
|
161
|
+
border-bottom: 1px solid #ccc;
|
162
|
+
}
|
163
|
+
#sidebar li {
|
164
|
+
list-style-type: none;
|
165
|
+
}
|
166
|
+
#sidebar ul.links li {
|
167
|
+
margin-bottom: 5px;
|
168
|
+
}
|
169
|
+
|
170
|
+
.filename {
|
171
|
+
font-style: italic;
|
172
|
+
}
|
173
|
+
</style>
|
174
|
+
<script type="text/javascript">
|
175
|
+
function about() {
|
176
|
+
info = document.getElementById('about-content');
|
177
|
+
if (window.XMLHttpRequest)
|
178
|
+
{ xhr = new XMLHttpRequest(); }
|
179
|
+
else
|
180
|
+
{ xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
|
181
|
+
xhr.open("GET","rails/info/properties",false);
|
182
|
+
xhr.send("");
|
183
|
+
info.innerHTML = xhr.responseText;
|
184
|
+
info.style.display = 'block'
|
185
|
+
}
|
186
|
+
</script>
|
187
|
+
</head>
|
188
|
+
<body>
|
189
|
+
<div id="page">
|
190
|
+
<div id="sidebar">
|
191
|
+
<ul id="sidebar-items">
|
192
|
+
<li>
|
193
|
+
<h3>Browse the documentation</h3>
|
194
|
+
<ul class="links">
|
195
|
+
<li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
|
196
|
+
<li><a href="http://api.rubyonrails.org/">Rails API</a></li>
|
197
|
+
<li><a href="http://www.ruby-doc.org/core/">Ruby core</a></li>
|
198
|
+
<li><a href="http://www.ruby-doc.org/stdlib/">Ruby standard library</a></li>
|
199
|
+
</ul>
|
200
|
+
</li>
|
201
|
+
</ul>
|
202
|
+
</div>
|
203
|
+
|
204
|
+
<div id="content">
|
205
|
+
<div id="header">
|
206
|
+
<h1>Welcome aboard</h1>
|
207
|
+
<h2>You’re riding Ruby on Rails!</h2>
|
208
|
+
</div>
|
209
|
+
|
210
|
+
<div id="about">
|
211
|
+
<h3><a href="rails/info/properties" onclick="about(); return false">About your application’s environment</a></h3>
|
212
|
+
<div id="about-content" style="display: none"></div>
|
213
|
+
</div>
|
214
|
+
|
215
|
+
<div id="getting-started">
|
216
|
+
<h1>Getting started</h1>
|
217
|
+
<h2>Here’s how to get rolling:</h2>
|
218
|
+
|
219
|
+
<ol>
|
220
|
+
<li>
|
221
|
+
<h2>Use <code>rails generate</code> to create your models and controllers</h2>
|
222
|
+
<p>To see all available options, run it without parameters.</p>
|
223
|
+
</li>
|
224
|
+
|
225
|
+
<li>
|
226
|
+
<h2>Set up a default route and remove <span class="filename">public/index.html</span></h2>
|
227
|
+
<p>Routes are set up in <span class="filename">config/routes.rb</span>.</p>
|
228
|
+
</li>
|
229
|
+
|
230
|
+
<li>
|
231
|
+
<h2>Create your database</h2>
|
232
|
+
<p>Run <code>rake db:create</code> to create your database. If you're not using SQLite (the default), edit <span class="filename">config/database.yml</span> with your username and password.</p>
|
233
|
+
</li>
|
234
|
+
</ol>
|
235
|
+
</div>
|
236
|
+
</div>
|
237
|
+
|
238
|
+
<div id="footer"> </div>
|
239
|
+
</div>
|
240
|
+
</body>
|
241
|
+
</html>
|
@@ -3,10 +3,6 @@ ENV["RAILS_ENV"] ||= 'test'
|
|
3
3
|
require File.expand_path("../../config/environment", __FILE__)
|
4
4
|
require 'rspec/rails'
|
5
5
|
|
6
|
-
# Requires supporting ruby files with custom matchers and macros, etc,
|
7
|
-
# in spec/support/ and its subdirectories.
|
8
|
-
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
9
|
-
|
10
6
|
RSpec.configure do |config|
|
11
7
|
# == Mock Framework
|
12
8
|
#
|
@@ -33,7 +33,10 @@ describe Tartarus::Logger do
|
|
33
33
|
end
|
34
34
|
|
35
35
|
it 'should return the group count' do
|
36
|
-
e = LoggedException.
|
36
|
+
e = LoggedException.new
|
37
|
+
e.group_id = 'hash'
|
38
|
+
e.request = {}
|
39
|
+
|
37
40
|
LoggedException.should_receive( :count ).with( :conditions => ["group_id = ?", 'hash'] ).and_return( 42 )
|
38
41
|
e.group_count.should == 42
|
39
42
|
end
|
@@ -41,7 +44,8 @@ describe Tartarus::Logger do
|
|
41
44
|
describe '#handle_notifications' do
|
42
45
|
before(:each) do
|
43
46
|
@notification = stub('notification', :deliver => true)
|
44
|
-
@logged_exception = LoggedException.
|
47
|
+
@logged_exception = LoggedException.new
|
48
|
+
@logged_exception.request = {}
|
45
49
|
Tartarus.stub(:configuration).and_return({ 'notification_threshold' => 10, 'notification_address' => 'test@example.com', 'enabled' => true, "logger_class"=>"LoggedException" })
|
46
50
|
end
|
47
51
|
|
@@ -76,7 +80,9 @@ describe Tartarus::Logger do
|
|
76
80
|
describe 'when normalizing request data for tartarus' do
|
77
81
|
before(:each) do
|
78
82
|
@mock_env = { 'action_controller.instance' => stub('controller_instance', :request => fake_controller_request) }
|
79
|
-
@logged_exception = LoggedException.
|
83
|
+
@logged_exception = LoggedException.new
|
84
|
+
@logged_exception.request = {}
|
85
|
+
|
80
86
|
Tartarus.stub(:configuration).and_return({ 'notification_threshold' => 10, 'notification_address' => 'test@example.com', 'enabled' => true, "logger_class"=>"LoggedException" })
|
81
87
|
end
|
82
88
|
|