Skip to content
This repository
Browse code

Merge pull request #214 from mroth/fix-last-option-to-includes-gifs

--last includes animated gifs, fixes issue #213
  • Loading branch information...
commit 8de0eafcad2723a993c1263055793649fed9a8ec 2 parents 9b3c2f8 + edde8e5
Matthew Hutchinson matthutchinson authored

Showing 2 changed files with 6 additions and 6 deletions. Show diff stats Hide diff stats

  1. +2 2 bin/lolcommits
  2. +4 4 lib/lolcommits/configuration.rb
4 bin/lolcommits
@@ -170,10 +170,10 @@ def do_gif
170 170
171 171 case Choice.choices[:gif]
172 172 when 'today'
173   - lolimages = configuration.images_today
  173 + lolimages = configuration.jpg_images_today
174 174 filename = "#{Date.today.to_s}.gif"
175 175 else
176   - lolimages = configuration.images
  176 + lolimages = configuration.jpg_images
177 177 filename = 'archive.gif'
178 178 end
179 179
8 lib/lolcommits/configuration.rb
@@ -41,15 +41,15 @@ def archivedir
41 41 end
42 42
43 43 def most_recent
44   - Dir.glob(File.join self.loldir, '*.jpg').max_by { |f| File.mtime(f) }
  44 + Dir.glob(File.join self.loldir, '*.{jpg,gif}').max_by { |f| File.mtime(f) }
45 45 end
46 46
47   - def images
  47 + def jpg_images
48 48 Dir.glob(File.join self.loldir, '*.jpg').sort_by { |f| File.mtime(f) }
49 49 end
50 50
51   - def images_today
52   - images.select { |f| Date.parse(File.mtime(f).to_s) === Date.today }
  51 + def jpg_images_today
  52 + jpg_images.select { |f| Date.parse(File.mtime(f).to_s) === Date.today }
53 53 end
54 54
55 55 def raw_image(image_file_type = 'jpg')

0 comments on commit 8de0eaf

Please sign in to comment.
Something went wrong with that request. Please try again.