merb-exceptions 1.0.15 → 1.1.0.pre

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,63 +1,65 @@
1
- require File.expand_path(File.join(File.dirname(__FILE__), "..", "rake_helpers"))
2
-
3
- ##############################################################################
4
- # Package && release
5
- ##############################################################################
6
- RUBY_FORGE_PROJECT = "merb"
7
- PROJECT_URL = "http://merbivore.com"
8
- PROJECT_SUMMARY = "Email and web hook exceptions for Merb."
9
- PROJECT_DESCRIPTION = PROJECT_SUMMARY
10
-
11
- GEM_AUTHOR = "Andy Kent"
12
- GEM_EMAIL = "andy@new-bamboo.co.uk"
13
-
14
- GEM_NAME = "merb-exceptions"
15
- PKG_BUILD = ENV['PKG_BUILD'] ? '.' + ENV['PKG_BUILD'] : ''
16
- GEM_VERSION = Merb::VERSION + PKG_BUILD
17
-
18
- RELEASE_NAME = "REL #{GEM_VERSION}"
19
-
20
- spec = Gem::Specification.new do |s|
21
- s.name = GEM_NAME
22
- s.version = GEM_VERSION
23
- s.platform = Gem::Platform::RUBY
24
- s.has_rdoc = true
25
- s.extra_rdoc_files = ["README.markdown", "LICENSE"]
26
- s.summary = PROJECT_SUMMARY
27
- s.description = PROJECT_DESCRIPTION
28
- s.author = GEM_AUTHOR
29
- s.email = GEM_EMAIL
30
- s.homepage = PROJECT_URL
31
- s.add_dependency('merb-core', "~> #{Merb::VERSION}")
32
- s.require_path = 'lib'
33
- s.files = %w(LICENSE README.markdown Rakefile) + Dir.glob("{lib,spec}/**/*")
34
- end
1
+ require 'rubygems'
2
+ require 'rake'
35
3
 
36
- Rake::GemPackageTask.new(spec) do |pkg|
37
- pkg.gem_spec = spec
38
- end
4
+ # Assume a typical dev checkout to fetch the current merb-core version
5
+ require File.expand_path('../../merb-core/lib/merb-core/version', __FILE__)
6
+
7
+ # Load this library's version information
8
+ require File.expand_path('../lib/merb-exceptions/version', __FILE__)
9
+
10
+ begin
11
+
12
+ gem 'jeweler', '~> 1.4'
13
+ require 'jeweler'
14
+
15
+ Jeweler::Tasks.new do |gemspec|
16
+
17
+ gemspec.version = Merb::Exceptions::VERSION
18
+
19
+ gemspec.name = "merb-exceptions"
20
+ gemspec.description = "Merb plugin that supports exception notification"
21
+ gemspec.summary = "Merb plugin that provides Email and web hook exceptions for Merb."
39
22
 
40
- desc "Install the gem"
41
- task :install do
42
- Merb::RakeHelper.install(GEM_NAME, :version => GEM_VERSION)
23
+ gemspec.authors = [ "Andy Kent" ]
24
+ gemspec.email = "andy@new-bamboo.co.uk"
25
+ gemspec.homepage = "http://merbivore.com/"
26
+
27
+ gemspec.files = %w(LICENSE Rakefile README.markdown TODO) + Dir['{lib,spec}/**/*']
28
+
29
+ # Runtime dependencies
30
+ gemspec.add_dependency 'merb-core', "~> #{Merb::VERSION}"
31
+ gemspec.add_dependency 'merb-mailer', "~> #{Merb::VERSION}"
32
+
33
+ # Development dependencies
34
+ gemspec.add_development_dependency 'rspec', '>= 1.2.9'
35
+
36
+ end
37
+
38
+ Jeweler::GemcutterTasks.new
39
+
40
+ rescue LoadError
41
+ puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
43
42
  end
44
43
 
