Skip to content

Instantly share code, notes, and snippets.

@xaviershay
Last active December 23, 2015 16:59
Show Gist options
  • Save xaviershay/6665356 to your computer and use it in GitHub Desktop.
Save xaviershay/6665356 to your computer and use it in GitHub Desktop.
Shows a summary checklist of a pluralsight screencast source.
#!/usr/bin/env ruby
require 'colorize'
def pair(label, value)
puts "%-15s%s" % [label, value ? "✓".green : "✗".red]
end
Dir['database-your-friend-m*'].each do |f|
puts f
pair "Meta", File.exist?(f + '/' + f + '.meta')
pair "Slides PDF", File.exist?(f + '/slides.pdf')
pair "Slides Key", File.exist?(f + '/slides.key')
pair "Questions", File.exist?(f + '/questions.txt')
pair "Demos", File.exist?(f + '/demos.zip')
puts
end
total = 0
puts "Overall"
Dir['database-your-friend-m*'].each do |f|
length = `mdls -name kMDItemDurationSeconds #{f}/*.mov | awk '{print $3}'`.lines.map(&:to_i).reduce(:+)
puts "%-15s %i:%02i" % [f.split('-').last, length / 60, length % 60]
total += length
end
puts
puts "%-15s %i:%02i" % ["Total", total / 60, total % 60]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment