tracksperanto 2.2.0 → 2.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/History.txt CHANGED
@@ -1,3 +1,14 @@
1
+ === 2.2.2 / 2011-04-03
2
+
3
+ * The last change to PFMatchit exporter had adverse effects on pftrack files, now fixed.
4
+ * Pipeline now has it's own exceptions, all inheriting from RuntimeError
5
+
6
+ === 2.2.1 / 2011-04-01
7
+
8
+ * April fool!
9
+ * PFMAtchit requires LF in it's files instead of CRLF, but our FPTrack exporter used CRLF. Now fixed.
10
+ * Changed PFMatchit exporter to export .txt files instead of .2dt
11
+
1
12
  === 2.2.0 / 2011-03-01
2
13
 
3
14
  * Improve documentation substantially
data/Rakefile CHANGED
@@ -9,7 +9,7 @@ begin
9
9
 
10
10
  Hoe.spec('tracksperanto') do | p |
11
11
  p.readme_file = 'README.rdoc'
12
- p.extra_rdoc_files = FileList['*.rdoc']
12
+ p.extra_rdoc_files = FileList['*.rdoc'] + FileList['*.txt']
13
13
  p.version = Tracksperanto::VERSION
14
14
 
15
15
  p.extra_deps = {"progressbar" => ">=0"}
data/bin/tracksperanto CHANGED
@@ -18,10 +18,10 @@ require "net/http"
18
18
  require "open-uri"
19
19
  require "timeout"
20
20
 
21
- def version_check
21
+ def version_check(version_present)
22
22
  begin
23
23
  version_info = open("http://rubygems.org/api/v1/gems/tracksperanto.xml").string.scan(/<version>(.+)<\/version>/).to_s
24
- int_available, int_present = [version_info, Tracksperanto::VERSION].map{|v| v.scan(/(\d+)/).to_s.to_i }
24
+ int_available, int_present = [version_info, version_present].map{|v| v.scan(/(\d+)/).to_s.to_i }
25
25
  if int_available > int_present
26
26
  puts "Your version of Tracksperanto is probably out of date (the current version is #{version_info}, but you have #{Tracksperanto::VERSION})."
27
27
  puts "Please consider updating (run 'gem update tracksperanto')"
@@ -30,8 +30,12 @@ def version_check
30
30
  end
31
31
  end
32
32
 
33
+ def disclaimer
34
+ "Please consider a small donation to keep Tracksperanto going. http://guerilla-di.org/source-and-license/\n"+
35
+ "For information and support please contact info#{64.chr}guerilla-di.org"
36
+ end
37
+
33
38
  options = {}
34
- $notice = "Please consider a small donation to keep Tracksperanto going. http://guerilla-di.org/source-and-license/"
35
39
  $middlewares = []
36
40
  writer_klass_name = nil
37
41
  readers = Tracksperanto.importer_names
@@ -77,8 +81,7 @@ op.on("--flop", "Flop the comp vertically", &mw("Flop", :enabled, true))
77
81
  op.on("--version", "Show the version and exit") do |v|
78
82
  puts "Tracksperanto v.#{Tracksperanto::VERSION} running on Ruby #{RUBY_VERSION} on #{RUBY_PLATFORM}"
79
83
  puts "Copyright 2008-#{Time.now.year} by Guerilla-DI (Julik Tarkhanov and contributors)"
80
- puts "For questions and support contact info#{64.chr}guerilla-di.org"
81
- puts $notice
84
+ puts disclaimer
82
85
  version_check()
83
86
  exit(0)
84
87
  end
@@ -107,5 +110,6 @@ pipe.exporters = [Tracksperanto.get_exporter(writer_klass_name)] if writer_klass
107
110
  pipe.run(input_file, options)
108
111
  pbar.finish
109
112
 
110
- puts "Converted #{pipe.converted_points} trackers with #{pipe.converted_keyframes} keys. #{$notice}"
111
- version_check()
113
+ puts "Converted #{pipe.converted_points} trackers with #{pipe.converted_keyframes} keys."
114
+ puts disclaimer
115
+ version_check(Tracksperanto::VERSION)
@@ -1,16 +1,14 @@
1
1
  # Export for PFMatchit