45
- desc "Uninstall the gem"
46
- task :uninstall do
47
- Merb::RakeHelper.uninstall(GEM_NAME, :version => GEM_VERSION)
44
+ require 'spec/rake/spectask'
45
+ Spec::Rake::SpecTask.new(:spec) do |spec|
46
+ spec.spec_opts << '--options' << 'spec/spec.opts' if File.exists?('spec/spec.opts')
47
+ spec.libs << 'lib' << 'spec'
48
+ spec.spec_files = FileList['spec/**/*_spec.rb']
48
49
  end
49
50
 
50
- desc "Run all specs"
51
- Spec::Rake::SpecTask.new("spec") do |t|
52
- t.spec_opts = ["--format", "specdoc", "--colour"]
53
- t.spec_files = Dir["spec/**/*_spec.rb"].sort
51
+ Spec::Rake::SpecTask.new(:rcov) do |spec|
52
+ spec.libs << 'lib' << 'spec'
53
+ spec.pattern = 'spec/**/*_spec.rb'
54
+ spec.rcov = true
54
55
  end
55
56
 
56
- desc "Run all specs and generate an rcov report"
57
- Spec::Rake::SpecTask.new('rcov') do |t|
58
- t.spec_files = FileList['spec/**/*_spec.rb']
59
- t.spec_opts = ["--format", "specdoc", "--colour"]
60
- t.rcov = true
61
- t.rcov_dir = 'coverage'
62
- t.rcov_opts = ['--exclude', 'gems', '--exclude', 'spec']
57
+ task :default => :spec
58
+
59
+ require 'rake/rdoctask'
60
+ Rake::RDocTask.new do |rdoc|
61
+ rdoc.rdoc_dir = 'rdoc'
62
+ rdoc.title = "test_gem #{Merb::Exceptions::VERSION}"
63
+ rdoc.rdoc_files.include('README*')
64
+ rdoc.rdoc_files.include('lib/**/*.rb')
63
65
  end
data/TODO ADDED
File without changes
@@ -12,15 +12,23 @@ module MerbExceptions
12
12
  request = self.request
13
13
 
14
14
  details = {}
15
- details['exceptions'] = request.exceptions
16
- details['params'] = params
17
- details['environment'] = request.env.merge( 'process' => $$ )
18
- details['url'] = "#{request.protocol}#{request.env["HTTP_HOST"]}#{request.uri}"
15
+ details['exceptions'] = request.exceptions
16
+ details['params'] = params
17
+ details['params'] = self.class._filter_params(params)
18
+ details['environment'] = request.env.merge( 'process' => $$ )
19
+ details['url'] = "#{request.protocol}#{request.env["HTTP_HOST"]}#{request.uri}"
19
20
  MerbExceptions::Notification.new(details).deliver!
20
21
  rescue Exception => e
21
22
  exceptions = request.exceptions << e
22
23
  Merb.logger.fatal!("Exception Notification Failed:\n" + (exceptions).inspect)
23
- File.open(Merb.root / 'log' / 'notification_errors.log', 'a') do |log|
24
+
25
+ log_dir = Merb.root / 'log'
26
+ unless File.directory?(log_dir)
27
+ require 'fileutils'
28
+ FileUtils.mkdir_p(log_dir)
29
+ end
30
+
31
+ File.open(log_dir / 'notification_errors.log', 'a') do |log|
24
32
  log.puts("Exception Notification Failed:")
25
33
  exceptions.each do |e|
26
34
  log.puts(Merb.exception(e))
@@ -0,0 +1,5 @@
1
+ module Merb
2
+ module Exceptions
3
+ VERSION = '1.1.0.pre'.freeze
4
+ end
5
+ end
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe MerbExceptions::DefaultExceptionExtensions do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  describe MerbExceptions::DefaultExceptionExtensions do
4
4
 
@@ -1,4 +1,4 @@
1
- require File.dirname(__FILE__) + '/spec_helper'
1
+ require 'spec_helper'
2
2
 
3
3
  include MerbExceptions
4
4
  include NotificationSpecHelper
