inspectbang 1.1.0 → 1.2.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/LICENSE.txt +9 -0
- data/README.md +7 -10
- data/inspectbang.gemspec +4 -2
- data/lib/inspectbang.rb +8 -2
- metadata +12 -13
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 48ba6d10702c99d199859a5d30892c41bf65f254
|
4
|
+
data.tar.gz: d895192a4b8d9d74cbb38e5807c12a36d5b5a032
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3ddba77f4800139159da10c9e263fcd303e490541897e7db583ddc991b3a5ef219ead8ac4e85aaef0a8d0a28a6ecbb35d3cd6edf69ae67d899236f50e47844d6
|
7
|
+
data.tar.gz: 8754013ebd690a9f93f31d5eb5c101b880640043144c893a4ffa580de69eb772f0d2a23a36eaf10493b8207ee939f37aa6699d13f7310e96d289592331931c3f
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
Copyright (c) TIMCRAFT <http://timcraft.com>
|
2
|
+
|
3
|
+
This is an Open Source project licensed under the terms of the LGPLv3 license.
|
4
|
+
Please see <http://www.gnu.org/licenses/lgpl-3.0.html> for license text.
|
5
|
+
|
6
|
+
This code is distributed in the hope that it will be useful,
|
7
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
8
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
9
|
+
GNU Lesser General Public License for more details.
|
data/README.md
CHANGED
@@ -1,28 +1,25 @@
|
|
1
|
-
|
2
|
-
====================
|
1
|
+
# inspectbang
|
3
2
|
|
4
3
|
|
5
4
|
Easy peasy "puts" style debugging in your browser, for Rails and Sinatra.
|
6
5
|
|
7
6
|
|
8
|
-
Installation
|
9
|
-
------------
|
7
|
+
## Installation
|
10
8
|
|
11
9
|
Add inspectbang to your Gemfile and run `bundle`:
|
12
10
|
|
13
11
|
```ruby
|
14
12
|
group :development do
|
15
|
-
gem 'inspectbang'
|
13
|
+
gem 'inspectbang'
|
16
14
|
end
|
17
15
|
```
|
18
16
|
|
19
17
|
|
20
|
-
|
21
|
-
-----
|
18
|
+
## Example usage
|
22
19
|
|
23
20
|
Use the `Object#inspect!` method to output an HTML safe representation of
|
24
|
-
the object in your browser. For example,
|
25
|
-
|
21
|
+
the object in your browser. For example, you could inspect form data posted
|
22
|
+
to your Rails application like this:
|
26
23
|
|
27
24
|
```ruby
|
28
25
|
class SomeController < ApplicationController
|
@@ -32,7 +29,7 @@ class SomeController < ApplicationController
|
|
32
29
|
end
|
33
30
|
```
|
34
31
|
|
35
|
-
|
32
|
+
Or you could inspect the request in a Sinatra application like this:
|
36
33
|
|
37
34
|
```ruby
|
38
35
|
get '/' do
|
data/inspectbang.gemspec
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'inspectbang'
|
3
|
-
s.version = '1.
|
3
|
+
s.version = '1.2.0'
|
4
|
+
s.license = 'LGPL-3.0'
|
4
5
|
s.platform = Gem::Platform::RUBY
|
5
6
|
s.authors = ['Tim Craft']
|
6
7
|
s.email = ['mail@timcraft.com']
|
7
8
|
s.homepage = 'http://github.com/timcraft/inspectbang'
|
8
9
|
s.description = 'Inspect with a bang!'
|
9
10
|
s.summary = 'See description'
|
10
|
-
s.files = %w(lib/inspectbang.rb README.md inspectbang.gemspec)
|
11
|
+
s.files = %w(lib/inspectbang.rb LICENSE.txt README.md inspectbang.gemspec)
|
12
|
+
s.required_ruby_version = '>= 1.9.3'
|
11
13
|
s.require_path = 'lib'
|
12
14
|
end
|
data/lib/inspectbang.rb
CHANGED
@@ -12,8 +12,14 @@ module InspectBang
|
|
12
12
|
|
13
13
|
class Railtie < Rails::Railtie
|
14
14
|
initializer 'inspectbang' do |app|
|
15
|
-
ActionController::
|
16
|
-
|
15
|
+
if defined?(ActionController::Rendering::RENDER_FORMATS_IN_PRIORITY) && ActionController::Rendering::RENDER_FORMATS_IN_PRIORITY.include?(:plain)
|
16
|
+
ActionController::Base.rescue_from(Exception) do |exception|
|
17
|
+
render :plain => exception.message
|
18
|
+
end
|
19
|
+
else
|
20
|
+
ActionController::Base.rescue_from(Exception) do |exception|
|
21
|
+
render :text => CGI.escapeHTML(exception.message)
|
22
|
+
end
|
17
23
|
end
|
18
24
|
|
19
25
|
Object.send(:include, Method)
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: inspectbang
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Tim Craft
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2017-06-25 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: Inspect with a bang!
|
15
14
|
email:
|
@@ -18,32 +17,32 @@ executables: []
|
|
18
17
|
extensions: []
|
19
18
|
extra_rdoc_files: []
|
20
19
|
files:
|
21
|
-
-
|
20
|
+
- LICENSE.txt
|
22
21
|
- README.md
|
23
22
|
- inspectbang.gemspec
|
23
|
+
- lib/inspectbang.rb
|
24
24
|
homepage: http://github.com/timcraft/inspectbang
|
25
|
-
licenses:
|
25
|
+
licenses:
|
26
|
+
- LGPL-3.0
|
27
|
+
metadata: {}
|
26
28
|
post_install_message:
|
27
29
|
rdoc_options: []
|
28
30
|
require_paths:
|
29
31
|
- lib
|
30
32
|
required_ruby_version: !ruby/object:Gem::Requirement
|
31
|
-
none: false
|
32
33
|
requirements:
|
33
|
-
- -
|
34
|
+
- - ">="
|
34
35
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
36
|
+
version: 1.9.3
|
36
37
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
37
|
-
none: false
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ">="
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
requirements: []
|
43
43
|
rubyforge_project:
|
44
|
-
rubygems_version:
|
44
|
+
rubygems_version: 2.6.11
|
45
45
|
signing_key:
|
46
|
-
specification_version:
|
46
|
+
specification_version: 4
|
47
47
|
summary: See description
|
48
48
|
test_files: []
|
49
|
-
has_rdoc:
|