ffsplitter 0.0.2 → 0.0.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 06995073fdeefca7864c22bde674d1e8875dc8f9
4
- data.tar.gz: 183886a0825bcf850fb4507a691fa9466c742bf6
3
+ metadata.gz: acf9900954257651670f15133609d4a7a1ca78c2
4
+ data.tar.gz: 62e6dca9c7aa87214326423d096298918812e042
5
5
  SHA512:
6
- metadata.gz: 8e4da0bc89ff46aafe84820de193c9b778a82c89d2a2959ee7b31e45d20cef6170e8506a62d9236b1a598c2bd57b5701065e67dbc22f19fab5c7c5c836eb9a70
7
- data.tar.gz: f07368ae40a95c886faa05f4283725b71d0518b36eb02da939383ab761f2b1ec4d87c39252372050a05823fd6d6c286a56658e30d293a68529313f87dcc5fd73
6
+ metadata.gz: 3dafaed0ded9a9130e8860ef52bd6b9a0b49be6005c01329a0cc6529fc7fab8a4d20aaaa6f9560e3ef1803e6d4a98cfe23f83fc7268760993b2b8ac09ce6923f
7
+ data.tar.gz: a7a04d0efac73c31472219edf1b58724c03c4b6fd5a605bede4d36481006486374b4961e239b1cd68fd115ccb00670182fb25ef4eeb4e0ce59e577e221bded4c
data/README.md CHANGED
@@ -7,10 +7,10 @@
7
7
 
8
8
  ## Usage
9
9
 
10
- Given the video file `my-video.mp4`
11
- And `my-video.mp4` has embedded chapter markers
12
- When I execute `ffsplitter my-video.mp4`
13
- Then `.mp4` files will be created for each chapter
10
+ * Given the video file `my-video.mp4`
11
+ * And `my-video.mp4` has embedded chapter markers
12
+ * When I execute `ffsplitter my-video.mp4`
13
+ * Then `.mp4` files will be created for each chapter
14
14
 
15
15
  ## Contributing
16
16
 
@@ -38,7 +38,7 @@ module FFSplitter
38
38
  end
39
39
 
40
40
  def filename
41
- "#{track} #{title.lstrip}"
41
+ "#{track} #{title.gsub(/[,';:]/, '').lstrip}"
42
42
  end
43
43
 
44
44
  def index
@@ -19,7 +19,7 @@ module FFSplitter
19
19
 
20
20
  def chapter_command(chapter)
21
21
  output_file = File.expand_path(chapter.filename, output_directory)
22
- "-i '#{filename}' -ss #{chapter.start_time} -to #{chapter.end_time} -c copy -v error '#{output_file}.mp4'"
22
+ "-i '#{filename}' -ss #{chapter.start_time} -to #{chapter.end_time} -c copy '#{output_file}.mp4'"
23
23
  end
24
24
  end
25
25
  end
@@ -1,3 +1,3 @@
1
1
  module FFSplitter
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
data/spec/chapter_spec.rb CHANGED
@@ -30,10 +30,20 @@ module FFSplitter
30
30
  end
31
31
  end
32
32
 
33
- describe "filename" do
34
- let(:chapter){ Chapter.new(title: " test title") }
35
- it "prettys up the chapter title" do
36
- expect(chapter.filename).to eq("01 test title")
33
+ describe "#filename" do
34
+ let(:filename) {""}
35
+ let(:chapter){ Chapter.new(title: filename) }
36
+ context "with leading spaces" do
37
+ let(:filename) { " test title" }
38
+ it "removes them" do
39
+ expect(chapter.filename).to eq("01 test title")
40
+ end
41
+ end
42
+ context "with ';:" do
43
+ let(:filename) { "what's wrong; with: this" }
44
+ it "removes them" do
45
+ expect(chapter.filename).to eq("01 whats wrong with this")
46
+ end
37
47
  end
38
48
  end
39
49
 
@@ -5,7 +5,7 @@ module FFSplitter
5
5
  before { Dir.mkdir("tmp") unless Dir.exist?("tmp") }
6
6
 
7
7
  describe "split" do
8
- before { `bundle exec ruby -Ilib bin/ffsplitter 'spec/fixtures/test video.mp4' tmp` }
8
+ before { `bundle exec ruby -Ilib bin/ffsplitter 'spec/fixtures/test video.mp4' tmp 2>&1` }
9
9
  let(:file_list) { Dir.glob("tmp/*") }
10
10
  it "creates files" do
11
11
  expect(file_list).to include("tmp/01 Chapter 1.mp4")
data/spec/ffmpeg_spec.rb CHANGED
@@ -45,7 +45,6 @@ module FFSplitter
45
45
  expect(command).to match("-ss 10.0")
46
46
  expect(command).to match("-to 20.0")
47
47
  expect(command).to match("-c copy")
48
- expect(command).to match("-v error")
49
48
  expect(command).to match("#{File.expand_path(chapter.filename)}")
50
49
  end
51
50
  end
@@ -20,19 +20,19 @@ module FFSplitter
20
20
  end
21
21
 
22
22
  it "calculates the timebase" do
23
- expect(chapters.first[:timebase]).to eq(0.5)
23
+ expect(chapters.first.timebase).to eq(0.5)
24
24
  end
25
25
 
26
26
  it "sets the start_frames" do
27
- expect(chapters.first[:start_frames]).to eq(100)
27
+ expect(chapters.first.start_frames).to eq(100)
28
28
  end
29
29
 
30
30
  it "sets the end_frames" do
31
- expect(chapters.first[:end_frames]).to eq(200)
31
+ expect(chapters.first.end_frames).to eq(200)
32
32
  end
33
33
 
34
34
  it "parses the title" do
35
- expect(chapters.first[:title]).to eq("Ludwig van Beethoven - Piano Trio in D Major")
35
+ expect(chapters.first.title).to eq("Ludwig van Beethoven - Piano Trio in D Major")
36
36
  end
37
37
  end
38
38
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffsplitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Rockwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-13 00:00:00.000000000 Z
11
+ date: 2013-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: virtus