digitalfilmtree 0.0.4 → 0.0.5

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: 340bc00f2fc3fbb7667daec4f228c0d5df3b73b8
4
- data.tar.gz: e482bdbd73597334808b3817e713831e3e165ba3
3
+ metadata.gz: 83bf81173f76ca7aca351a01dcebf7d49d62ea33
4
+ data.tar.gz: 197b192ebe198df2355082158c95f2d9e44d78bf
5
5
  SHA512:
6
- metadata.gz: fc100047d646cf7298423c994db3019dfc3bc148ab77a0156014004c64e060f55a9a3da982f1e55139e7a498a4e372583fbc748baf61f9248a77bcf034f3a614
7
- data.tar.gz: 7d775dba1daa3f9612b8bf783bcf8fbd5b396f5c1f3bdeca18c7bd03ba72d305bada8b4fad8c75ef80c2f4131e4b7ad549d9bca622fecdba0892768b421ea95f
6
+ metadata.gz: abdfa1d8c95bbfadc6d0d30fe485fc4c5477b1bb2fedb40c02fcc25c46bd1a575635c614ce08cafaa1b7f70f5ef23eefd71416473a0725a3c9f86212654dd804
7
+ data.tar.gz: c08d08e78fe085e937faf92f01e4d13172823abf0784e45d0c63de18d23153379baedb4f6595d3d10844dd61656990df08611e10270dbeb359a8b5b0215aad99
File without changes
@@ -1,3 +1,3 @@
1
1
  module Digitalfilmtree
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -4,7 +4,7 @@ require 'edl'
4
4
  module Digitalfilmtree
5
5
  module VFX
6
6
  class EDLMLRenamer
7
- attr_accessor :ml, :edl, :movs
7
+ attr_accessor :ml, :edl, :movs, :ml_name_column
8
8
  attr_reader :folder, :count
9
9
 
10
10
  def folder=(path)
@@ -22,8 +22,9 @@ module Digitalfilmtree
22
22
 
23
23
  def execute
24
24
  raise "Not Ready" unless ready?
25
- @count = 0
26
25
  parse_marker_list
26
+ get_marker_list_name_column
27
+ @count = 0
27
28
  EDL::Parser.new.parse(File.open(self.edl)).each do |e|
28
29
  find_clip(e.reel) do |path|
29
30
  timeline_tc_in = e.rec_start_tc.to_s
@@ -39,9 +40,25 @@ module Digitalfilmtree
39
40
 
40
41
  protected
41
42
 
43
+ def get_marker_list_name_column
44
+ row = @ml_data.first
45
+ loop do
46
+ if self.ml_name_column && row[self.ml_name_column]
47
+ puts "Using marker list column index #{self.ml_name_column} for the Name"
48
+ break
49
+ else
50
+ puts "Please enter the number mapping to the Name column in the marker list:"
51
+ row.each_with_index do |e,i|
52
+ puts "#{i}) #{e}"
53
+ end
54
+ self.ml_name_column = STDIN.gets.strip.to_i
55
+ end
56
+ end
57
+ end
58
+
42
59
  def get_vfx_name timeline_tc_in, &block
43
60
  row = @ml_data.select{|r| r.include? timeline_tc_in }
44
- name = row.flatten.first
61
+ name = row.flatten[self.ml_name_column]
45
62
  block.call(name) if name
46
63
  end
47
64
 
@@ -58,7 +75,7 @@ module Digitalfilmtree
58
75
  entries = Dir.entries(self.folder).select do |i|
59
76
  i.include? patt
60
77
  end
61
- if sep = File::ALT_SEPARATOR
78
+ if sep = File::ALT_SEPARATOR # Windows support
62
79
  entries.map do |entry|
63
80
  File.join self.folder, sep, entry
64
81
  end
@@ -11,14 +11,24 @@ describe Digitalfilmtree::VFX::EDLMLRenamer do
11
11
 
12
12
  context "required files exist" do
13
13
  let(:target) { fixture('vfx/edl_ml_renamer') }
14
+ let(:originals) { subject.movs.map{|i| Pathname.new(i)} }
14
15
  before do
16
+ STDIN.stub(:gets).and_return "0"
15
17
  subject.folder = target.path
16
- @originals = subject.movs.map{|i| Pathname.new(i)}
17
18
  end
18
- it "renames .mov files in the folder" do
19
- @originals.each {|i| i.should exist }
20
- subject.execute
21
- @originals.each {|i| i.should_not exist }
19
+ shared_examples_for 'rename' do
20
+ it "renames .mov files in the folder" do
21
+ originals.each {|i| i.should exist }
22
+ subject.execute
23
+ originals.each {|i| i.should_not exist }
24
+ end
25
+ end
26
+ context 'name column is not defined' do
27
+ it_behaves_like 'rename'
28
+ end
29
+ context 'name column is predefined' do
30
+ before { subject.ml_name_column = 0 }
31
+ it_behaves_like 'rename'
22
32
  end
23
33
  after { target.clean.reset }
24
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: digitalfilmtree
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Keyvan Fatehi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-26 00:00:00.000000000 Z
11
+ date: 2013-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler