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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 720ea1ce81f51967d708b7cff1756ec572337149a9312f38639654db1cb053ed
4
- data.tar.gz: 5e2076ee4cc854a014789b26c1a21a520a1aa83af301de9e0e0677953da2c423
3
+ metadata.gz: 2f7a532c6a985ef7afd93f064e38ff3fb81228d642707fa06156f23b1a2d33c6
4
+ data.tar.gz: 5de639ab3cc6644fb385d35b364f8aa4c6c8afbd989706875a8e6f90193eaa18
5
5
  SHA512:
6
- metadata.gz: fe66533b78b824b96cb75e03632ef5dc94ee4df4bedbb1f717d1fdb0c3a00bcd8b768bdc645d6453fd4b8ba5ff5ea739a38d128c472d9da95fc14f1cd5b104ec
7
- data.tar.gz: 249034641f45d4523ea15ee6c64195fdae53ec0727305bd11fed655463c2a89dbb92510f1c281bdadd3357039777b15255f35da7d08f756ed6d5241d5689acba
6
+ metadata.gz: 7e77feff9b86f7e33c233037e5c5342fac28a7bd3e5b18296cfae915e8a9e39b0d73a4a9dc87ac3ce096869b9bad401c98041bd2cb847a04d4c1b74f98a5b884
7
+ data.tar.gz: 285fe4b48491c6468e7f0a3646d3a9da2b9d55e9386b5f6ee232882bb611311c3122ffa34ac98162e3f847f618c20fae57254c8135d368cc58aeb7d76761dd8e
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,13 +1,18 @@
1
- = 1.7.0 - 1-Jul-2020
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
- = 1.6.0 - 9-May-2020
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
- = 1.5.0 - 8-May-2020
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
- = 1.4.0 - 12-Oct-2019
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
- = 1.3.0 - 9-Apr-2016
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
- = 1.2.1 - 17-Feb-2014
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
- = 1.2.0 - 10-Apr-2012
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
- = 1.1.5 - 17-Jul-2011
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
- = 1.1.4 - 16-Sep-2010
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
- = 1.1.3 - 14-Sep-2010
71
+ ## 1.1.3 - 14-Sep-2010
67
72
  * Fixed potential libc linker failure.
68
73
 
69
- = 1.1.2 - 28-Apr-2010
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
- = 1.1.1 - 24-Oct-2009
79
+ ## 1.1.1 - 24-Oct-2009
75
80
  * Removed the 'use' library as a dependency.
76
81
 
77
- = 1.1.0 - 21-Oct-2009
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
- = 1.0.0 - 12-Apr-2008
88
+ ## 1.0.0 - 12-Apr-2008
84
89
  * Added security via umask().
85
90
  * Version bump to 1.0.0.
86
91
 
87
- = 0.1.2 - 6-Jun-2007
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
- = 0.1.1 - 2-Jun-2007
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
- = 0.1.0 - 1-Jun-2007
100
+ ## 0.1.0 - 1-Jun-2007
96
101
  * Initial release.
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org' do
2
+ gem 'rake'
3
+ gem 'ffi', '~> 1.1'
4
+ group 'test' do
5
+ gem 'rspec', '~> 3.9'
6
+ end
7
+ end
@@ -1,7 +1,7 @@
1
- * CHANGES
1
+ * CHANGES.md
2
2
  * LICENSE
3
- * MANIFEST
4
- * README
3
+ * MANIFEST.md
4
+ * README.md
5
5
  * Rakefile
6
6
  * file-temp.gemspec
7
7
  * certs/djberg96_pub.pem
@@ -1,29 +1,31 @@
1
- == Description
1
+ ## Description
2
2
  The file-temp library is an alternate way to handle tempfile generation.
3
3
 
4
- == Requirements
4
+ ## Requirements
5
5
  * ffi 1.1.0 or later
6
6
 
7
- == Installation
8
- gem install file-temp
7
+ ## Installation
8
+ `gem install file-temp`
9
9
 
10
- == Synopsis
11
- require 'file/temp'
10
+ ## Synopsis
11
+ ```
12
+ require 'file/temp'
12
13
 
13
- fh = File::Temp.new
14
- fh.puts "hello"
15
- fh.close # => Tempfile automatically deleted
14
+ fh = File::Temp.new
15
+ fh.puts "hello"
16
+ fh.close # => Tempfile automatically deleted
16
17
 
17
- fh = File::Temp.new(delete: false)
18
- fh.puts "world"
19
- fh.close # => Tempfile still on your filesystem
18
+ fh = File::Temp.new(delete: false)
19
+ fh.puts "world"
20
+ fh.close # => Tempfile still on your filesystem
21
+ ```
20
22
 
21
- == Motivation
23
+ ## Motivation
22
24
  Unlike the tempfile library that ships with Ruby's standard library, this
23
- library uses your system's native +tmpfile+ or +mkstemp+ functions.
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
- +umask+ for files created with +mkstemp+.
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
- == JRuby
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
- == MS Windows
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 +GetTempFileName+ function on certain versions
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
- == License
52
+ ## License
51
53
  Apache-2.0
52
54
 
53
- == Copyright
55
+ ## Copyright
54
56
  (C) 2007-2020 Daniel J. Berger
55
57
  All Rights Reserved
56
58
 
57
- == Warranty
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
- == Author
64
+ ## Author
63
65
  Daniel J. Berger
64
66
 
65
- == See also
67
+ ## See also
66
68
  tmpfile(), mkstemp(), tmpnam()
@@ -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.0'
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'
@@ -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
@@ -1,6 +1,6 @@
1
1
  class File::Temp < File
2
2
  # The version of the file-temp library
3
- VERSION = '1.7.0'.freeze
3
+ VERSION = '1.7.1'.freeze
4
4
  end
5
5
 
6
6
  if RUBY_PLATFORM == 'java'
@@ -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
 
@@ -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
 
@@ -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.0')
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 "constructor accepts a maximum of three arguments" do
72
+ example "other arguments are treated as file option arguments" do
73
73
  expect{
74
74
  @fh = File::Temp.new(
75
- :delete => true,
76
- :template => 'temp_bar_XXXXX',
77
- :directory => Dir.pwd,
78
- :bogus => 1
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.0
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
- - CHANGES.rdoc
112
- - MANIFEST.rdoc
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