2
2
  class Tracksperanto::Export::PFMatchit < Tracksperanto::Export::Base
3
3
 
4
- # PFtrack wants cross-platform linebreaks
5
- LINEBREAK = "\r\n"
6
- KEYFRAME_TEMPLATE = "%s %.3f %.3f %.3f\r\n"
4
+ KEYFRAME_TEMPLATE = "%s %.3f %.3f %.3f"
7
5
 
8
6
  def self.desc_and_extension
9
- "pfmatchit.2dt"
7
+ "pfmatchit.txt"
10
8
  end
11
9
 
12
10
  def self.human_name
13
- "PFMatchit .2dt file (single camera)"
11
+ "PFMatchit user track export file (single camera)"
14
12
  end
15
13
 
16
14
  def start_tracker_segment(tracker_name)
@@ -22,13 +20,13 @@ class Tracksperanto::Export::PFMatchit < Tracksperanto::Export::Base
22
20
 
23
21
  # TODO: currently exports to one camera
24
22
  def end_tracker_segment
25
- 2.times { @io.write(LINEBREAK) }
23
+ 2.times { @io.write(linebreak) }
26
24
  @io.write(@tracker_name.inspect) # autoquotes
27
- @io.write LINEBREAK
25
+ @io.write linebreak
28
26
  @io.write camera_name # For primary/secondary cam in stereo pair
29
- @io.write LINEBREAK
27
+ @io.write linebreak
30
28
  @io.write @frame_count
31
- @io.write LINEBREAK
29
+ @io.write linebreak
32
30
 
33
31
  @tracker_io.rewind
34
32
  @io.write(@tracker_io.read) until @tracker_io.eof?
@@ -39,10 +37,15 @@ class Tracksperanto::Export::PFMatchit < Tracksperanto::Export::Base
39
37
  @frame_count += 1
40
38
  line = KEYFRAME_TEMPLATE % [frame, abs_float_x, abs_float_y, float_residual / 8]
41
39
  @tracker_io.write(line)
40
+ @tracker_io.write(linebreak)
42
41
  end
43
42
 
44
43
  private
45
44
 
45
+ def linebreak
46
+ "\n"
47
+ end
48
+
46
49
  def camera_name
47
50
  "1"
48
51
  end
@@ -14,4 +14,9 @@ class Tracksperanto::Export::PFTrack5 < Tracksperanto::Export::PFMatchit
14
14
  def camera_name
15
15
  "Primary".inspect
16
16
  end
17
+
18
+ # PFT5 wants CRLF
19
+ def linebreak
20
+ "\r\n"
21
+ end
17
22
  end
data/lib/import/base.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  # this class the inherited class will be included in the list of supported
3
3
  # Tracksperanto importers. The API that an importer should present is very
4
4
  # basic, and consists only of a few methods. The main method is
5
- # stream_parse(io)
5
+ # `each`.
6
6
  class Tracksperanto::Import::Base
7
7
  include Enumerable
8
8
  include Tracksperanto::Safety
@@ -14,6 +14,10 @@ class Tracksperanto::Import::FlameStabilizer < Tracksperanto::Import::Base
14
14
  "Flame .stabilizer file"
15
15
  end
16
16
 
17
+ class Key
18
+ attr_accessor :at, :value, :extrap, :interp, :left_tangent, :right_tangent
19
+ end
20
+
17
21
  class ChannelBlock < Array
18
22
  include ::Tracksperanto::Casts
19
23
  cast_to_string :name
@@ -13,13 +13,13 @@ class Tracksperanto::Import::ShakeScript < Tracksperanto::Import::Base
13
13
 
14
14
  def each
15
15
  progress_proc = lambda{|msg| report_progress(msg) }
16
- Traxtractor.new(@io, [Proc.new, progress_proc])
16
+ TrackExtractor.new(@io, [Proc.new, progress_proc])
17
17
  end
