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 +4 -4
 - data/README.md +4 -4
 - data/lib/ffsplitter/chapter.rb +1 -1
 - data/lib/ffsplitter/ffmpeg.rb +1 -1
 - data/lib/ffsplitter/version.rb +1 -1
 - data/spec/chapter_spec.rb +14 -4
 - data/spec/end_to_end_spec.rb +1 -1
 - data/spec/ffmpeg_spec.rb +0 -1
 - data/spec/metadata_parser_spec.rb +4 -4
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: acf9900954257651670f15133609d4a7a1ca78c2
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 62e6dca9c7aa87214326423d096298918812e042
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 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 
     | 
    
         | 
    
        data/lib/ffsplitter/chapter.rb
    CHANGED
    
    
    
        data/lib/ffsplitter/ffmpeg.rb
    CHANGED
    
    | 
         @@ -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  
     | 
| 
      
 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
         
     | 
    
        data/lib/ffsplitter/version.rb
    CHANGED
    
    
    
        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(: 
     | 
| 
       35 
     | 
    
         
            -
                   
     | 
| 
       36 
     | 
    
         
            -
             
     | 
| 
      
 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 
     | 
    
         | 
    
        data/spec/end_to_end_spec.rb
    CHANGED
    
    | 
         @@ -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
    
    
| 
         @@ -20,19 +20,19 @@ module FFSplitter 
     | 
|
| 
       20 
20 
     | 
    
         
             
                    end
         
     | 
| 
       21 
21 
     | 
    
         | 
| 
       22 
22 
     | 
    
         
             
                    it "calculates the timebase" do
         
     | 
| 
       23 
     | 
    
         
            -
                      expect(chapters.first 
     | 
| 
      
 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 
     | 
| 
      
 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 
     | 
| 
      
 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 
     | 
| 
      
 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. 
     | 
| 
      
 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- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2013-10-16 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: virtus
         
     |