fasttrack 0.1 → 0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4dc5f004ecff917644512a6ed9c218ab813f301c
4
- data.tar.gz: 20705b32a6e116f5582f18f03c5f8335c2939b16
3
+ metadata.gz: 92afd46fce7b9bfab35852ec7f2913ce2ae49b9f
4
+ data.tar.gz: 6db8750a2a8512f6f9de77cfb9b23dd34fa644f1
5
5
  SHA512:
6
- metadata.gz: 948a92e633033f52356023a57b7c711e7a29d1bc466197265624be23ba51448ebf1474eca92a6711ac5b9505efbce22a1b6f6014189943d8a57864ed4f3e2aad
7
- data.tar.gz: 64f802661ea14141431cad5a4020111f8f888336cd0c86547a7f6e7707e84608dd0543375ee39ab327d6024f0d1235bdae963dc7bc3b6021565b770b725b0d1d
6
+ metadata.gz: cc315ff8e11ac8f1910f9647c5cfc3bc8583127ff0c4b70fd2fa1367ce52c3d0a07ebab6335943b791b60adf88616f0ed776e38992c0213f5b64c7ec450168e0
7
+ data.tar.gz: f3fd4f57a8cbb969d10b47959e234665c70c643de2674af3e4c8971a3464959168844f31cf710bc26cb480006b0229c99b547f61668bcb32699e6d5b9c82350d
@@ -20,9 +20,10 @@ Gem::Specification.new do |gem|
20
20
  gem.require_paths = ["lib"]
21
21
  gem.version = Fasttrack::VERSION
22
22
 
23
- gem.add_dependency 'exempi', '>= 0.1'
23
+ gem.add_dependency 'exempi', '>= 0.2'
24
24
 
25
25
  gem.add_development_dependency 'rake', '>= 0.9.2.2'
26
26
  gem.add_development_dependency 'mocha', '>= 0.13.0'
27
+ gem.add_development_dependency 'minitest'
27
28
  gem.add_development_dependency 'nokogiri', '>= 1.5.5'
28
29
  end
@@ -49,6 +49,7 @@ module Fasttrack
49
49
  # @raise [Fasttrack::FileFormatError] if the file can't have XMP
50
50
  # metadata
51
51
  def initialize path, mode="r"
52
+ @open = false
52
53
  @path = Pathname.new(path).expand_path
53
54
  if not @path.exist?
54
55
  raise Errno::ENOENT, "#{@path} does not exist"
@@ -155,6 +156,7 @@ module Fasttrack
155
156
  @open = Exempi.xmp_files_open @file_ptr, @path.to_s, open_option
156
157
 
157
158
  if not @open
159
+ Exempi.xmp_files_free(@file_ptr)
158
160
  Fasttrack.handle_exempi_failure
159
161
  else
160
162
  @xmp = Fasttrack::XMP.from_file_pointer @file_ptr
@@ -162,6 +164,5 @@ module Fasttrack
162
164
 
163
165
  @open
164
166
  end
165
-
166
167
  end
167
- end
168
+ end
@@ -1,3 +1,3 @@
1
1
  module Fasttrack
2
- VERSION = "0.1"
2
+ VERSION = "0.2"
3
3
  end
File without changes
@@ -0,0 +1,21 @@
1
+ require 'fasttrack'
2
+ require 'open3'
3
+
4
+ describe Fasttrack::File do
5
+ before do
6
+ @test_file = File.join(__FILE__,'..','data','test.rtf')
7
+ end
8
+
9
+ it 'should not leak filehandles' do
10
+ exempi_mock = MiniTest::Mock.new
11
+ exempi_mock.expect(:xmp_files_open, false, [])
12
+ exempi_mock.expect(:xmp_files_free, true, [])
13
+ Exempi.stub(:xmp_files_open, false) { exempi_mock.xmp_files_open }
14
+ Exempi.stub(:xmp_files_free, true) { exempi_mock.xmp_files_free }
15
+
16
+ assert_raises Exempi::ExempiError do
17
+ Fasttrack::File.new(@test_file)
18
+ end
19
+ exempi_mock.verify
20
+ end
21
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fasttrack
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.1'
4
+ version: '0.2'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Misty De Meo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-03 00:00:00.000000000 Z
11
+ date: 2016-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: exempi
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.1'
19
+ version: '0.2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0.1'
26
+ version: '0.2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.13.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: minitest
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
55
69
  - !ruby/object:Gem::Dependency
56
70
  name: nokogiri
57
71
  requirement: !ruby/object:Gem::Requirement
@@ -91,8 +105,10 @@ files:
91
105
  - lib/fasttrack/xmp.rb
92
106
  - test/data/avchd.xmp
93
107
  - test/data/image.jpg
108
+ - test/data/test.rtf
94
109
  - test/fasttrack_test.rb
95
110
  - test/file_test.rb
111
+ - test/filehandle_leak_test.rb
96
112
  - test/xmp_test.rb
97
113
  homepage: https://github.com/mistydemeo/fasttrack
98
114
  licenses: []
@@ -113,14 +129,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
129
  version: '0'
114
130
  requirements: []
115
131
  rubyforge_project:
116
- rubygems_version: 2.4.5.1
132
+ rubygems_version: 2.5.2
117
133
  signing_key:
118
134
  specification_version: 4
119
135
  summary: Ruby sugar for Exempi
120
136
  test_files:
121
137
  - test/data/avchd.xmp
122
138
  - test/data/image.jpg
139
+ - test/data/test.rtf
123
140
  - test/fasttrack_test.rb
124
141
  - test/file_test.rb
142
+ - test/filehandle_leak_test.rb
125
143
  - test/xmp_test.rb
126
- has_rdoc: