Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 171
- Log:
Initial import of Beast 0.9 from downloaded Tarball. Beast is a Ruby
On Rails based forum application. The original tarball came from the
following location:http://s3.amazonaws.com/beast-forum/beast-0.9.tar.gz
The forum post which announced this version's availability was at:
http://beast.caboo.se/forums/1/topics/446
- Author:
- rool
- Date:
- Fri Mar 02 15:51:55 +0000 2007
- Size:
- 2170 Bytes
1 | class LoggedException < ActiveRecord::Base |
2 | class << self |
3 | def create_from_exception(controller, exception) |
4 | create! \ |
5 | :exception_class => exception.class.name, |
6 | :controller_name => controller.controller_name, |
7 | :action_name => controller.action_name, |
8 | :message => exception.message.inspect, |
9 | :backtrace => exception.backtrace, |
10 | :request => controller.request |
11 | end |
12 | |
13 | def find_exception_class_names |
14 | connection.select_values "SELECT DISTINCT exception_class FROM #{table_name} ORDER BY exception_class" |
15 | end |
16 | |
17 | def find_exception_controllers_and_actions |
18 | find(:all, :select => "DISTINCT controller_name, action_name", :order => "controller_name, action_name").collect(&:controller_action) |
19 | end |
20 | end |
21 | |
22 | def backtrace=(backtrace) |
23 | if backtrace.is_a?(String) |
24 | write_attribute :backtrace, backtrace |
25 | else |
26 | re = Regexp.new(/^#{Regexp.escape(rails_root)}/) |
27 | write_attribute(:backtrace, backtrace.collect { |line| Pathname.new(line.gsub(re, "[RAILS_ROOT]")).cleanpath.to_s } * "\n") |
28 | end |
29 | end |
30 | |
31 | def request=(request) |
32 | if request.is_a?(String) |
33 | write_attribute :request, request |
34 | else |
35 | max = request.env.keys.max { |a,b| a.length <=> b.length } |
36 | env = request.env.keys.sort.inject [] do |env, key| |
37 | env << '* ' + ("%*-s: %s" % [max.length, key, request.env[key].to_s.strip]) |
38 | end |
39 | write_attribute(:environment, (env << "* Process: #{$$}" << "* Server : #{`hostname -s`.chomp}") * "\n") |
40 | |
41 | write_attribute(:request, [ |
42 | "* URL: #{request.protocol}#{request.env["HTTP_HOST"]}#{request.request_uri}", |
43 | "* Parameters: #{request.parameters.inspect}", |
44 | "* Rails Root: #{rails_root}" |
45 | ] * "\n") |
46 | end |
47 | end |
48 | |
49 | def controller_action |
50 | "#{controller_name.camelcase}/#{action_name}" |
51 | end |
52 | |
53 | private |
54 | def sanitize_backtrace(trace) |
55 | re = Regexp.new(/^#{Regexp.escape(rails_root)}/) |
56 | trace.map { |line| Pathname.new(line.gsub(re, "[RAILS_ROOT]")).cleanpath.to_s } |
57 | end |
58 | |
59 | def rails_root |
60 | @rails_root ||= Pathname.new(RAILS_ROOT).cleanpath.to_s |
61 | end |
62 | end |