18
18
 
19
19
  private
20
20
 
21
21
  # Extractor. Here we define copies of Shake's standard node creation functions.
22
- class Traxtractor < Tracksperanto::ShakeGrammar::Catcher
22
+ class TrackExtractor < Tracksperanto::ShakeGrammar::Catcher
23
23
  include Tracksperanto::ZipTuples
24
24
 
25
25
  # Normally, we wouldn't need to look for the variable name from inside of the funcall. However,
data/lib/pipeline/base.rb CHANGED
@@ -1,17 +1,35 @@
1
- # The base pipeline is the whole process of track conversion from start to finish. The pipeline object organizes the import formats, scans them,
2
- # applies the default middlewares and yields them for processing. Here's how a calling sequence for a pipeline looks like:
3
- #
4
- # pipe = Tracksperanto::Pipeline::Base.new
5
- # pipe.progress_block = lambda{|percent, msg| puts("#{msg}..#{percent.to_i}%") }
6
- #
7
- # pipe.run("/tmp/shakescript.shk", :width => 720, :height => 576) do | *all_middlewares |
8
- # # configure middlewares here
9
- # end
10
- #
11
- # The pipeline will also automatically allocate output files with the right extensions
12
- # at the same place where the original file resides,
13
- # and setup outputs for all supported export formats.
14
- class Tracksperanto::Pipeline::Base
1
+ module Tracksperanto::Pipeline
2
+
3
+ class EmptySourceFileError < RuntimeError
4
+ def message; "This is an empty source file"; end
5
+ end
6
+
7
+ class UnknownFormatError < RuntimeError
8
+ def message; "Unknown input format"; end
9
+ end
10
+
11
+ class DimensionsRequiredError < RuntimeError
12
+ def message; "Width and height must be provided for this importer"; end
13
+ end
14
+
15
+ class NoTrackersRecoveredError < RuntimeError
16
+ def message; "Could not recover any non-empty trackers from this file. Wrong import format maybe?"; end
17
+ end
18
+
19
+
20
+ # The base pipeline is the whole process of track conversion from start to finish. The pipeline object organizes the import formats, scans them,
21
+ # applies the middlewares. Here's how a calling sequence for a pipeline looks like:
22
+ #
23
+ # pipe = Tracksperanto::Pipeline::Base.new
24
+ # pipe.middleware_tuples = ["Golden", {:enabled => true}]
25
+ # pipe.progress_block = lambda{|percent, msg| puts("#{msg}..#{percent.to_i}%") }
26
+ # pipe.run("/tmp/shakescript.shk", :width => 720, :height => 576)
27
+ #
28
+ # The pipeline will also automatically allocate output files with the right extensions
29
+ # at the same place where the original file resides,
30
+ # and setup outputs for all supported export formats.
31
+ class Base
32
+
15
33
  EXTENSION = /\.([^\.]+)$/ #:nodoc:
16
34
  PERMITTED_OPTIONS = [:importer, :width, :height]
17
35
 
@@ -36,6 +54,12 @@ class Tracksperanto::Pipeline::Base
36
54
  # Contains arrays of the form ["MiddewareName", {:param => value}]
37
55
  attr_accessor :middleware_tuples
38
56
 
57
+
58
+ def initialize(*any)
59
+ super
60
+ @ios = []
61
+ end
62
+
39
63
  def wrap_output_with_middlewares(output)
40
64
  return output unless (middleware_tuples && middleware_tuples.any?)
41
65
 
@@ -57,7 +81,7 @@ class Tracksperanto::Pipeline::Base
57
81
  importer = initialize_importer_with_path_and_options(from_input_file_path, passed_options)
58
82
 
59
83
  # Check for empty files
60
- raise "This is an empty source file" if File.stat(from_input_file_path).size.zero?
84
+ raise EmptySourceFileError if File.stat(from_input_file_path).size.zero?
61
85
 
62
86
  # Open the file
63
87
  read_data = File.open(from_input_file_path, "rb")