data/spec/spec.opts ADDED
@@ -0,0 +1,2 @@
1
+ --format specdoc
2
+ --colour
data/spec/spec_helper.rb CHANGED
@@ -1,9 +1,22 @@
1
- $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
2
1
  require "rubygems"
3
- require "merb-core"
4
- require "spec"
2
+
3
+ # Use current merb-core sources if running from a typical dev checkout.
4
+ lib = File.expand_path('../../../merb-core/lib', __FILE__)
5
+ $LOAD_PATH.unshift(lib) if File.directory?(lib)
6
+ require 'merb-core'
7
+
8
+ # Use current merb-mailer sources if running from a typical dev checkout.
9
+ lib = File.expand_path('../../../merb-mailer/lib', __FILE__)
10
+ $LOAD_PATH.unshift(lib) if File.directory?(lib)
11
+ require 'merb-mailer'
12
+
13
+ # The lib under test
5
14
  require "merb-exceptions"
6
15
 
16
+ # Satisfies Autotest and anyone else not using the Rake tasks
17
+ require 'spec'
18
+
19
+
7
20
  class Application < Merb::Controller
8
21
  end
9
22
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merb-exceptions
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.15
4
+ version: 1.1.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Kent
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-04 00:00:00 +00:00
12
+ date: 2010-02-20 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,37 +20,60 @@ dependencies:
20
20
  requirements:
21
21
  - - ~>
22
22
  - !ruby/object:Gem::Version
23
- version: 1.0.15
23
+ version: 1.1.0.pre
24
24
  version:
25
- description: Email and web hook exceptions for Merb.
25
+ - !ruby/object:Gem::Dependency
26
+ name: merb-mailer
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ~>
32
+ - !ruby/object:Gem::Version
33
+ version: 1.1.0.pre
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: rspec
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: 1.2.9
44
+ version:
45
+ description: Merb plugin that supports exception notification
26
46
  email: andy@new-bamboo.co.uk
27
47
  executables: []
28
48
 
29
49
  extensions: []
30
50
 
31
51
  extra_rdoc_files:
32
- - README.markdown
33
52
  - LICENSE
53
+ - TODO
34
54
  files:
35
55
  - LICENSE
36
56
  - README.markdown
37
57
  - Rakefile
58
+ - TODO
59
+ - lib/merb-exceptions.rb
38
60
  - lib/merb-exceptions/default_exception_extensions.rb
39
61
  - lib/merb-exceptions/exceptions_helper.rb
40
62
  - lib/merb-exceptions/notification.rb
41
63
  - lib/merb-exceptions/templates/email.erb
42
- - lib/merb-exceptions.rb
64
+ - lib/merb-exceptions/version.rb
43
65
  - spec/default_exception_extensions_spec.rb
44
66
  - spec/exceptions_helper_spec.rb
45
67
  - spec/notification_spec.rb
68
+ - spec/spec.opts
46
69
  - spec/spec_helper.rb
47
70
  has_rdoc: true
48
- homepage: http://merbivore.com
71
+ homepage: http://merbivore.com/
49
72
  licenses: []
50
73
 
51
74
  post_install_message:
52
- rdoc_options: []
53
-
75
+ rdoc_options:
76
+ - --charset=UTF-8
54
77
  require_paths:
55
78
  - lib
56
79
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -61,9 +84,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
61
84
  version:
62
85
  required_rubygems_version: !ruby/object:Gem::Requirement
63
86
  requirements:
64
- - - ">="
87
+ - - ">"
65
88
  - !ruby/object:Gem::Version
66
- version: "0"
89
+ version: 1.3.1
67
90
  version:
68
91
  requirements: []
69
92
 
@@ -71,6 +94,6 @@ rubyforge_project:
71
94
  rubygems_version: 1.3.5
72
95
  signing_key:
73
96
  specification_version: 3
74
- summary: Email and web hook exceptions for Merb.
97
+ summary: Merb plugin that provides Email and web hook exceptions for Merb.
75
98
  test_files: []
76
99