lolerrors 0.0.2 → 0.1.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 +4 -4
- data/.gitignore +1 -0
- data/lib/lolerrors/configuration.rb +5 -0
- data/lib/lolerrors/middleware.rb +30 -19
- data/lib/lolerrors/version.rb +3 -0
- data/lib/lolerrors.rb +2 -0
- data/lolerrors.gemspec +25 -0
- metadata +10 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 11e032c8c3c176897ab90f001910c5663c3bc054
|
|
4
|
+
data.tar.gz: 2f6c56afac3f92580221fd6657406b90558ab854
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 176d23eeb34111eb5980cdde0270d679c14744447163b4e5fdb551cb4ff7028c7b0f550371960a991c94025293eb0f806f0ec5eb3e2e7963d90197aa92acdac2
|
|
7
|
+
data.tar.gz: 3f1856b1dcd7a47fa2f8c971df6c9ab089c66110f38e5995e5e49cbdade263a4fb46d87b2f11a473620379d714d540fe12ed2a971c09229efc82dc2fed7f1ac8
|
data/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*.gem
|
data/lib/lolerrors/middleware.rb
CHANGED
|
@@ -7,20 +7,12 @@ module Lolerrors
|
|
|
7
7
|
|
|
8
8
|
def call(env)
|
|
9
9
|
@app.call env
|
|
10
|
-
rescue =>
|
|
11
|
-
capture
|
|
10
|
+
rescue => e
|
|
11
|
+
capture e
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
private
|
|
15
15
|
|
|
16
|
-
def videosnap_path
|
|
17
|
-
'vendor/ext/videosnap'
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
def font_path
|
|
21
|
-
'/Library/Fonts/Impact.ttf'
|
|
22
|
-
end
|
|
23
|
-
|
|
24
16
|
def set_executable_permission
|
|
25
17
|
executables = %w(
|
|
26
18
|
vendor/ext/videosnap
|
|
@@ -32,29 +24,29 @@ module Lolerrors
|
|
|
32
24
|
message = exception.message.truncate(32)
|
|
33
25
|
Thread.new do
|
|
34
26
|
puts 'Taking animated gif'
|
|
35
|
-
%x( mkdir -p
|
|
36
|
-
%x( rm -vf
|
|
27
|
+
%x( mkdir -p #{save_location} )
|
|
28
|
+
%x( rm -vf #{video_file_path} #{gif_file_path} )
|
|
37
29
|
create_movie_file
|
|
38
30
|
create_intermediate_gif_file
|
|
39
31
|
make_caption message
|
|
40
32
|
optimize_gif
|
|
41
33
|
rename_gif
|
|
42
|
-
%x( rm -vf
|
|
34
|
+
%x( rm -vf #{video_file_path} )
|
|
43
35
|
puts 'Took gif successfully'
|
|
44
36
|
end
|
|
45
37
|
raise exception
|
|
46
38
|
end
|
|
47
39
|
|
|
48
40
|
def create_movie_file
|
|
49
|
-
%x( #{videosnap_path} -t 3.7 -s 240 --no-audio
|
|
41
|
+
%x( #{videosnap_path} -t 3.7 -s 240 --no-audio #{video_file_path} )
|
|
50
42
|
end
|
|
51
43
|
|
|
52
44
|
def create_intermediate_gif_file
|
|
53
|
-
%x( ffmpeg -ss 0.7 -i
|
|
45
|
+
%x( ffmpeg -ss 0.7 -i #{video_file_path} -r 10 -f gif #{gif_file_path} )
|
|
54
46
|
end
|
|
55
47
|
|
|
56
48
|
def make_caption(message)
|
|
57
|
-
%x( convert
|
|
49
|
+
%x( convert #{gif_file_path} \
|
|
58
50
|
-coalesce \
|
|
59
51
|
-gravity South \
|
|
60
52
|
-font #{font_path} \
|
|
@@ -63,16 +55,35 @@ module Lolerrors
|
|
|
63
55
|
-strokewidth 2 \
|
|
64
56
|
-pointsize 24 \
|
|
65
57
|
-annotate +0+10 "! #{message}" \
|
|
66
|
-
|
|
58
|
+
#{gif_file_path} )
|
|
67
59
|
end
|
|
68
60
|
|
|
69
61
|
def rename_gif
|
|
70
|
-
%x( mv
|
|
62
|
+
%x( mv #{gif_file_path} ~/lolerrors/snapshot_#{Time.now.to_i}.gif )
|
|
71
63
|
end
|
|
72
64
|
|
|
73
65
|
def optimize_gif
|
|
74
|
-
%x( convert -layers Optimize
|
|
66
|
+
%x( convert -layers Optimize #{gif_file_path} #{gif_file_path} )
|
|
75
67
|
end
|
|
76
68
|
|
|
69
|
+
def font_path
|
|
70
|
+
'/Library/Fonts/Impact.ttf'
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def videosnap_path
|
|
74
|
+
File.join(Configuration::LOLERRORS_ROOT, 'vendor', 'ext', 'videosnap')
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def video_file_path
|
|
78
|
+
"#{save_location}/snapshot.mov"
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
def gif_file_path
|
|
82
|
+
"#{save_location}/snapshot.gif"
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
def save_location
|
|
86
|
+
'~/lolerrors'
|
|
87
|
+
end
|
|
77
88
|
end
|
|
78
89
|
end
|
data/lib/lolerrors.rb
CHANGED
data/lolerrors.gemspec
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
|
2
|
+
require "lolerrors/version"
|
|
3
|
+
|
|
4
|
+
Gem::Specification.new do |s|
|
|
5
|
+
s.name = 'lolerrors'
|
|
6
|
+
s.version = Lolerrors::VERSION
|
|
7
|
+
s.platform = Gem::Platform::RUBY
|
|
8
|
+
s.date = '2014-11-05'
|
|
9
|
+
s.summary = 'Capture animation of your funny reaction to rails app errors'
|
|
10
|
+
s.description = <<-EOF
|
|
11
|
+
lolerrors take a videosnap shot with your webcam
|
|
12
|
+
every time exception or error occurs. Then make animated GIF with the error message
|
|
13
|
+
EOF
|
|
14
|
+
s.authors = ['Jeep Kiddee']
|
|
15
|
+
s.email = ['nutthawut.ki@gmail.com']
|
|
16
|
+
s.files = `git ls-files`.split("\n")
|
|
17
|
+
s.require_paths = ["lib"]
|
|
18
|
+
s.homepage = 'http://rubygems.org/gems/lolerrors'
|
|
19
|
+
s.license = 'MIT'
|
|
20
|
+
|
|
21
|
+
s.required_ruby_version = '>= 1.9'
|
|
22
|
+
s.requirements << 'imagemagick'
|
|
23
|
+
s.requirements << 'ffmpeg'
|
|
24
|
+
s.requirements << 'a webcam'
|
|
25
|
+
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lolerrors
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jeep Kiddee
|
|
@@ -19,9 +19,13 @@ executables: []
|
|
|
19
19
|
extensions: []
|
|
20
20
|
extra_rdoc_files: []
|
|
21
21
|
files:
|
|
22
|
+
- ".gitignore"
|
|
22
23
|
- lib/lolerrors.rb
|
|
24
|
+
- lib/lolerrors/configuration.rb
|
|
23
25
|
- lib/lolerrors/middleware.rb
|
|
24
26
|
- lib/lolerrors/rails.rb
|
|
27
|
+
- lib/lolerrors/version.rb
|
|
28
|
+
- lolerrors.gemspec
|
|
25
29
|
- vendor/ext/videosnap
|
|
26
30
|
homepage: http://rubygems.org/gems/lolerrors
|
|
27
31
|
licenses:
|
|
@@ -35,13 +39,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
35
39
|
requirements:
|
|
36
40
|
- - ">="
|
|
37
41
|
- !ruby/object:Gem::Version
|
|
38
|
-
version: '
|
|
42
|
+
version: '1.9'
|
|
39
43
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
40
44
|
requirements:
|
|
41
45
|
- - ">="
|
|
42
46
|
- !ruby/object:Gem::Version
|
|
43
47
|
version: '0'
|
|
44
|
-
requirements:
|
|
48
|
+
requirements:
|
|
49
|
+
- imagemagick
|
|
50
|
+
- ffmpeg
|
|
51
|
+
- a webcam
|
|
45
52
|
rubyforge_project:
|
|
46
53
|
rubygems_version: 2.2.2
|
|
47
54
|
signing_key:
|