thuss-shift_subtitle 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +3 -4
- data/VERSION +1 -1
- data/lib/shift_subtitle_cli.rb +1 -1
- data/spec/shift_subtitle_cli_spec.rb +1 -2
- data/{shift_subtitle.gemspec → thuss-shift_subtitle.gemspec} +5 -5
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -6,7 +6,8 @@ http://rubylearning.com/blog/2009/09/24/rpcfn-shift-subtitle-1
|
|
6
6
|
|
7
7
|
== Features
|
8
8
|
* 100% RSpec[http://rspec.info/] test coverage of both lib/* and bin/*
|
9
|
-
*
|
9
|
+
* Works in both Ruby 1.8 and 1.9
|
10
|
+
* Bundled as a gemcutter gem (thanks to Jeweler[http://github.com/technicalpickles/jeweler])
|
10
11
|
* No external gem dependencies to use the gem
|
11
12
|
* Command line related code in shift_subtitle_cli.rb and SubRib/SRT processing code in shift_subtitle.rb
|
12
13
|
* shift_subtitle.rb uses IO streams (such as File and StringIO) to support processing large files
|
@@ -16,9 +17,7 @@ http://rubylearning.com/blog/2009/09/24/rpcfn-shift-subtitle-1
|
|
16
17
|
|
17
18
|
== Requirements
|
18
19
|
|
19
|
-
You must have
|
20
|
-
|
21
|
-
gem sources -a http://gems.github.com
|
20
|
+
You must have Gemcutter[http://gemcutter.org/] registered in your gem sources
|
22
21
|
|
23
22
|
== Install
|
24
23
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/shift_subtitle_cli.rb
CHANGED
@@ -42,7 +42,7 @@ class ShiftSubtitleCli < ShiftSubtitle
|
|
42
42
|
opts.on("-h", "--help", "Show this help message.") { puts opts; exit 0 }
|
43
43
|
|
44
44
|
opts.parse!(arguments)
|
45
|
-
options[:input_file], options[:output_file] = arguments
|
45
|
+
options[:input_file], options[:output_file] = arguments[0], arguments[1]
|
46
46
|
|
47
47
|
if mandatory_options.find { |option| options[option].nil? }
|
48
48
|
$stderr.puts opts; exit 1
|
@@ -9,14 +9,13 @@ describe ShiftSubtitleCli do
|
|
9
9
|
|
10
10
|
describe "running bin/shift_subtitle" do
|
11
11
|
before :each do
|
12
|
-
Object.send(:remove_const, :ARGV)
|
13
12
|
input = StringIO.new("1\n00:00:24,600 --> 00:00:27,800\nthis is a test...")
|
14
13
|
@output = StringIO.new
|
15
14
|
File.stub!(:new).and_return(input, @output)
|
16
15
|
end
|
17
16
|
|
18
17
|
it "should shift the time when an SRT file is provided" do
|
19
|
-
ARGV
|
18
|
+
ARGV.clear.concat ['--operation', 'sub', '--time', '2,500', 'infile', 'outfile']
|
20
19
|
eval File.read(File.join(File.dirname(__FILE__), '..', 'bin', 'shift_subtitle'))
|
21
20
|
@output.string.should eql("1\n00:00:22,100 --> 00:00:25,300\nthis is a test...")
|
22
21
|
end
|
@@ -4,12 +4,12 @@
|
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{shift_subtitle}
|
8
|
-
s.version = "0.
|
7
|
+
s.name = %q{thuss-shift_subtitle}
|
8
|
+
s.version = "0.3.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Todd Huss"]
|
12
|
-
s.date = %q{2009-10-
|
12
|
+
s.date = %q{2009-10-05}
|
13
13
|
s.default_executable = %q{shift_subtitle}
|
14
14
|
s.description = %q{Submission for the Ruby Challenge to create a command line tool to shift SubRib formatted movie subtitles}
|
15
15
|
s.email = %q{thuss@gabrito.com}
|
@@ -28,10 +28,10 @@ Gem::Specification.new do |s|
|
|
28
28
|
"bin/shift_subtitle",
|
29
29
|
"lib/shift_subtitle.rb",
|
30
30
|
"lib/shift_subtitle_cli.rb",
|
31
|
-
"shift_subtitle.gemspec",
|
32
31
|
"spec/shift_subtitle_cli_spec.rb",
|
33
32
|
"spec/shift_subtitle_spec.rb",
|
34
|
-
"spec/spec_helper.rb"
|
33
|
+
"spec/spec_helper.rb",
|
34
|
+
"thuss-shift_subtitle.gemspec"
|
35
35
|
]
|
36
36
|
s.homepage = %q{http://github.com/thuss/shift_subtitle}
|
37
37
|
s.rdoc_options = ["--charset=UTF-8"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: thuss-shift_subtitle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Todd Huss
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-10-
|
12
|
+
date: 2009-10-05 00:00:00 -07:00
|
13
13
|
default_executable: shift_subtitle
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -41,10 +41,10 @@ files:
|
|
41
41
|
- bin/shift_subtitle
|
42
42
|
- lib/shift_subtitle.rb
|
43
43
|
- lib/shift_subtitle_cli.rb
|
44
|
-
- shift_subtitle.gemspec
|
45
44
|
- spec/shift_subtitle_cli_spec.rb
|
46
45
|
- spec/shift_subtitle_spec.rb
|
47
46
|
- spec/spec_helper.rb
|
47
|
+
- thuss-shift_subtitle.gemspec
|
48
48
|
has_rdoc: true
|
49
49
|
homepage: http://github.com/thuss/shift_subtitle
|
50
50
|
licenses: []
|