lolerrors 0.0.1

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7cb8c64368fb679d0e5366d72723455c0bbb3f95
4
+ data.tar.gz: 22444801ad83003861ed7f5c27caa41fb6d23071
5
+ SHA512:
6
+ metadata.gz: 8c590c9a47323f933aa02f265d8454e8263c41dc8b8e1f537184f91c378b9115f848a51ee3297bade26092d64c326cff09ff50cbd5b12043e580595a21674a37
7
+ data.tar.gz: 24d72f4d490185ed317334fb39708bf38e87a52994955f2fd12abbc3afdd1d486aedbd65d5f886a5c6012bfb5ca25faccc22eea9ea67350bd98faf0fce872967
@@ -0,0 +1,39 @@
1
+ module Lolerrors
2
+ class Middleware
3
+ def initialize(app)
4
+ @app = app
5
+ end
6
+
7
+ def call(env)
8
+ @app.call env
9
+ rescue => ex
10
+ snap ex
11
+ end
12
+
13
+ private
14
+
15
+ def snap(exception)
16
+ message = exception.message[0..32].gsub(/\s\w+\s*$/, '..')
17
+ command = Thread.new do
18
+ puts 'Taking animated gif'
19
+ %x( mkdir -p ~/snaps )
20
+ %x( rm -vf ~/snaps/snap.mov ~/snaps/snap.gif )
21
+ %x( videosnap -t 3 -s 240 --no-audio ~/snaps/snap.mov )
22
+ %x( ffmpeg -ss 0.7 -i ~/snaps/snap.mov -r 10 -pix_fmt rgb24 -f gif ~/snaps/snap.gif )
23
+ %x( convert ~/snaps/snap.gif \
24
+ -gravity South \
25
+ -font /Library/Fonts/Impact.ttf \
26
+ -fill white \
27
+ -stroke black \
28
+ -strokewidth 2 \
29
+ -pointsize 24 \
30
+ -annotate +0+10 "! #{message}" \
31
+ ~/snaps/snap_#{Time.now.to_i}.gif )
32
+ # %x( convert -fuzz 10% -layers Optimize ~/snaps/snap.gif ~/snaps/snap_#{Time.now.to_i}.gif )
33
+ %x( rm -vf ~/snaps/snap.mov ~/snaps/snap.gif )
34
+ puts 'Took gif successfully'
35
+ end
36
+ raise exception
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,11 @@
1
+ module Lolerrors
2
+ class Railtie < Rails::Railtie
3
+ initializer "lolerrors.configure_rails_initialization" do |app|
4
+ if defined? ActionDispatch::DebugExceptions
5
+ app.middleware.insert_after ActionDispatch::DebugExceptions, "Lolerrors::Middleware"
6
+ else
7
+ app.middleware.use "Lolerrors::Middleware"
8
+ end
9
+ end
10
+ end
11
+ end
data/lib/lolerrors.rb ADDED
@@ -0,0 +1,9 @@
1
+ require 'lolerrors/middleware'
2
+ require 'lolerrors/rails' if defined? Rails
3
+
4
+ module Lolerrors
5
+ def self.hello
6
+ 'hello world'
7
+ end
8
+ end
9
+
metadata ADDED
@@ -0,0 +1,46 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: lolerrors
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jeep Kiddee
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Will add later
14
+ email: jeep@oozou.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/lolerrors.rb
20
+ - lib/lolerrors/middleware.rb
21
+ - lib/lolerrors/rails.rb
22
+ homepage: http://rubygems.org/gems/lolerrors
23
+ licenses:
24
+ - MIT
25
+ metadata: {}
26
+ post_install_message:
27
+ rdoc_options: []
28
+ require_paths:
29
+ - lib
30
+ required_ruby_version: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ required_rubygems_version: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - ">="
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
40
+ requirements: []
41
+ rubyforge_project:
42
+ rubygems_version: 2.2.2
43
+ signing_key:
44
+ specification_version: 4
45
+ summary: A gem that capturing your funny reaction to application errors
46
+ test_files: []