@@ -89,12 +113,12 @@ class Tracksperanto::Pipeline::Base
89
113
  require_dimensions_in!(options)
90
114
  d.importer_klass.new(:width => options[:width], :height => options[:height])
91
115
  else
92
- raise "Unknown input format"
116
+ raise UnknownFormatError
93
117
  end
94
118
  end
95
119
 
96
120
  def require_dimensions_in!(opts)
97
- raise "Width and height must be provided for this importer" unless (opts[:width] && opts[:height])
121
+ raise DimensionsRequiredError unless (opts[:width] && opts[:height])
98
122
  end
99
123
 
100
124
  # Runs the export and returns the number of points and keyframes processed.
@@ -114,22 +138,22 @@ class Tracksperanto::Pipeline::Base
114
138
  io_with_progress = Tracksperanto::ProgressiveIO.new(tracker_data_io) do | offset, of_total |
115
139
  percent_complete = (50.0 / of_total) * offset
116
140
  end
117
- @ios << io_with_progress
141
+ @ios.push(io_with_progress)
118
142
 
119
143
  @accumulator = Tracksperanto::Accumulator.new
120
- importer.io = io_with_progress
121
- importer.each {|t| @accumulator.push(t) }
122
144
 
123
- # OBSOLETE - for this version we are going to permit it
145
+ # OBSOLETE - for this version we are going to permit it.
124
146
  if importer.respond_to?(:stream_parse)
147
+ STDERR.puts "Import::Base#stream_parse(io) is obsolete, please rewrite your importer to use each instead"
125
148
  importer.receiver = @accumulator
126
149
  importer.stream_parse(io_with_progress)
150
+ else
151
+ importer.io = io_with_progress
152
+ importer.each {|t| @accumulator.push(t) }
127
153
  end
128
154
 
129
155
  report_progress(percent_complete = 50.0, "Validating #{@accumulator.size} imported trackers")
130
- if @accumulator.size.zero?
131
- raise "Could not recover any non-empty trackers from this file. Wrong import format maybe?"
132
- end
156
+ raise NoTrackersRecoveredError if @accumulator.size.zero?
133
157
 
134
158
  report_progress(percent_complete, "Starting export")
135
159
 
@@ -162,8 +186,7 @@ class Tracksperanto::Pipeline::Base
162
186
  ensure
163
187
  @accumulator.clear
164
188
  @ios.map!{|e| e.close! rescue e.close }
165
- @ios = []
166
- @accumulator = nil
189
+ @ios.clear
167
190
  end
168
191
 
169
192
  # Setup output files and return a single output
@@ -181,7 +204,7 @@ class Tracksperanto::Pipeline::Base
181
204
 
182
205
  # Open the file for writing and register it to be closed automatically
183
206
  def open_owned_export_file(path_to_file)
184
- @ios ||= []
185
207
  @ios.push(File.open(path_to_file, "wb"))[-1]
186
208
  end
209
+ end
187
210
  end
data/lib/tracksperanto.rb CHANGED
@@ -5,7 +5,7 @@ require 'tempfile'
5
5
 
6
6
  module Tracksperanto
7
7
  PATH = File.expand_path(File.dirname(__FILE__))
8
- VERSION = '2.2.0'
8
+ VERSION = '2.2.2'
9
9
 
10
10
  module Import; end
11
11
  module Export; end
@@ -1,18 +1,16 @@
1
1
  # An accumulator buffer for Ruby objects. Use it to sequentially store a shitload
2
2
  # of objects on disk and then retreive them one by one. Make sure to call clear when done
3
- # with it to discard the stored blob.
4
- #
5
- # This object is intended to be used as a Tracksperanto::Import::Base#receiver, but can be used
6
- # in general like a disk-based object buffer.
3
+ # with it to discard the stored blob. It can be used like a disk-based object buffer.
4
+ # (Tracksperanto stores parsed trackers into it)
7
5
  #
8
6
  # a = Tracksperanto::Accumulator.new
9
7
  # parse_big_file do | one_node |
10
8
  # a.push(one_node)
11
9
  # end
12
10
  #
