sequencer 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 00d7f368f6b26fc1b049b316420a995cb56bcd03
4
+ data.tar.gz: 3ac4490cb81e1119581a12fcd42f9702e16c4449
5
+ SHA512:
6
+ metadata.gz: b1fa4a5827069cb6589b0dd196736417b7d2ccba1f23e7c0214b687b377529dacf5c41755e42fa6ed4b06ea9c599f37d4165cf1ee33f6244329f705157c9feba
7
+ data.tar.gz: 35dbb98c38c7c379eb838f866f52f406caf90a8c1d425b50f7f7398eb5c4687add3a113971a9e05556fe85c868c892d8594571da8698a20735ef0da7f4464426
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  group :development do
4
4
  gem "jeweler"
@@ -1,3 +1,7 @@
1
+ === 1.3.0
2
+
3
+ * Add Sequencer.from_enum() for parsing out passed path lists
4
+
1
5
  === 1.2.0
2
6
 
3
7
  * Adds Sequencer.recursive_entries() for recursive sequence scans
@@ -1,25 +1,18 @@
1
1
  module Sequencer
2
- VERSION = '1.2.0'
2
+ VERSION = '1.3.0'
3
3
  NUMBERS_AT_END = /(\d+)([^\d]+)?$/
4
4
 
5
5
  extend self
6
6
 
7
- # Detects sequences in the passed directory (same as Dir.entries but returns Sequence objects).
8
- # Single files will be upgraded to single-frame Sequences
9
- def entries(of_dir)
10
- actual_files = Dir.entries(of_dir)
11
-
12
- # Remove all dotfiles
13
- actual_files.reject!{|f| f =~ /^\./}
14
-
15
- # Ensure files are presorted
16
- actual_files.sort!
7
+ # Groups the names in the passed Enumerable
8
+ # into Sequence objects and returns them
9
+ def from_enumerable(enum, assume_directory = '')
10
+ # Remove all dotfiles, ensure files are presorted
11
+ actual_files = enum.reject{|e| e =~ /^\./ }.sort
17
12
 
18
13
  groups = {}
19
14
 
20
15
  actual_files.each do | e |
21
- next if File.directory?(File.join(of_dir, e))
22
-
23
16
  if e =~ NUMBERS_AT_END
24
17
  base = e[0...-([$1, $2].join.length)]
25
18
  key = [base, $2]
@@ -31,10 +24,23 @@ module Sequencer
31
24
  end
32
25
 
33
26
  groups.map do | key, filenames |
34
- Sequence.new(of_dir, filenames)
27
+ Sequence.new(assume_directory, filenames)
35
28
  end
36
29
  end
37
30
 
31
+ # Detects sequences in the passed directory (same as Dir.entries but returns Sequence objects).
32
+ # Single files will be upgraded to single-frame Sequences
33
+ def entries(of_dir)
34
+ # Remove all dotfiles and directories
35
+ actual_files = Dir.entries(of_dir).reject do |e|
36
+ e =~ /^\./
37
+ end.reject do | e |
38
+ File.directory?(File.join(of_dir, e))
39
+ end
40
+
41
+ from_enumerable(actual_files, of_dir)
42
+ end
43
+
38
44
  # Detects sequences in the passed directory and all of it's subdirectories
39
45
  # It will skip all the entries starting with a dot
40
46
  # TODO: fix symlink handling
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "sequencer"
8
- s.version = "1.2.0"
8
+ s.version = "1.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Julik Tarkhanov"]
12
- s.date = "2012-08-27"
12
+ s.date = "2014-02-18"
13
13
  s.email = "me@julik.nl"
14
14
  s.executables = ["rseqls", "rseqpad", "rseqrename"]
15
15
  s.extra_rdoc_files = [
@@ -31,11 +31,11 @@ Gem::Specification.new do |s|
31
31
  s.homepage = "http://guerilla-di.org/sequencer"
32
32
  s.licenses = ["MIT"]
33
33
  s.require_paths = ["lib"]
34
- s.rubygems_version = "1.8.24"
34
+ s.rubygems_version = "2.0.3"
35
35
  s.summary = "Image sequence sorting, scanning and manipulation"
36
36
 
37
37
  if s.respond_to? :specification_version then
38
- s.specification_version = 3
38
+ s.specification_version = 4
39
39
 
40
40
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
41
41
  s.add_development_dependency(%q<jeweler>, [">= 0"])
@@ -89,6 +89,18 @@ class Sequencer_entries_should < Test::Unit::TestCase
89
89
  end
90
90
  end
91
91
 
92
+ class Sequencer_from_enum_should < Test::Unit::TestCase
93
+ def setup; emit_test_dirs; end
94
+ def teardown; teardown_test_dirs; end
95
+
96
+ def test_returns_entries_from_enum
97
+ items = Dir.entries(TEST_DIR + '/many_seqs')
98
+ entries = Sequencer.from_enumerable(items)
99
+ names = entries.map{|e| e.to_s }
100
+ assert_equal ["anotherS [228..312].tif", "seq1.[458..512].tif", "single.tif", "subdir"], names
101
+ end
102
+ end
103
+
92
104
  class A_Sequence_created_from_unpadded_files_should < Test::Unit::TestCase
93
105
  def setup; emit_test_dirs; end
94
106
  def teardown; teardown_test_dirs; end
metadata CHANGED
@@ -1,46 +1,41 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequencer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
5
- prerelease:
4
+ version: 1.3.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Julik Tarkhanov
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-08-27 00:00:00.000000000 Z
11
+ date: 2014-02-18 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: jeweler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ! '>='
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: '0'
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ! '>='
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: '0'
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  description:
@@ -67,29 +62,25 @@ files:
67
62
  homepage: http://guerilla-di.org/sequencer
68
63
  licenses:
69
64
  - MIT
65
+ metadata: {}
70
66
  post_install_message:
71
67
  rdoc_options: []
72
68
  require_paths:
73
69
  - lib
74
70
  required_ruby_version: !ruby/object:Gem::Requirement
75
- none: false
76
71
  requirements:
77
- - - ! '>='
72
+ - - '>='
78
73
  - !ruby/object:Gem::Version
79
74
  version: '0'
80
- segments:
81
- - 0
82
- hash: -3510175113673425325
83
75
  required_rubygems_version: !ruby/object:Gem::Requirement
84
- none: false
85
76
  requirements:
86
- - - ! '>='
77
+ - - '>='
87
78
  - !ruby/object:Gem::Version
88
79
  version: '0'
89
80
  requirements: []
90
81
  rubyforge_project:
91
- rubygems_version: 1.8.24
82
+ rubygems_version: 2.0.3
92
83
  signing_key:
93
- specification_version: 3
84
+ specification_version: 4
94
85
  summary: Image sequence sorting, scanning and manipulation
95
86
  test_files: []