subtitle_converter 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +17 -0
- data/Rakefile +6 -0
- data/bin/IDEO_subtitles_en.srt +126 -0
- data/bin/IDEO_subtitles_en.txt +154 -0
- data/bin/subtitle_converter +5 -0
- data/filename +2 -0
- data/lib/subtitle_converter/stl_reader.rb +29 -0
- data/lib/subtitle_converter/sub_rib_writer.rb +33 -0
- data/lib/subtitle_converter/subtitle_convertor.rb +22 -0
- data/lib/subtitle_converter/subtitle_convertor_command_line.rb +28 -0
- data/lib/subtitle_converter/version.rb +4 -0
- data/lib/subtitle_converter.rb +5 -0
- data/spec/assets/IDEO_subtitles_en.srt +540 -0
- data/spec/assets/IDEO_subtitles_en.txt +154 -0
- data/spec/assets/bad scrummaster_subtitles_cn.srt +180 -0
- data/spec/assets/bad scrummaster_subtitles_cn.txt +64 -0
- data/spec/assets/bad scrummaster_subtitles_en.srt +180 -0
- data/spec/assets/bad scrummaster_subtitles_en.txt +64 -0
- data/spec/integration_spec.rb +41 -0
- data/spec/stl_reader_spec.rb +27 -0
- data/spec/subrib_writer_spec.rb +54 -0
- data/spec/subtitle_convertor_command_line_spec.rb +43 -0
- data/spec/subtitle_convertor_spec.rb +46 -0
- data/subtitle_converter.gemfile +22 -0
- metadata +106 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
|
2
|
+
require 'subtitle_converter'
|
3
|
+
|
4
|
+
describe "the subtitle convertor" do
|
5
|
+
|
6
|
+
before (:each) {
|
7
|
+
@reader = double.as_null_object
|
8
|
+
@writer = double.as_null_object
|
9
|
+
}
|
10
|
+
|
11
|
+
subject { SubtitleConvertor.new }
|
12
|
+
|
13
|
+
it "Should create a reader when calling from" do
|
14
|
+
STLReader.should_receive(:new).and_return(@reader)
|
15
|
+
@reader.should_receive(:import_stl_content).with("subtitle_stl_file")
|
16
|
+
|
17
|
+
subject.from("subtitle_stl_file")
|
18
|
+
end
|
19
|
+
|
20
|
+
it "Should create a writer when calling to" do
|
21
|
+
SubRibWriter.should_receive(:new).and_return(nil)
|
22
|
+
|
23
|
+
subject.to("subtitle_srt_file")
|
24
|
+
end
|
25
|
+
|
26
|
+
it "Should convert from one to another on convert" do
|
27
|
+
STLReader.should_receive(:new).and_return(@reader)
|
28
|
+
SubRibWriter.should_receive(:new).and_return(@writer)
|
29
|
+
|
30
|
+
@reader.should_receive(:stl_sub_title_lines).and_return("subtitles")
|
31
|
+
@writer.should_receive(:parse_stl_lines).with("subtitles")
|
32
|
+
@writer.should_receive(:to_file).with("srt_file")
|
33
|
+
|
34
|
+
subject.from("stl_file")
|
35
|
+
subject.to("srt_file")
|
36
|
+
subject.convert
|
37
|
+
end
|
38
|
+
|
39
|
+
it "Follows a builder structure" do
|
40
|
+
STLReader.should_receive(:new).and_return(@reader)
|
41
|
+
SubRibWriter.should_receive(:new).and_return(@writer)
|
42
|
+
|
43
|
+
subject.from("stl_file").to("srt_file").convert
|
44
|
+
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.expand_path('../lib/subtitle_converter/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.name = 'subtitle_converter'
|
6
|
+
gem.version = SubtitleConverterVersion::VERSION
|
7
|
+
gem.date = Date.today.to_s
|
8
|
+
gem.executables = [ "subtitle_converter" ]
|
9
|
+
gem.license = 'MIT'
|
10
|
+
|
11
|
+
gem.summary = "Converting subtitles to different formats"
|
12
|
+
gem.description = "Convert video subtitles from one to another format. Currently only STL and SRT"
|
13
|
+
|
14
|
+
gem.authors = ['Twin Panichsombat', 'Bas Vodde']
|
15
|
+
gem.email = ['roof@odd-e.com', 'basv@odd-e.com']
|
16
|
+
gem.homepage = 'https://github.com/basvodde/subtitle_converter'
|
17
|
+
|
18
|
+
gem.add_dependency('rake', '~> 0')
|
19
|
+
gem.add_development_dependency('rspec', '~> 2.0', '>= 2.0.0')
|
20
|
+
|
21
|
+
gem.files = `git ls-files -- {.,test,spec,lib}/*`.split("\n")
|
22
|
+
end
|
metadata
ADDED
@@ -0,0 +1,106 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: subtitle_converter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Twin Panichsombat
|
8
|
+
- Bas Vodde
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2014-07-17 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rspec
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - "~>"
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '2.0'
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 2.0.0
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - "~>"
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '2.0'
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 2.0.0
|
48
|
+
description: Convert video subtitles from one to another format. Currently only STL
|
49
|
+
and SRT
|
50
|
+
email:
|
51
|
+
- roof@odd-e.com
|
52
|
+
- basv@odd-e.com
|
53
|
+
executables:
|
54
|
+
- subtitle_converter
|
55
|
+
extensions: []
|
56
|
+
extra_rdoc_files: []
|
57
|
+
files:
|
58
|
+
- README.md
|
59
|
+
- Rakefile
|
60
|
+
- bin/IDEO_subtitles_en.srt
|
61
|
+
- bin/IDEO_subtitles_en.txt
|
62
|
+
- bin/subtitle_converter
|
63
|
+
- filename
|
64
|
+
- lib/subtitle_converter.rb
|
65
|
+
- lib/subtitle_converter/stl_reader.rb
|
66
|
+
- lib/subtitle_converter/sub_rib_writer.rb
|
67
|
+
- lib/subtitle_converter/subtitle_convertor.rb
|
68
|
+
- lib/subtitle_converter/subtitle_convertor_command_line.rb
|
69
|
+
- lib/subtitle_converter/version.rb
|
70
|
+
- spec/assets/IDEO_subtitles_en.srt
|
71
|
+
- spec/assets/IDEO_subtitles_en.txt
|
72
|
+
- spec/assets/bad scrummaster_subtitles_cn.srt
|
73
|
+
- spec/assets/bad scrummaster_subtitles_cn.txt
|
74
|
+
- spec/assets/bad scrummaster_subtitles_en.srt
|
75
|
+
- spec/assets/bad scrummaster_subtitles_en.txt
|
76
|
+
- spec/integration_spec.rb
|
77
|
+
- spec/stl_reader_spec.rb
|
78
|
+
- spec/subrib_writer_spec.rb
|
79
|
+
- spec/subtitle_convertor_command_line_spec.rb
|
80
|
+
- spec/subtitle_convertor_spec.rb
|
81
|
+
- subtitle_converter.gemfile
|
82
|
+
homepage: https://github.com/basvodde/subtitle_converter
|
83
|
+
licenses:
|
84
|
+
- MIT
|
85
|
+
metadata: {}
|
86
|
+
post_install_message:
|
87
|
+
rdoc_options: []
|
88
|
+
require_paths:
|
89
|
+
- lib
|
90
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - ">="
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '0'
|
100
|
+
requirements: []
|
101
|
+
rubyforge_project:
|
102
|
+
rubygems_version: 2.2.2
|
103
|
+
signing_key:
|
104
|
+
specification_version: 4
|
105
|
+
summary: Converting subtitles to different formats
|
106
|
+
test_files: []
|