13
- # a.size #=> 30932
11
+ # a.size #=> 30932 # We've stored 30 thousand objects on disk without breaking a sweat
14
12
  # a.each do | node_read_from_disk |
15
- # # do something with node
13
+ # # do something with node that has been recovered from disk
16
14
  # end
17
15
  #
18
16
  # a.clear # ensure that the file is deleted
@@ -24,6 +22,7 @@ class Tracksperanto::Accumulator
24
22
 
25
23
  def initialize
26
24
  @store = Tracksperanto::BufferIO.new
25
+
27
26
  @size = 0
28
27
  @byte_size = 0
29
28
 
@@ -33,15 +32,19 @@ class Tracksperanto::Accumulator
33
32
  # Store an object
34
33
  def push(object_to_store)
35
34
  @store.seek(@byte_size)
35
+
36
36
  blob = marshal_object(object_to_store)
37
37
  @store.write(blob)
38
38
  @size += 1
39
39
  @byte_size = @byte_size + blob.size
40
+
40
41
  object_to_store
41
42
  end
42
43
 
44
+ alias_method :<<, :push
45
+
43
46
  # Retreive each stored object in succession. All other Enumerable
44
- # methods are also available (but be careful with Enumerable#map)
47
+ # methods are also available (but be careful with Enumerable#map and to_a)
45
48
  def each
46
49
  @store.rewind
47
50
  @size.times { yield(recover_object) }
@@ -51,6 +54,7 @@ class Tracksperanto::Accumulator
51
54
  def clear
52
55
  @store.close!
53
56
  @size = 0
57
+ @offsets = []
54
58
  end
55
59
 
56
60
  private
@@ -1,54 +1,54 @@
1
-
2
-
3
- "Parabolic_1_from_top_left"
4
- 1
5
- 19
6
- 0 0.000 1080.000 0.000
7
- 1 96.000 874.800 0.006
8
- 2 192.000 691.200 0.012
9
- 3 288.000 529.200 0.018
10
- 4 384.000 388.800 0.024
11
- 5 480.000 270.000 0.030
12
- 6 576.000 172.800 0.036
13
- 7 672.000 97.200 0.042
14
- 8 768.000 43.200 0.048
15
- 9 864.000 10.800 0.054
16
- 12 1152.000 43.200 0.071
17
- 13 1248.000 97.200 0.077
18
- 14 1344.000 172.800 0.083
19
- 15 1440.000 270.000 0.089
20
- 16 1536.000 388.800 0.095
21
- 17 1632.000 529.200 0.101
22
- 18 1728.000 691.200 0.107
23
- 19 1824.000 874.800 0.113
24
- 20 1920.000 1080.000 0.119
25
-
26
-
27
- "Parabolic_2_from_bottom_right"
28
- 1
29
- 19
30
- 0 1920.000 0.000 0.000
31
- 1 1824.000 205.200 0.006
32
- 2 1728.000 388.800 0.012
33
- 3 1632.000 550.800 0.018
34
- 4 1536.000 691.200 0.024
35
- 5 1440.000 810.000 0.030
36
- 6 1344.000 907.200 0.036
37
- 7 1248.000 982.800 0.042
38
- 8 1152.000 1036.800 0.048
39
- 9 1056.000 1069.200 0.054
40
- 12 768.000 1036.800 0.071
41
- 13 672.000 982.800 0.077
42
- 14 576.000 907.200 0.083
43
- 15 480.000 810.000 0.089
44
- 16 384.000 691.200 0.095
45
- 17 288.000 550.800 0.101
46
- 18 192.000 388.800 0.107
47
- 19 96.000 205.200 0.113
48
- 20 0.000 0.000 0.119
49
-
50
-
51
- "SingleFrame"
52
- 1
53
- 1
54
- 0 970.000 550.000 0.000
1
+
2
+
3
+ "Parabolic_1_from_top_left"
4
+ 1
5
+ 19
6
+ 0 0.000 1080.000 0.000
7
+ 1 96.000 874.800 0.006
8
+ 2 192.000 691.200 0.012
9
+ 3 288.000 529.200 0.018
10
+ 4 384.000 388.800 0.024
11
+ 5 480.000 270.000 0.030
12
+ 6 576.000 172.800 0.036
13
+ 7 672.000 97.200 0.042
14
+ 8 768.000 43.200 0.048
15
+ 9 864.000 10.800 0.054
16
+ 12 1152.000 43.200 0.071
17
+ 13 1248.000 97.200 0.077
18
+ 14 1344.000 172.800 0.083
19
+ 15 1440.000 270.000 0.089
20
+ 16 1536.000 388.800 0.095
21
+ 17 1632.000 529.200 0.101
22
+ 18 1728.000 691.200 0.107
23
+ 19 1824.000 874.800 0.113
24
+ 20 1920.000 1080.000 0.119
25
+
26
+
27
+ "Parabolic_2_from_bottom_right"
28
+ 1
29
+ 19
30
+ 0 1920.000 0.000 0.000
31
+ 1 1824.000 205.200 0.006
32
+ 2 1728.000 388.800 0.012
33
+ 3 1632.000 550.800 0.018
34
+ 4 1536.000 691.200 0.024
35
+ 5 1440.000 810.000 0.030
36
+ 6 1344.000 907.200 0.036
37
+ 7 1248.000 982.800 0.042
38
+ 8 1152.000 1036.800 0.048
39
+ 9 1056.000 1069.200 0.054
40
+ 12 768.000 1036.800 0.071
41
+ 13 672.000 982.800 0.077
42
+ 14 576.000 907.200 0.083
43
+ 15 480.000 810.000 0.089
44
+ 16 384.000 691.200 0.095
45
+ 17 288.000 550.800 0.101
46
+ 18 192.000 388.800 0.107
47
+ 19 96.000 205.200 0.113
48
+ 20 0.000 0.000 0.119
49
+
50
+
51
+ "SingleFrame"
52
+ 1
53
+ 1
54
+ 0 970.000 550.000 0.000
@@ -3,12 +3,9 @@ require File.expand_path(File.dirname(__FILE__)) + '/../helper'
3
3
  class PFMatchitExportTest < Test::Unit::TestCase
