Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby Challenge #1: Shift Subtitle
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
spec
.document
.gitignore
LICENSE
README.rdoc
Rakefile
VERSION
thuss-shift_subtitle.gemspec

README.rdoc

shift_subtitle

My submission for Ruby Challenge #1: Shift Subtitle

rubylearning.com/blog/2009/09/24/rpcfn-shift-subtitle-1

Features

  • 100% RSpec test coverage of both lib/* and bin/*

  • Works in both Ruby 1.8 and 1.9

  • Bundled as a gemcutter gem (thanks to Jeweler)

  • No external gem dependencies to use the gem

  • Command line related code in shift_subtitle_cli.rb and SubRib/SRT processing code in shift_subtitle.rb

  • shift_subtitle.rb uses IO streams (such as File and StringIO) to support processing large files

  • Time shifting handles boundary cases

    • Lower boundary shifting 00:00:00,001 down by a second shifts to 00:00:00,000

    • Shifting above the 24 hour boundary works fine (25, 26, 27 hours) and doesn't rollover back to 00 hours

Requirements

You must have Gemcutter registered in your gem sources

Install

sudo gem install thuss-shift_subtitle

Usage

shift_subtitle –operation add –time 2,500 input output

Todo

  • Add a –version flag

  • Perhaps throw a warning if a subtraction shift results in the floor of 00:00:00,000

Copyright

Copyright © 2009 Todd Huss. See LICENSE for details.

Something went wrong with that request. Please try again.