file-temp 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/{CHANGES.rdoc → CHANGES.md} +22 -17
- data/Gemfile +7 -0
- data/{MANIFEST.rdoc → MANIFEST.md} +3 -3
- data/{README.rdoc → README.md} +25 -23
- data/file-temp.gemspec +2 -4
- data/lib/file/java/temp.rb +2 -2
- data/lib/file/temp.rb +1 -1
- data/lib/file/unix/temp.rb +3 -3
- data/lib/file/windows/temp.rb +3 -3
- data/spec/file_temp_spec.rb +7 -7
- metadata +11 -13
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f7a532c6a985ef7afd93f064e38ff3fb81228d642707fa06156f23b1a2d33c6
|
4
|
+
data.tar.gz: 5de639ab3cc6644fb385d35b364f8aa4c6c8afbd989706875a8e6f90193eaa18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e77feff9b86f7e33c233037e5c5342fac28a7bd3e5b18296cfae915e8a9e39b0d73a4a9dc87ac3ce096869b9bad401c98041bd2cb847a04d4c1b74f98a5b884
|
7
|
+
data.tar.gz: 285fe4b48491c6468e7f0a3646d3a9da2b9d55e9386b5f6ee232882bb611311c3122ffa34ac98162e3f847f618c20fae57254c8135d368cc58aeb7d76761dd8e
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/{CHANGES.rdoc → CHANGES.md}
RENAMED
@@ -1,13 +1,18 @@
|
|
1
|
-
|
1
|
+
## 1.7.1 - 28-Dec-2020
|
2
|
+
* Updated file option kwarg handling so that it's compatible with Ruby 3.x.
|
3
|
+
* Switched from rdoc to markdown format since github isn't rendering rdoc properly.
|
4
|
+
* Fixed up one of the specs.
|
5
|
+
|
6
|
+
## 1.7.0 - 1-Jul-2020
|
2
7
|
* Replaced test-unit with rspec, and updated the tests.
|
3
8
|
* Updated ffi dependency to 1.1.x.
|
4
9
|
* Removed some archiving options from the Rakefile that I wasn't using.
|
5
10
|
|
6
|
-
|
11
|
+
## 1.6.0 - 9-May-2020
|
7
12
|
* Added an +options+ argument that is passed along as options to the the
|
8
13
|
underlying File.new constructor.
|
9
14
|
|
10
|
-
|
15
|
+
## 1.5.0 - 8-May-2020
|
11
16
|
* Switched to keyword arguments.
|
12
17
|
* Added the ability to specify a tmp directory.
|
13
18
|
* Updates to the JRuby version, removed some code that no longer worked, and
|
@@ -15,13 +20,13 @@
|
|
15
20
|
* Added a LICENSE file to the distro as part of the Apache-2.0 requirement.
|
16
21
|
* Added explicit .rdoc extensions to the README, CHANGES and MANIFEST files.
|
17
22
|
|
18
|
-
|
23
|
+
## 1.4.0 - 12-Oct-2019
|
19
24
|
* Changed license to Apache-2.0.
|
20
25
|
* VERSION constant now lives in a single place, and is frozen.
|
21
26
|
* Added metadata to the gemspec.
|
22
27
|
* Updated cert.
|
23
28
|
|
24
|
-
|
29
|
+
## 1.3.0 - 9-Apr-2016
|
25
30
|
* This gem is now signed.
|
26
31
|
* Added a file-temp.rb file for convenience.
|
27
32
|
* The gem tasks in the Rakefile now assume Rubygems 2.x.
|
@@ -31,7 +36,7 @@
|
|
31
36
|
are each in their own directory and have their own versions for ease
|
32
37
|
of maintenance.
|
33
38
|
|
34
|
-
|
39
|
+
## 1.2.1 - 17-Feb-2014
|
35
40
|
* There is now a completely separate implementation for JRuby that uses the
|
36
41
|
Java API instead of C. It uses a GUID to create the temporary file name
|
37
42
|
instead of the 'XXXXXX' template, but is otherwise identical in function.
|
@@ -44,53 +49,53 @@
|
|
44
49
|
* Use tmpnam_s on Windows instead of tmpnam.
|
45
50
|
* Use wide character functions on Windows.
|
46
51
|
|
47
|
-
|
52
|
+
## 1.2.0 - 10-Apr-2012
|
48
53
|
* Removed the old FileTemp alias for File::Temp. It was deprecated and
|
49
54
|
has now been officially removed.
|
50
55
|
* Some refactoring of the custom internal Windows functions.
|
51
56
|
* Nicer error handling if certain FFI functions fail.
|
52
57
|
* Made the FFI functions private.
|
53
58
|
|
54
|
-
|
59
|
+
## 1.1.5 - 17-Jul-2011
|
55
60
|
* Now stores file path information if the file is retained on the filesystem.
|
56
61
|
Thanks go to joerixaop for the patch.
|
57
62
|
* The TMPDIR fallback determination on Windows is no longer hard coded.
|
58
63
|
|
59
|
-
|
64
|
+
## 1.1.4 - 16-Sep-2010
|
60
65
|
* The File::Temp.temp_name method has been altered on Unix systems. It
|
61
66
|
no longer prefixes TMPDIR to the name since it was redundant and could
|
62
67
|
generate a bogus path.
|
63
68
|
* Set the license to Artistic 2.0.
|
64
69
|
* Set the test task as the default Rake task.
|
65
70
|
|
66
|
-
|
71
|
+
## 1.1.3 - 14-Sep-2010
|
67
72
|
* Fixed potential libc linker failure.
|
68
73
|
|
69
|
-
|
74
|
+
## 1.1.2 - 28-Apr-2010
|
70
75
|
* Explicitly link against libc for Unix versions.
|
71
76
|
* Refactored the Rakefile. An old install task was removed and the gem
|
72
77
|
related tasks were placed under the 'gem' namespace.
|
73
78
|
|
74
|
-
|
79
|
+
## 1.1.1 - 24-Oct-2009
|
75
80
|
* Removed the 'use' library as a dependency.
|
76
81
|
|
77
|
-
|
82
|
+
## 1.1.0 - 21-Oct-2009
|
78
83
|
* Now pure Ruby, using FFI.
|
79
84
|
* Fixed RF Bug #26757 - FILE pointer leak. Thanks go to Eric Wong for the spot.
|
80
85
|
* Renamed and refactored the test file slightly.
|
81
86
|
* Updated the gemspec.
|
82
87
|
|
83
|
-
|
88
|
+
## 1.0.0 - 12-Apr-2008
|
84
89
|
* Added security via umask().
|
85
90
|
* Version bump to 1.0.0.
|
86
91
|
|
87
|
-
|
92
|
+
## 0.1.2 - 6-Jun-2007
|
88
93
|
* Gemspec fix (forgot the temp.h file - oops).
|
89
94
|
* Added an extra test.
|
90
95
|
|
91
|
-
|
96
|
+
## 0.1.1 - 2-Jun-2007
|
92
97
|
* Core code and test case now work properly on MS Windows.
|
93
98
|
* Now uses MS VC++ 8 functions when available (tmpfile_s, _sopen_s).
|
94
99
|
|
95
|
-
|
100
|
+
## 0.1.0 - 1-Jun-2007
|
96
101
|
* Initial release.
|
data/Gemfile
ADDED
data/{README.rdoc → README.md}
RENAMED
@@ -1,29 +1,31 @@
|
|
1
|
-
|
1
|
+
## Description
|
2
2
|
The file-temp library is an alternate way to handle tempfile generation.
|
3
3
|
|
4
|
-
|
4
|
+
## Requirements
|
5
5
|
* ffi 1.1.0 or later
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
## Installation
|
8
|
+
`gem install file-temp`
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
## Synopsis
|
11
|
+
```
|
12
|
+
require 'file/temp'
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
fh = File::Temp.new
|
15
|
+
fh.puts "hello"
|
16
|
+
fh.close # => Tempfile automatically deleted
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
fh = File::Temp.new(delete: false)
|
19
|
+
fh.puts "world"
|
20
|
+
fh.close # => Tempfile still on your filesystem
|
21
|
+
```
|
20
22
|
|
21
|
-
|
23
|
+
## Motivation
|
22
24
|
Unlike the tempfile library that ships with Ruby's standard library, this
|
23
|
-
library uses your system's native
|
25
|
+
library uses your system's native `tmpfile` or `mkstemp` functions.
|
24
26
|
|
25
27
|
This library is also more secure because it restricts file permission via
|
26
|
-
|
28
|
+
`umask` for files created with `mkstemp`.
|
27
29
|
|
28
30
|
Finally, this library subclasses the File class. This means you get almost
|
29
31
|
exactly the same interface as the File class. The only difference is the
|
@@ -34,33 +36,33 @@ the tempfile library, but that was a very long time ago, and my assumption
|
|
34
36
|
at this point is that it's no longer true. But, I still prefer this version
|
35
37
|
to the one in the Ruby standard library.
|
36
38
|
|
37
|
-
|
39
|
+
## JRuby
|
38
40
|
The implementation for JRuby uses the Java API, not the C API. The
|
39
41
|
temporary file name generated by Java is different than the C version,
|
40
42
|
since it uses a GUID instead of the 'XXXXXX' template, but the
|
41
43
|
interface is otherwise identical.
|
42
44
|
|
43
|
-
|
45
|
+
## MS Windows
|
44
46
|
You may need to use the mingw build in order to use this library.
|
45
47
|
|
46
|
-
Also, there was a bug with the
|
48
|
+
Also, there was a bug with the `GetTempFileName` function on certain versions
|
47
49
|
of MS Windows that may cause a failure. However, if you'r patched up you
|
48
50
|
should not see it.
|
49
51
|
|
50
|
-
|
52
|
+
## License
|
51
53
|
Apache-2.0
|
52
54
|
|
53
|
-
|
55
|
+
## Copyright
|
54
56
|
(C) 2007-2020 Daniel J. Berger
|
55
57
|
All Rights Reserved
|
56
58
|
|
57
|
-
|
59
|
+
## Warranty
|
58
60
|
This library is provided "as is" and without any express or
|
59
61
|
implied warranties, including, without limitation, the implied
|
60
62
|
warranties of merchantability and fitness for a particular purpose.
|
61
63
|
|
62
|
-
|
64
|
+
## Author
|
63
65
|
Daniel J. Berger
|
64
66
|
|
65
|
-
|
67
|
+
## See also
|
66
68
|
tmpfile(), mkstemp(), tmpnam()
|
data/file-temp.gemspec
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'file-temp'
|
5
|
-
spec.version = '1.7.
|
5
|
+
spec.version = '1.7.1'
|
6
6
|
spec.author = 'Daniel J. Berger'
|
7
7
|
spec.license = 'Apache-2.0'
|
8
8
|
spec.email = 'djberg96@gmail.com'
|
@@ -12,8 +12,6 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.files = Dir['**/*'].delete_if{ |item| item.include?('git') }
|
13
13
|
spec.cert_chain = Dir['certs/*']
|
14
14
|
|
15
|
-
spec.extra_rdoc_files = ['CHANGES.rdoc', 'README.rdoc', 'MANIFEST.rdoc']
|
16
|
-
|
17
15
|
spec.add_dependency('ffi', '~> 1.1')
|
18
16
|
spec.add_development_dependency('rspec', '~> 3.9')
|
19
17
|
spec.add_development_dependency('rake')
|
@@ -21,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
21
19
|
spec.metadata = {
|
22
20
|
'homepage_uri' => 'https://github.com/djberg96/file-temp',
|
23
21
|
'bug_tracker_uri' => 'https://github.com/djberg96/file-temp/issues',
|
24
|
-
'changelog_uri' => 'https://github.com/djberg96/file-temp/blob/master/CHANGES',
|
22
|
+
'changelog_uri' => 'https://github.com/djberg96/file-temp/blob/master/CHANGES.md',
|
25
23
|
'documentation_uri' => 'https://github.com/djberg96/file-temp/wiki',
|
26
24
|
'source_code_uri' => 'https://github.com/djberg96/file-temp',
|
27
25
|
'wiki_uri' => 'https://github.com/djberg96/file-temp/wiki'
|
data/lib/file/java/temp.rb
CHANGED
@@ -31,7 +31,7 @@ class File::Temp < File
|
|
31
31
|
# fh.puts 'hello world'
|
32
32
|
# fh.close
|
33
33
|
#
|
34
|
-
def initialize(delete: true, template: 'rb_file_temp_XXXXXX', directory: TMPDIR, options
|
34
|
+
def initialize(delete: true, template: 'rb_file_temp_XXXXXX', directory: TMPDIR, **options)
|
35
35
|
raise TypeError unless template.is_a?(String)
|
36
36
|
|
37
37
|
# Since Java uses a GUID extension to generate a unique file name
|
@@ -50,7 +50,7 @@ class File::Temp < File
|
|
50
50
|
options[:mode] ||= 'wb+'
|
51
51
|
|
52
52
|
path = @file.getName
|
53
|
-
super(path, options)
|
53
|
+
super(path, **options)
|
54
54
|
|
55
55
|
@path = path unless delete
|
56
56
|
end
|
data/lib/file/temp.rb
CHANGED
data/lib/file/unix/temp.rb
CHANGED
@@ -51,7 +51,7 @@ class File::Temp < File
|
|
51
51
|
# fh.puts 'hello world'
|
52
52
|
# fh.close
|
53
53
|
#
|
54
|
-
def initialize(delete: true, template: 'rb_file_temp_XXXXXX', directory: TMPDIR, options
|
54
|
+
def initialize(delete: true, template: 'rb_file_temp_XXXXXX', directory: TMPDIR, **options)
|
55
55
|
@fptr = nil
|
56
56
|
|
57
57
|
if delete
|
@@ -77,9 +77,9 @@ class File::Temp < File
|
|
77
77
|
options[:mode] ||= 'wb+'
|
78
78
|
|
79
79
|
if delete
|
80
|
-
super(fd, options)
|
80
|
+
super(fd, **options)
|
81
81
|
else
|
82
|
-
super(@path, options)
|
82
|
+
super(@path, **options)
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
data/lib/file/windows/temp.rb
CHANGED
@@ -81,7 +81,7 @@ class File::Temp < File
|
|
81
81
|
# fh.puts 'hello world'
|
82
82
|
# fh.close
|
83
83
|
#
|
84
|
-
def initialize(delete: true, template: 'rb_file_temp_XXXXXX', directory: TMPDIR, options
|
84
|
+
def initialize(delete: true, template: 'rb_file_temp_XXXXXX', directory: TMPDIR, **options)
|
85
85
|
@fptr = nil
|
86
86
|
|
87
87
|
if delete
|
@@ -105,9 +105,9 @@ class File::Temp < File
|
|
105
105
|
options[:mode] ||= 'wb+'
|
106
106
|
|
107
107
|
if delete
|
108
|
-
super(fd, options)
|
108
|
+
super(fd, **options)
|
109
109
|
else
|
110
|
-
super(@path, options)
|
110
|
+
super(@path, **options)
|
111
111
|
end
|
112
112
|
end
|
113
113
|
|
data/spec/file_temp_spec.rb
CHANGED
@@ -22,7 +22,7 @@ RSpec.describe File::Temp do
|
|
22
22
|
|
23
23
|
context "constants" do
|
24
24
|
example "library version is set to expected value" do
|
25
|
-
expect( File::Temp::VERSION).to eq('1.7.
|
25
|
+
expect( File::Temp::VERSION).to eq('1.7.1')
|
26
26
|
expect(File::Temp::VERSION).to be_frozen
|
27
27
|
end
|
28
28
|
|
@@ -69,15 +69,15 @@ RSpec.describe File::Temp do
|
|
69
69
|
expect(Dir["#{@dir}/temp_foo*"].length).to be >= 1
|
70
70
|
end
|
71
71
|
|
72
|
-
example "
|
72
|
+
example "other arguments are treated as file option arguments" do
|
73
73
|
expect{
|
74
74
|
@fh = File::Temp.new(
|
75
|
-
:delete
|
76
|
-
:template
|
77
|
-
:directory
|
78
|
-
:
|
75
|
+
:delete => true,
|
76
|
+
:template => 'temp_bar_XXXXX',
|
77
|
+
:directory => Dir.pwd,
|
78
|
+
:mode => 'xb'
|
79
79
|
)
|
80
|
-
}.to raise_error(ArgumentError)
|
80
|
+
}.to raise_error(ArgumentError, /invalid access mode/)
|
81
81
|
end
|
82
82
|
end
|
83
83
|
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: file-temp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain:
|
11
11
|
- |
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
36
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date:
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: ffi
|
@@ -86,16 +86,15 @@ description: |2
|
|
86
86
|
email: djberg96@gmail.com
|
87
87
|
executables: []
|
88
88
|
extensions: []
|
89
|
-
extra_rdoc_files:
|
90
|
-
- CHANGES.rdoc
|
91
|
-
- README.rdoc
|
92
|
-
- MANIFEST.rdoc
|
89
|
+
extra_rdoc_files: []
|
93
90
|
files:
|
94
91
|
- LICENSE
|
95
92
|
- file-temp.gemspec
|
96
93
|
- spec
|
97
94
|
- spec/file_temp_spec.rb
|
95
|
+
- README.md
|
98
96
|
- Rakefile
|
97
|
+
- MANIFEST.md
|
99
98
|
- certs
|
100
99
|
- certs/djberg96_pub.pem
|
101
100
|
- lib
|
@@ -108,20 +107,19 @@ files:
|
|
108
107
|
- lib/file/unix/temp.rb
|
109
108
|
- lib/file/windows
|
110
109
|
- lib/file/windows/temp.rb
|
111
|
-
-
|
112
|
-
-
|
113
|
-
- README.rdoc
|
110
|
+
- Gemfile
|
111
|
+
- CHANGES.md
|
114
112
|
homepage: http://github.com/djberg96/file-temp
|
115
113
|
licenses:
|
116
114
|
- Apache-2.0
|
117
115
|
metadata:
|
118
116
|
homepage_uri: https://github.com/djberg96/file-temp
|
119
117
|
bug_tracker_uri: https://github.com/djberg96/file-temp/issues
|
120
|
-
changelog_uri: https://github.com/djberg96/file-temp/blob/master/CHANGES
|
118
|
+
changelog_uri: https://github.com/djberg96/file-temp/blob/master/CHANGES.md
|
121
119
|
documentation_uri: https://github.com/djberg96/file-temp/wiki
|
122
120
|
source_code_uri: https://github.com/djberg96/file-temp
|
123
121
|
wiki_uri: https://github.com/djberg96/file-temp/wiki
|
124
|
-
post_install_message:
|
122
|
+
post_install_message:
|
125
123
|
rdoc_options: []
|
126
124
|
require_paths:
|
127
125
|
- lib
|
@@ -137,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
135
|
version: '0'
|
138
136
|
requirements: []
|
139
137
|
rubygems_version: 3.0.3
|
140
|
-
signing_key:
|
138
|
+
signing_key:
|
141
139
|
specification_version: 4
|
142
140
|
summary: An alternative way to generate temp files
|
143
141
|
test_files:
|
metadata.gz.sig
CHANGED
Binary file
|