exceptionist 0.2.0 → 0.3.0
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.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.ruby-version +1 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +54 -0
- data/README.markdown +7 -4
- data/Rakefile +11 -48
- data/exceptionist.gemspec +24 -33
- data/lib/exceptionist.rb +1 -1
- data/test/fire_controller_test.rb +6 -6
- data/test/{helper.rb → test_helper.rb} +3 -2
- metadata +99 -60
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1aa3ee708427652f4133fc476dff2606c2b7cd07
|
4
|
+
data.tar.gz: 4b4b9d2b1555e87f44c92a98388800af0cb5b32b
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 74ab2e36036ec71709a65951f0747946297475e0ec2c50a2bad2791af0eaa24502522d07f6167773c2994984940206eee9c4897a8661a7509ba11803cd7467a2
|
7
|
+
data.tar.gz: 5f4ea0af9f6500513e268e41668cf670d2f58a9442c8a6c600decb4d6fdc1bc85148df72f38796522316f3c7e091689b221d23e1927aa8e07993883dd0bb738a
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.1.3
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
exceptionist (0.3.0)
|
5
|
+
actionpack
|
6
|
+
activesupport
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionpack (4.1.7)
|
12
|
+
actionview (= 4.1.7)
|
13
|
+
activesupport (= 4.1.7)
|
14
|
+
rack (~> 1.5.2)
|
15
|
+
rack-test (~> 0.6.2)
|
16
|
+
actionview (4.1.7)
|
17
|
+
activesupport (= 4.1.7)
|
18
|
+
builder (~> 3.1)
|
19
|
+
erubis (~> 2.7.0)
|
20
|
+
activesupport (4.1.7)
|
21
|
+
i18n (~> 0.6, >= 0.6.9)
|
22
|
+
json (~> 1.7, >= 1.7.7)
|
23
|
+
minitest (~> 5.1)
|
24
|
+
thread_safe (~> 0.1)
|
25
|
+
tzinfo (~> 1.1)
|
26
|
+
ansi (1.4.3)
|
27
|
+
builder (3.2.2)
|
28
|
+
erubis (2.7.0)
|
29
|
+
i18n (0.6.11)
|
30
|
+
json (1.8.1)
|
31
|
+
minitest (5.4.2)
|
32
|
+
rack (1.5.2)
|
33
|
+
rack-test (0.6.2)
|
34
|
+
rack (>= 1.0)
|
35
|
+
shoulda (3.5.0)
|
36
|
+
shoulda-context (~> 1.0, >= 1.0.1)
|
37
|
+
shoulda-matchers (>= 1.4.1, < 3.0)
|
38
|
+
shoulda-context (1.2.1)
|
39
|
+
shoulda-matchers (2.7.0)
|
40
|
+
activesupport (>= 3.0.0)
|
41
|
+
thread_safe (0.3.4)
|
42
|
+
turn (0.9.6)
|
43
|
+
ansi
|
44
|
+
tzinfo (1.2.2)
|
45
|
+
thread_safe (~> 0.1)
|
46
|
+
|
47
|
+
PLATFORMS
|
48
|
+
ruby
|
49
|
+
|
50
|
+
DEPENDENCIES
|
51
|
+
exceptionist!
|
52
|
+
minitest
|
53
|
+
shoulda
|
54
|
+
turn
|
data/README.markdown
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Want to force your `Rails 3` application to respond with a certain HTTP status code? Just call
|
4
4
|
|
5
|
-
/fire/500
|
5
|
+
http://my.app.com/fire/500
|
6
6
|
|
7
7
|
to let the application crash, or call
|
8
8
|
|
9
|
-
/fire/412
|
9
|
+
http://my.app.com/fire/412
|
10
10
|
|
11
11
|
for a nice'n'nifty *precondition failed*.
|
12
12
|
|
@@ -18,9 +18,12 @@ Simply install via
|
|
18
18
|
|
19
19
|
or when using [Bundler](http://gembundler.com/), add the line
|
20
20
|
|
21
|
-
|
21
|
+
# Gemfile
|
22
|
+
gem 'exceptionist'
|
22
23
|
|
23
|
-
to your Gemfile
|
24
|
+
to your Gemfile and call
|
25
|
+
|
26
|
+
$ bundle install
|
24
27
|
|
25
28
|
---
|
26
29
|
|
data/Rakefile
CHANGED
@@ -1,53 +1,16 @@
|
|
1
|
-
|
2
|
-
require
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
require "bundler/gem_tasks"
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
gem.name = "exceptionist"
|
8
|
-
gem.summary = %Q{Ask Rails application to crash}
|
9
|
-
gem.description = %Q{Ask Rails application to crash}
|
10
|
-
gem.email = "boettger@mt7.de"
|
11
|
-
gem.homepage = "http://github.com/alto/exceptionist"
|
12
|
-
gem.authors = ["alto"]
|
13
|
-
gem.add_development_dependency "thoughtbot-shoulda", ">= 0"
|
14
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
15
|
-
end
|
16
|
-
Jeweler::GemcutterTasks.new
|
17
|
-
rescue LoadError
|
18
|
-
puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
|
19
|
-
end
|
4
|
+
# require 'rubygems'
|
5
|
+
# require 'rake'
|
6
|
+
require 'bundler/gem_tasks'
|
20
7
|
|
21
8
|
require 'rake/testtask'
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
begin
|
29
|
-
require 'rcov/rcovtask'
|
30
|
-
Rcov::RcovTask.new do |test|
|
31
|
-
test.libs << 'test'
|
32
|
-
test.pattern = 'test/**/test_*.rb'
|
33
|
-
test.verbose = true
|
34
|
-
end
|
35
|
-
rescue LoadError
|
36
|
-
task :rcov do
|
37
|
-
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
38
|
-
end
|
9
|
+
desc 'Test the assertions.'
|
10
|
+
Rake::TestTask.new(:test) do |t|
|
11
|
+
t.libs << 'lib' << 'test'
|
12
|
+
t.pattern = 'test/**/*_test.rb'
|
13
|
+
t.verbose = true
|
39
14
|
end
|
40
|
-
|
41
|
-
task :test => :check_dependencies
|
42
|
-
|
15
|
+
desc 'Default: run unit tests.'
|
43
16
|
task :default => :test
|
44
|
-
|
45
|
-
require 'rake/rdoctask'
|
46
|
-
Rake::RDocTask.new do |rdoc|
|
47
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
|
-
|
49
|
-
rdoc.rdoc_dir = 'rdoc'
|
50
|
-
rdoc.title = "exceptionist #{version}"
|
51
|
-
rdoc.rdoc_files.include('README*')
|
52
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
-
end
|
data/exceptionist.gemspec
CHANGED
@@ -5,53 +5,44 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{exceptionist}
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["alto"]
|
12
12
|
s.date = %q{2010-10-15}
|
13
|
-
s.description = %q{
|
13
|
+
s.description = %q{Request a certain HTTP status code to be returned}
|
14
|
+
s.summary = %q{Force your Rails (version >= 3) application to crash}
|
14
15
|
s.email = %q{boettger@mt7.de}
|
15
16
|
s.extra_rdoc_files = [
|
16
17
|
"LICENSE",
|
17
18
|
"README.markdown"
|
18
19
|
]
|
19
|
-
s.files
|
20
|
-
|
21
|
-
|
22
|
-
"LICENSE",
|
23
|
-
"README.markdown",
|
24
|
-
"Rakefile",
|
25
|
-
"VERSION",
|
26
|
-
"app/controllers/exceptionist/fire_controller.rb",
|
27
|
-
"config/routes.rb",
|
28
|
-
"exceptionist.gemspec",
|
29
|
-
"lib/exceptionist.rb",
|
30
|
-
"lib/exceptionist/engine.rb",
|
31
|
-
"test/fire_controller_test.rb",
|
32
|
-
"test/helper.rb"
|
33
|
-
]
|
20
|
+
s.files = `git ls-files`.split($\)
|
21
|
+
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
22
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
34
23
|
s.homepage = %q{http://github.com/alto/exceptionist}
|
35
24
|
s.rdoc_options = ["--charset=UTF-8"]
|
36
25
|
s.require_paths = ["lib"]
|
37
26
|
s.rubygems_version = %q{1.3.7}
|
38
|
-
s.summary = %q{Ask Rails application to crash}
|
39
|
-
s.test_files = [
|
40
|
-
"test/fire_controller_test.rb",
|
41
|
-
"test/helper.rb"
|
42
|
-
]
|
43
27
|
|
44
|
-
|
45
|
-
|
46
|
-
|
28
|
+
s.add_dependency 'activesupport'
|
29
|
+
s.add_dependency 'actionpack'
|
30
|
+
|
31
|
+
s.add_development_dependency 'minitest'
|
32
|
+
s.add_development_dependency 'shoulda'
|
33
|
+
s.add_development_dependency 'turn'
|
34
|
+
|
35
|
+
# if s.respond_to? :specification_version then
|
36
|
+
# current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
37
|
+
# s.specification_version = 3
|
47
38
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
else
|
54
|
-
|
55
|
-
end
|
39
|
+
# if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
40
|
+
# s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
41
|
+
# else
|
42
|
+
# s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
43
|
+
# end
|
44
|
+
# else
|
45
|
+
# s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
46
|
+
# end
|
56
47
|
end
|
57
48
|
|
data/lib/exceptionist.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require 'exceptionist/engine' if defined?(Rails) && Rails::VERSION::MAJOR
|
1
|
+
require 'exceptionist/engine' if defined?(Rails) && Rails::VERSION::MAJOR >= 3
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'test_helper'
|
2
2
|
require 'active_support'
|
3
3
|
require "action_controller"
|
4
4
|
|
@@ -6,23 +6,23 @@ require 'controllers/exceptionist/fire_controller'
|
|
6
6
|
|
7
7
|
class FireControllerTest < ActionController::TestCase
|
8
8
|
tests Exceptionist::FireController
|
9
|
-
|
9
|
+
|
10
10
|
setup do
|
11
|
-
@routes = ActionDispatch::Routing::RouteSet.new.tap { |r| r.draw {
|
11
|
+
@routes = ActionDispatch::Routing::RouteSet.new.tap { |r| r.draw { get ':controller(/:action(/:id(.:format)))' } }
|
12
12
|
@controller.class.send :include, @routes.url_helpers
|
13
13
|
end
|
14
|
-
|
14
|
+
|
15
15
|
should "probably rename this file and start testing for real" do
|
16
16
|
assert_raises RuntimeError do
|
17
17
|
get :fire, :http_status_code => "500"
|
18
18
|
end
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
should "return the provided http status code" do
|
22
22
|
assert_nothing_raised do
|
23
23
|
get :fire, :http_status_code => "412"
|
24
24
|
end
|
25
25
|
assert_response 412
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
end
|
metadata
CHANGED
@@ -1,49 +1,98 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: exceptionist
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease: false
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 0
|
10
|
-
version: 0.2.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.3.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- alto
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
11
|
+
date: 2010-10-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: actionpack
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: shoulda
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
23
63
|
prerelease: false
|
24
|
-
|
25
|
-
|
26
|
-
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: turn
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
27
73
|
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
30
|
-
segments:
|
31
|
-
- 0
|
32
|
-
version: "0"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
33
76
|
type: :development
|
34
|
-
|
35
|
-
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
description: Request a certain HTTP status code to be returned
|
36
84
|
email: boettger@mt7.de
|
37
85
|
executables: []
|
38
|
-
|
39
86
|
extensions: []
|
40
|
-
|
41
|
-
extra_rdoc_files:
|
87
|
+
extra_rdoc_files:
|
42
88
|
- LICENSE
|
43
89
|
- README.markdown
|
44
|
-
files:
|
45
|
-
- .document
|
46
|
-
- .gitignore
|
90
|
+
files:
|
91
|
+
- ".document"
|
92
|
+
- ".gitignore"
|
93
|
+
- ".ruby-version"
|
94
|
+
- Gemfile
|
95
|
+
- Gemfile.lock
|
47
96
|
- LICENSE
|
48
97
|
- README.markdown
|
49
98
|
- Rakefile
|
@@ -54,41 +103,31 @@ files:
|
|
54
103
|
- lib/exceptionist.rb
|
55
104
|
- lib/exceptionist/engine.rb
|
56
105
|
- test/fire_controller_test.rb
|
57
|
-
- test/
|
58
|
-
has_rdoc: true
|
106
|
+
- test/test_helper.rb
|
59
107
|
homepage: http://github.com/alto/exceptionist
|
60
108
|
licenses: []
|
61
|
-
|
109
|
+
metadata: {}
|
62
110
|
post_install_message:
|
63
|
-
rdoc_options:
|
64
|
-
- --charset=UTF-8
|
65
|
-
require_paths:
|
111
|
+
rdoc_options:
|
112
|
+
- "--charset=UTF-8"
|
113
|
+
require_paths:
|
66
114
|
- lib
|
67
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
-
|
69
|
-
requirements:
|
115
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
70
117
|
- - ">="
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
version: "0"
|
76
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
-
none: false
|
78
|
-
requirements:
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
79
122
|
- - ">="
|
80
|
-
- !ruby/object:Gem::Version
|
81
|
-
|
82
|
-
segments:
|
83
|
-
- 0
|
84
|
-
version: "0"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
85
125
|
requirements: []
|
86
|
-
|
87
126
|
rubyforge_project:
|
88
|
-
rubygems_version:
|
127
|
+
rubygems_version: 2.2.2
|
89
128
|
signing_key:
|
90
|
-
specification_version:
|
91
|
-
summary:
|
92
|
-
test_files:
|
129
|
+
specification_version: 4
|
130
|
+
summary: Force your Rails (version >= 3) application to crash
|
131
|
+
test_files:
|
93
132
|
- test/fire_controller_test.rb
|
94
|
-
- test/
|
133
|
+
- test/test_helper.rb
|