cheaptoad 0.0.3 → 0.0.4

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/Manifest.txt CHANGED
@@ -4,6 +4,7 @@ Manifest.txt
4
4
  PostInstall.txt
5
5
  README.rdoc
6
6
  Rakefile
7
+ TODO
7
8
  app/controllers/notices_controller.rb
8
9
  app/models/notice.rb
9
10
  app/views/layouts/with_feed.html.erb
data/PostInstall.txt CHANGED
@@ -1,7 +1 @@
1
-
2
1
  For more information on cheaptoad, see http://cheaptoad.rubyforge.org
3
-
4
- NOTE: Change this information in PostInstall.txt
5
- You can also delete it if you don't want it.
6
-
7
-
data/TODO ADDED
@@ -0,0 +1,2 @@
1
+ Add "legal projects list" to make it annoying for attackers to send unlimited
2
+ false notices
@@ -1,11 +1,13 @@
1
1
  class NoticesController < ApplicationController
2
- def index
3
- if request.put? or request.post?
4
- notice = Notice.create_from_yaml(request.raw_post)
5
- notice.save!
2
+ def create
3
+ notice = Notice.create_from_yaml(request.raw_post)
4
+ notice.save!
5
+
6
+ render :text => "Successfully received error from hoptoad_notifier!"
7
+ end
6
8
 
7
- render :text => "Successfully received error from hoptoad_notifier!"
8
- elsif params[:api_key]
9
+ def index
10
+ if params[:api_key]
9
11
  @api_key = params[:api_key]
10
12
  @notices = Notice.find_all_by_api_key(@api_key)
11
13
  render :layout => "with_feed", :action => "list_notices"
data/app/models/notice.rb CHANGED
@@ -6,7 +6,12 @@ class Notice < ActiveRecord::Base
6
6
  full_yaml = full_yaml['notice'] if full_yaml['notice']
7
7
 
8
8
  notice = Notice.create(full_yaml)
9
- notice.backtrace_digest = Digest::SHA1.hexdigest(notice.backtrace)
9
+ if(notice.backtrace.kind_of? String)
10
+ backtraces = notice.backtrace
11
+ else
12
+ backtraces = notice.backtrace.join('\n')
13
+ end
14
+ notice.backtrace_digest = Digest::SHA1.hexdigest(backtraces)
10
15
 
11
16
  notice
12
17
  end
data/lib/cheaptoad.rb CHANGED
@@ -2,5 +2,5 @@ $:.unshift(File.dirname(__FILE__)) unless
2
2
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
3
 
4
4
  module Cheaptoad
5
- VERSION = '0.0.3'
5
+ VERSION = '0.0.4'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheaptoad
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Gibbs
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-10-21 00:00:00 -07:00
12
+ date: 2009-10-23 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -52,6 +52,7 @@ files:
52
52
  - PostInstall.txt
53
53
  - README.rdoc
54
54
  - Rakefile
55
+ - TODO
55
56
  - app/controllers/notices_controller.rb
56
57
  - app/models/notice.rb
57
58
  - app/views/layouts/with_feed.html.erb