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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 05a548ff4d76da19d2715dd9427d7110ede683c572c09212128d250023b4f97e
4
- data.tar.gz: d831c3ef65065ce5fa268d59e6da763d4ac1571597b3aeb4fd65a59f734a1988
3
+ metadata.gz: e737fee8d4cac9ee7d2fe1c0989efe9f4dd171b93fc8b05210d4ba602540709f
4
+ data.tar.gz: dce26b1188bae144fb32486a31dde9df4da404ed32c4da277ec88c900f0664e6
5
5
  SHA512:
6
- metadata.gz: 1e335003414fd5b0a3d4fc1ab0e2248bfc7cc49547744790fc2309ff4bde4bc0268908f9c59244b2adc000c59d7a4152fc5d03ff50e31cdcee0ff9d6e8222591
7
- data.tar.gz: 5d08fe0e3dc334109e2c6e534ca5a5778bb08455ce52f55851be0c2aaa2beb5d2d496a1be258d683aff52edd874f36c97b646e091390936ddf9cd002fe3358c1
6
+ metadata.gz: ad9130c586c6668fa569a17591c9c28e87970b46311199823fffa916abd01ace1778c91cd30bf5ce6219d28a02cec96bf7ef16f39d0f541080ba6eafd1c6b3dc
7
+ data.tar.gz: 81cbc0db552b6c72ec82b12ec533c8f75b2120f066d18f23a616fda7e1247e8963e0f3820e50210ebf81b301ce0a05b569e6b2c809584f4284c6d28081baaeca
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # GifCountdown
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/gif_countdown.svg)](https://badge.fury.io/rb/gif_countdown)
4
+
3
5
  Create a animated gif countdown picture using RMagick.
4
6
 
5
7
  Each frame is a second.
@@ -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 { self.format = 'gif' }
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
- self.pointsize = this.fontsize
46
- self.font_family = this.font
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
- self.pointsize = (this.fontsize * 0.7).round
50
- self.font_family = this.font
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
- self.pointsize = this.fontsize
56
- self.font_family = this.font
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
- self.pointsize = (this.fontsize * 0.7).round
60
- self.font_family = this.font
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
- self.pointsize = this.fontsize
66
- self.font_family = this.font
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
- self.pointsize = (this.fontsize * 0.7).round
70
- self.font_family = this.font
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
- self.pointsize = this.fontsize
76
- self.font_family = this.font
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
- self.pointsize = (this.fontsize * 0.7).round
80
- self.font_family = this.font
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
 
@@ -1,3 +1,3 @@
1
1
  module GifCountdown
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.1'
3
3
  end
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 'gif_countdown/generator'
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.0
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: 2021-02-17 00:00:00.000000000 Z
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: 4.0.0
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: 4.0.0
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
- rubyforge_project:
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
@@ -1,5 +0,0 @@
1
- module GifCountdown
2
- class Engine < ::Rails::Engine
3
- isolate_namespace GifCountdown
4
- end
5
- end