gif_countdown 0.1.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/gif_countdown/generator.rb +25 -25
- data/lib/gif_countdown/version.rb +1 -1
- data/lib/gif_countdown.rb +4 -4
- metadata +5 -7
- data/lib/gif_countdown/engine.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e737fee8d4cac9ee7d2fe1c0989efe9f4dd171b93fc8b05210d4ba602540709f
|
4
|
+
data.tar.gz: dce26b1188bae144fb32486a31dde9df4da404ed32c4da277ec88c900f0664e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad9130c586c6668fa569a17591c9c28e87970b46311199823fffa916abd01ace1778c91cd30bf5ce6219d28a02cec96bf7ef16f39d0f541080ba6eafd1c6b3dc
|
7
|
+
data.tar.gz: 81cbc0db552b6c72ec82b12ec533c8f75b2120f066d18f23a616fda7e1247e8963e0f3820e50210ebf81b301ce0a05b569e6b2c809584f4284c6d28081baaeca
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ class GifCountdown::Generator
|
|
24
24
|
annotate_with_countdown(image: image, seconds: @distance_in_seconds - i)
|
25
25
|
gif << image
|
26
26
|
end
|
27
|
-
gif.to_blob {
|
27
|
+
gif.to_blob { |img| img.format = 'gif' }
|
28
28
|
end
|
29
29
|
|
30
30
|
def pluralize(count, key)
|
@@ -41,43 +41,43 @@ class GifCountdown::Generator
|
|
41
41
|
|
42
42
|
text_y = height / 2 + padding_x / 2
|
43
43
|
x = padding_x
|
44
|
-
image.annotate(draw, boxwidth, height / 2, x, 0, parts[:days]) {
|
45
|
-
|
46
|
-
|
44
|
+
image.annotate(draw, boxwidth, height / 2, x, 0, parts[:days]) { |img|
|
45
|
+
img.pointsize = this.fontsize
|
46
|
+
img.font_family = this.font
|
47
47
|
}
|
48
|
-
image.annotate(draw, boxwidth, height / 2, x, text_y, pluralize(parts[:days], :days)) {
|
49
|
-
|
50
|
-
|
48
|
+
image.annotate(draw, boxwidth, height / 2, x, text_y, pluralize(parts[:days], :days)) { |img|
|
49
|
+
img.pointsize = (this.fontsize * 0.7).round
|
50
|
+
img.font_family = this.font
|
51
51
|
}
|
52
52
|
|
53
53
|
x = padding_x * 2 + boxwidth
|
54
|
-
image.annotate(draw, boxwidth, height / 2, x, 0, parts[:hours]) {
|
55
|
-
|
56
|
-
|
54
|
+
image.annotate(draw, boxwidth, height / 2, x, 0, parts[:hours]) { |img|
|
55
|
+
img.pointsize = this.fontsize
|
56
|
+
img.font_family = this.font
|
57
57
|
}
|
58
|
-
image.annotate(draw, boxwidth, height / 2, x, text_y, pluralize(parts[:hours], :hours)) {
|
59
|
-
|
60
|
-
|
58
|
+
image.annotate(draw, boxwidth, height / 2, x, text_y, pluralize(parts[:hours], :hours)) { |img|
|
59
|
+
img.pointsize = (this.fontsize * 0.7).round
|
60
|
+
img.font_family = this.font
|
61
61
|
}
|
62
62
|
|
63
63
|
x = padding_x * 3 + boxwidth * 2
|
64
|
-
image.annotate(draw, boxwidth, height / 2, x, 0, parts[:minutes]) {
|
65
|
-
|
66
|
-
|
64
|
+
image.annotate(draw, boxwidth, height / 2, x, 0, parts[:minutes]) { |img|
|
65
|
+
img.pointsize = this.fontsize
|
66
|
+
img.font_family = this.font
|
67
67
|
}
|
68
|
-
image.annotate(draw, boxwidth, height / 2, x, text_y, pluralize(parts[:minutes], :minutes)) {
|
69
|
-
|
70
|
-
|
68
|
+
image.annotate(draw, boxwidth, height / 2, x, text_y, pluralize(parts[:minutes], :minutes)) { |img|
|
69
|
+
img.pointsize = (this.fontsize * 0.7).round
|
70
|
+
img.font_family = this.font
|
71
71
|
}
|
72
72
|
|
73
73
|
x = padding_x * 4 + boxwidth * 3
|
74
|
-
image.annotate(draw, boxwidth, height / 2, x, 0, parts[:seconds]) {
|
75
|
-
|
76
|
-
|
74
|
+
image.annotate(draw, boxwidth, height / 2, x, 0, parts[:seconds]) { |img|
|
75
|
+
img.pointsize = this.fontsize
|
76
|
+
img.font_family = this.font
|
77
77
|
}
|
78
|
-
image.annotate(draw, boxwidth, height / 2, x, text_y, pluralize(parts[:seconds], :seconds)) {
|
79
|
-
|
80
|
-
|
78
|
+
image.annotate(draw, boxwidth, height / 2, x, text_y, pluralize(parts[:seconds], :seconds)) { |img|
|
79
|
+
img.pointsize = (this.fontsize * 0.7).round
|
80
|
+
img.font_family = this.font
|
81
81
|
}
|
82
82
|
end
|
83
83
|
|
data/lib/gif_countdown.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
if defined?(Rails::Engine)
|
2
|
-
require "gif_countdown/engine"
|
3
|
-
end
|
4
1
|
|
5
|
-
require '
|
2
|
+
require 'i18n'
|
3
|
+
I18n.load_path << File.expand_path('../config/locales/gif_countdown.de.yml', __dir__)
|
4
|
+
I18n.load_path << File.expand_path('../config/locales/gif_countdown.en.yml', __dir__)
|
6
5
|
|
7
6
|
module GifCountdown
|
7
|
+
autoload :Generator, 'gif_countdown/generator'
|
8
8
|
def self.generate(**args)
|
9
9
|
GifCountdown::Generator.new(**args).call
|
10
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gif_countdown
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Wienert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-05-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 5.0.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 5.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: i18n
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -65,7 +65,6 @@ files:
|
|
65
65
|
- config/locales/gif_countdown.de.yml
|
66
66
|
- config/locales/gif_countdown.en.yml
|
67
67
|
- lib/gif_countdown.rb
|
68
|
-
- lib/gif_countdown/engine.rb
|
69
68
|
- lib/gif_countdown/generator.rb
|
70
69
|
- lib/gif_countdown/version.rb
|
71
70
|
homepage: https://github.com/pludoni/gif_countdown
|
@@ -87,8 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
87
86
|
- !ruby/object:Gem::Version
|
88
87
|
version: '0'
|
89
88
|
requirements: []
|
90
|
-
|
91
|
-
rubygems_version: 2.7.6
|
89
|
+
rubygems_version: 3.2.33
|
92
90
|
signing_key:
|
93
91
|
specification_version: 4
|
94
92
|
summary: Create a countdown timer animated GIF
|