4
4
  include ParabolicTracks
5
5
 
6
- def test_human_name
7
- assert_equal "PFMatchit .2dt file (single camera)", Tracksperanto::Export::PFMatchit.human_name
8
- end
9
-
10
6
  def test_desc_and_ext
11
- assert_equal "pfmatchit.2dt", Tracksperanto::Export::PFMatchit.desc_and_extension
7
+ assert_equal "PFMatchit user track export file (single camera)", Tracksperanto::Export::PFMatchit.human_name
8
+ assert_equal "pfmatchit.txt", Tracksperanto::Export::PFMatchit.desc_and_extension
12
9
  end
13
10
 
14
11
  P = File.dirname(__FILE__) + "/samples/ref_PFMatchit.2dt"
data/test/test_cli.rb CHANGED
@@ -49,7 +49,7 @@ class CliTest < Test::Unit::TestCase
49
49
  assert_equal 0, status, "Should exit with a normal status"
50
50
  fs = %w(. ..
51
51
  flm.stabilizer flm_3de_v3.txt flm_3de_v4.txt flm_boujou_text.txt flm_flame.stabilizer
52
- flm_matchmover.rz2 flm_mayalive.txt flm_nuke.nk flm_pfmatchit.2dt flm_pftrack_v4.2dt
52
+ flm_matchmover.rz2 flm_mayalive.txt flm_nuke.nk flm_pfmatchit.txt flm_pftrack_v4.2dt
53
53
  flm_pftrack_v5.2dt flm_shake_trackers.txt flm_syntheyes_2dt.txt
54
54
  )
55
55
 
@@ -47,7 +47,7 @@ class PipelineTest < Test::Unit::TestCase
47
47
  empty_file_path = "./input_empty.stabilizer"
48
48
  f = File.open(empty_file_path, "w"){|f| f.write('') }
