snagglepuss 0.0.1.alpha
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/changelog.md +10 -0
- data/lib/snagglepuss/version.rb +5 -0
- data/lib/snagglepuss.rb +59 -0
- data/readme.md +21 -0
- data/snagglepuss.gemspec +33 -0
- metadata +65 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f7fad3a0990bf01a7d62ef171a5b29b2def9aa63721e4b69b111fcd58d22e3a9
|
4
|
+
data.tar.gz: 5731a5acf520fe4e71868134de8741ea906ab7186a44e28a95063793f0a4d498
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 17b9a9fc53d823e4cf4377451f53f24d6d9885a6c43a4d0b9e109db5e54aee677e50dd2d051079899cae7b60bfeb09daccd6dd56c831e5234e8be0989605206a
|
7
|
+
data.tar.gz: 8ca692cb0eb989b2fecd2b43b9caa5ecc605ddd2d57b754b7a325ac9c25c4378bd3313c4f6863363706ead78dc9b6cc45b38e037739cf4a1c63188586b7a164e
|
data/changelog.md
ADDED
data/lib/snagglepuss.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "snagglepuss/version"
|
4
|
+
|
5
|
+
if defined?(ColorMeRad)
|
6
|
+
if ColorMeRad.color_for_key(:error) == :light_yellow &&
|
7
|
+
ColorMeRad.color_for_key(:label) == :light_yellow
|
8
|
+
ColorMeRad.configure do |config|
|
9
|
+
config.set_colors \
|
10
|
+
:error => :red,
|
11
|
+
:label => :magenta
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
module Colorize
|
17
|
+
extend self
|
18
|
+
|
19
|
+
[
|
20
|
+
:key,
|
21
|
+
:data,
|
22
|
+
].each do |method|
|
23
|
+
define_method method do |*args|
|
24
|
+
return args.first.to_s unless defined?(ColorMeRad)
|
25
|
+
ColorMeRad.send method, *args
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
module Snagglepuss
|
31
|
+
extend self
|
32
|
+
|
33
|
+
class Error < StandardError; end
|
34
|
+
|
35
|
+
def exit_gracefully(e)
|
36
|
+
return if e.is_a?(SystemExit)
|
37
|
+
|
38
|
+
puts e.backtrace
|
39
|
+
puts '=' * 80
|
40
|
+
puts Colorize.key('Application trace:', :label)
|
41
|
+
puts '-' * 80
|
42
|
+
e.backtrace.each do |line|
|
43
|
+
puts line if !line.match(/\/\.?asdf\//) && !line.match(/\/\.gems\//)
|
44
|
+
end
|
45
|
+
puts '=' * 80
|
46
|
+
|
47
|
+
puts '%s: %s' % [
|
48
|
+
Colorize.data(e.class),
|
49
|
+
Colorize.key(e.message, :error),
|
50
|
+
]
|
51
|
+
|
52
|
+
$stderr.reopen(IO::NULL)
|
53
|
+
$stdout.reopen(IO::NULL)
|
54
|
+
end
|
55
|
+
|
56
|
+
at_exit do
|
57
|
+
exit_gracefully $!
|
58
|
+
end
|
59
|
+
end
|
data/readme.md
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# Snagglepuss
|
2
|
+
|
3
|
+
Exit your application gracefully with Snagglepuss
|
4
|
+
|
5
|
+
Snagglepuss ensures you have useful information when your application exits unexpectedly
|
6
|
+
|
7
|
+
|
8
|
+
## Installation
|
9
|
+
|
10
|
+
Install the gem and add to the application's Gemfile by executing:
|
11
|
+
|
12
|
+
$ bundle add snagglepuss
|
13
|
+
|
14
|
+
If bundler is not being used to manage dependencies, install the gem by executing:
|
15
|
+
|
16
|
+
$ gem install snagglepuss
|
17
|
+
|
18
|
+
|
19
|
+
## Contributing
|
20
|
+
|
21
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/toadjamb/snagglepuss.
|
data/snagglepuss.gemspec
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/snagglepuss/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = 'snagglepuss'
|
7
|
+
spec.version = Snagglepuss::VERSION
|
8
|
+
spec.authors = ['Travis Herrick']
|
9
|
+
spec.email = ['tthetoad@gmail.com']
|
10
|
+
|
11
|
+
spec.summary = 'Exit your application gracefully with Snagglepuss'
|
12
|
+
spec.description = 'Snagglepuss ensures you have useful information when your application exits unexpectedly'
|
13
|
+
spec.homepage = 'http://www.github.com/toadjamb/gems_snagglepuss'
|
14
|
+
spec.required_ruby_version = '>= 2.6.0'
|
15
|
+
|
16
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
17
|
+
spec.metadata['source_code_uri'] = 'http://www.github.com/toadjamb/gems_snagglepuss'
|
18
|
+
spec.metadata['changelog_uri'] = 'http://www.github.com/toadjamb/gems_snagglepuss/blob/master/changelog.md'
|
19
|
+
|
20
|
+
# Specify which files should be added to the gem when it is released.
|
21
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
+
spec.files = Dir.chdir(__dir__) do
|
23
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
24
|
+
(File.expand_path(f) == __FILE__) ||
|
25
|
+
f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
|
26
|
+
end
|
27
|
+
end
|
28
|
+
spec.bindir = 'exe'
|
29
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
30
|
+
spec.require_paths = ['lib']
|
31
|
+
|
32
|
+
spec.add_development_dependency 'color_me_rad', '~> 0.0.4'
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: snagglepuss
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1.alpha
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Travis Herrick
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2025-05-24 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: color_me_rad
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.0.4
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.0.4
|
27
|
+
description: Snagglepuss ensures you have useful information when your application
|
28
|
+
exits unexpectedly
|
29
|
+
email:
|
30
|
+
- tthetoad@gmail.com
|
31
|
+
executables: []
|
32
|
+
extensions: []
|
33
|
+
extra_rdoc_files: []
|
34
|
+
files:
|
35
|
+
- changelog.md
|
36
|
+
- lib/snagglepuss.rb
|
37
|
+
- lib/snagglepuss/version.rb
|
38
|
+
- readme.md
|
39
|
+
- snagglepuss.gemspec
|
40
|
+
homepage: http://www.github.com/toadjamb/gems_snagglepuss
|
41
|
+
licenses: []
|
42
|
+
metadata:
|
43
|
+
homepage_uri: http://www.github.com/toadjamb/gems_snagglepuss
|
44
|
+
source_code_uri: http://www.github.com/toadjamb/gems_snagglepuss
|
45
|
+
changelog_uri: http://www.github.com/toadjamb/gems_snagglepuss/blob/master/changelog.md
|
46
|
+
post_install_message:
|
47
|
+
rdoc_options: []
|
48
|
+
require_paths:
|
49
|
+
- lib
|
50
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 2.6.0
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 1.3.1
|
60
|
+
requirements: []
|
61
|
+
rubygems_version: 3.3.3
|
62
|
+
signing_key:
|
63
|
+
specification_version: 4
|
64
|
+
summary: Exit your application gracefully with Snagglepuss
|
65
|
+
test_files: []
|