49
49
  pipeline = Tracksperanto::Pipeline::Base.new
50
- assert_raise(RuntimeError) { pipeline.run(empty_file_path) }
50
+ assert_raise(Tracksperanto::Pipeline::EmptySourceFileError) { pipeline.run(empty_file_path) }
51
51
  end
52
52
 
53
53
  def test_middleware_initialization_from_tuples
@@ -72,7 +72,7 @@ class PipelineTest < Test::Unit::TestCase
72
72
  def test_run_with_autodetected_importer_that_requires_size
73
73
  FileUtils.cp("./import/samples/shake_script/four_tracks_in_one_stabilizer.shk", "./input.shk")
74
74
  pipeline = Tracksperanto::Pipeline::Base.new
75
- assert_raise(RuntimeError) { pipeline.run("./input.shk") }
75
+ assert_raise(Tracksperanto::Pipeline::DimensionsRequiredError) { pipeline.run("./input.shk") }
76
76
  end
77
77
 
78
78
  def test_run_with_autodetected_importer_that_requires_size_when_size_supplied
@@ -97,15 +97,15 @@ class PipelineTest < Test::Unit::TestCase
97
97
  def test_run_with_unknown_format_raises
98
98
  FileUtils.touch("./input.txt")
99
99
  pipeline = Tracksperanto::Pipeline::Base.new
100
- assert_raise(RuntimeError) { pipeline.run("./input.txt") }
101
- assert_raise(RuntimeError) { pipeline.run("./input.txt", :width => 100, :height => 100) }
102
- assert_raise(RuntimeError) { pipeline.run("./input.txt", :importer => "Syntheyes") }
100
+ assert_raise(Tracksperanto::Pipeline::UnknownFormatError) { pipeline.run("./input.txt") }
101
+ assert_raise(Tracksperanto::Pipeline::UnknownFormatError) { pipeline.run("./input.txt", :width => 100, :height => 100) }
102
+ assert_raise(Tracksperanto::Pipeline::DimensionsRequiredError) { pipeline.run("./input.txt", :importer => "Syntheyes") }
103
103
  end
104
104
 
105
105
  def test_run_with_overridden_importer_and_size
106
106
  FileUtils.cp("./import/samples/3de_v4/3de_export_cube.txt", "./input.txt")
107
107
  pipeline = Tracksperanto::Pipeline::Base.new
108
- assert_raise(RuntimeError) { pipeline.run("./input.txt", :importer => "Equalizer4") }
108
+ assert_raise(Tracksperanto::Pipeline::DimensionsRequiredError) { pipeline.run("./input.txt", :importer => "Equalizer4") }
109
109
  assert_nothing_raised { pipeline.run("./input.txt", :importer => "Equalizer4", :width => 720, :height => 576) }
110
110
  end
111
111
 
@@ -43,7 +43,11 @@ class TestProgressiveIO < Test::Unit::TestCase
43
43
  io.progress_block = lambda do | offset, total |
44
44
  assert_equal [1, 3], [offset, total]
45
45
  end
46
- assert_equal 49, io.getc
46
+ if RUBY_VERSION < "1.9"
47
+ assert_equal 49, io.getc
48
+ else
49
+ assert_equal "1", io.getc
50
+ end
47
51
  end
48
52
 
49
53
  def test_gets
@@ -67,7 +71,12 @@ class TestProgressiveIO < Test::Unit::TestCase
67
71
  io.progress_block = lambda do | offset, total |
68
72
  assert_equal [1, 3], [offset, total]
69
73
  end
70
- assert_equal 49, io.readchar
74
+
75
+ if RUBY_VERSION < "1.9"
76
+ assert_equal 49, io.getc
77
+ else
78
+ assert_equal "1", io.getc
79
+ end
71
80
  end
72
81
 
73
82
  def test_readline
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracksperanto
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 2
9
- - 0
10
- version: 2.2.0
9
+ - 2
10
+ version: 2.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Julik Tarkhanov
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-03-01 00:00:00 +01:00
18
+ date: 2011-04-02 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency