sys-filesystem 1.3.3 → 1.4.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
  SHA256:
3
- metadata.gz: cb5e1c3d785d6a557963b4d880fd7f769818ad7d11613744ff458edae1f0c55b
4
- data.tar.gz: d6277cbfd44841a48a4d20c7b343401fdaaea8ddaf5ce8832b8ce86b4d953eef
3
+ metadata.gz: ef992a58a28ea604cbcce569c09abaee7212b04dbe7f7d0fd6b69d7ce4d62835
4
+ data.tar.gz: f51965f0faec2fb982893f002c01d4499424d4838d7550cf44ff99c1ca859ea4
5
5
  SHA512:
6
- metadata.gz: 3204a9f665966f705224d564cfca033f8f8265ed21522695f856ac2d86c25c2b995d0d7de1cc37375f0ef235e2a84aeae54eb751c9aa30f97bcb0d53c99cdcf6
7
- data.tar.gz: c67c70c0c39a29515e54e47f3313d41471d5862561751040deb471a49ad81afd8f956b062eca7496f56fc366d16e6f547d47fa313155262dc9bfdf8fcdc43d3f
6
+ metadata.gz: 41001e2db9ba3048671910f0f4ebb264b781ef509d682353a02116434308386ad6c363a6409c311696729a28ea7fafa5edaf042f7f118485f0e31b0f5633c9e2
7
+ data.tar.gz: 53e972089622fae12ad436e6634988d60fab6f271c391fc122d670c53cbc8d91312a4ba659d0e5f3e709bbaaf1969e4a9cb61ca2dd9b7e9152be478d0ae5347c
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,23 +1,43 @@
1
- == 1.3.3 - 18-Feb-2020
1
+ ## 1.4.2 - 22-Jul-2021
2
+ * Fixed support for 32-bit Linux. Thanks go to ciprianbadescu for the spot.
3
+
4
+ ## 1.4.1 - 30-Dec-2020
5
+ * Fix an FFI function declaration bug for Big Sur and later on Mac. Thanks go
6
+ to Roman Gaufman for the spot and Martins Polakovs for testing.
7
+ * Fixed the changelog metadata URI.
8
+ * Added a .gitignore file.
9
+
10
+ ## 1.4.0 - 6-Sep-2020
11
+ * The Sys::Filesystem.stat method now accepts a Pathname and Dir object as
12
+ an argument. On most platforms it will also accept a File object. Thanks
13
+ go to hirura for the patch.
14
+ * Fixed the statvfs struct layout on i686 platforms. Thanks go to
15
+ Filipovici-Andrei for the patch.
16
+ * Switched from test-unit to rspec, and updated the tests.
17
+
18
+ ## 1.3.4 - 17-Mar-2020
19
+ * Properly include a LICENSE file as per the Apache-2.0 license.
20
+
21
+ ## 1.3.3 - 18-Feb-2020
2
22
  * Linux now uses statvfs64 under the hood. This fixes a potential issue with
3
23
  32 bit systems. Thanks go to Tom Smyth for the spot.
4
24
 
5
- == 1.3.2 - 8-Dec-2019
25
+ ## 1.3.2 - 8-Dec-2019
6
26
  * Renamed various text files to include .rdoc extension so that github renders
7
27
  them nicely.
8
28
 
9
- == 1.3.1 - 15-Oct-2019
29
+ ## 1.3.1 - 15-Oct-2019
10
30
  * Fixed a bug where the Statvfs and Statfs structs were not allocated properly
11
31
  on Linux, which could cause issues. Thanks go to Daniele Orlandi for the spot.
12
32
  * Added specs to ensure that the FFI struct size matches the C struct size.
13
33
  This required adding mkmf-lite as a development dependency.
14
34
  * Added a slightly more pessimistic version requirement for test-unit.
15
35
 
16
- == 1.3.0 - 3-Oct-2019
36
+ ## 1.3.0 - 3-Oct-2019
17
37
  * Added the mount and umount singleton methods.
18
38
  * Changed an internal class variable to a frozen constant.
19
39
 
20
- == 1.2.0 - 1-Jan-2019
40
+ ## 1.2.0 - 1-Jan-2019
21
41
  * Changed the license to Apache-2.0.
22
42
  * Added the case_sensitive? and case_insensitive? instance methods to the
23
43
  Filesystem::Stat class.
@@ -25,7 +45,7 @@
25
45
  * Fixed the deprecation warnings when running the tests on Windows.
26
46
  * Added metadata to the gemspec.
27
47
 
28
- == 1.1.9 - 26-Jan-2018
48
+ ## 1.1.9 - 26-Jan-2018
29
49
  * The bytes_free and bytes_total methods were updated to use the fragment size
30
50
  instead of the block size. This fixes Macs using APFS, as well as Solaris 10.
31
51
  Thanks go to Mikhail Vasin for the spot.
@@ -33,39 +53,39 @@
33
53
  to address the issue now resolved by the above change.
34
54
  * Updated the cert again.
35
55
 
36
- == 1.1.8 - 2-Sep-2017
56
+ ## 1.1.8 - 2-Sep-2017
37
57
  * The stat and mount_point methods now call to_s on the string argument
38
58
  explicitly so that Pathname objects will now work with String#wincode.
39
59
  * Updated some tests to avoid Fixnum warnings for Ruby 2.4.
40
60
  * Updated the cert.
41
61
 
42
- == 1.1.7 - 1-Aug-2016
62
+ ## 1.1.7 - 1-Aug-2016
43
63
  * Fixed an issue in the stat method for MS Windows where the blocks_avail
44
64
  value was not correct. Thanks go to Maxime Lapointe for the spot.
45
65
 
46
- == 1.1.6 - 17-May-2016
66
+ ## 1.1.6 - 17-May-2016
47
67
  * On versions that use setmntent or fopen, explicitly raise an error if
48
68
  either of those calls return a null value.
49
69
 
50
- == 1.1.5 - 5-Dec-2015
70
+ ## 1.1.5 - 5-Dec-2015
51
71
  * This gem is now signed.
52
72
  * The gem related tasks in the Rakefile now assume Rubygems 2.x.
53
73
  * Updates to the gemspec, added cert_chain, removed rubyforge_project.
54
74
  * Internal reorganization, and use of relative_require as appropriate.
55
75
  * Added a sys-filesystem.rb file for convenience.
56
76
 
57
- == 1.1.4 - 15-Mar-2015
77
+ ## 1.1.4 - 15-Mar-2015
58
78
  * The File.mounts method no longer raises an error if a mount point
59
79
  is not accessible. Thanks go to Michael Pope for the patch.
60
80
  * Some internal code reorganization.
61
81
 
62
- == 1.1.3 - 1-Oct-2014
82
+ ## 1.1.3 - 1-Oct-2014
63
83
  * Now ignores EPERM errors when trying to find the mount point for a path.
64
84
  Thanks go to petersen for the patch.
65
85
  * The Filesystem.stat method now defaults to using the root path on Windows
66
86
  for volume information.
67
87
 
68
- == 1.1.2 - 9-May-2014
88
+ ## 1.1.2 - 9-May-2014
69
89
  * Added the percent_used, bytes_total, bytes_free and bytes_used methods
70
90
  to the Filesystem::Stat class. Thanks go to xanview for the suggestion.
71
91
  * Changed File.exists? to File.exist? to avoid warnings in Ruby 2.1.x.
@@ -74,30 +94,30 @@
74
94
  * Added the to_tb method for terabytes.
75
95
  * Minor updates to the gem:create and gem:install Rake tasks.
76
96
 
77
- == 1.1.1 - 3-Oct-2013
97
+ ## 1.1.1 - 3-Oct-2013
78
98
  * Solaris now always uses statvfs64 on Solaris for better 64-bit support.
79
99
  Thanks go to Jeff Shantz for the spot.
80
100
 
81
- == 1.1.0 - 19-Jan-2013
101
+ ## 1.1.0 - 19-Jan-2013
82
102
  * Converted the Windows source code to use FFI. Consequently, there is now
83
103
  a single gem rather than separate gems for Windows and Unix.
84
104
  * Revamped the Windows tests.
85
105
 
86
- == 1.0.0 - 11-Jan-2012
106
+ ## 1.0.0 - 11-Jan-2012
87
107
  * Converted everything from C to FFI for the Unix flavors. The Windows
88
108
  source code remains untouched.
89
109
 
90
- == 0.3.4 - 19-Nov-2010
110
+ ## 0.3.4 - 19-Nov-2010
91
111
  * Fixed a bug where negative block counts were happening on very large
92
112
  hard drives. Thanks go to Jonas Pfenniger for the spot.
93
113
  * Refactored the clean task in the Rakefile.
94
114
  * Some cosmetic source code changes.
95
115
 
96
- == 0.3.3 - 21-May-2010
116
+ ## 0.3.3 - 21-May-2010
97
117
  * Added a workaround for the Sys::Filesystem#block_size member to deal with
98
118
  a bug in OS X. Thanks go to Josh Pasqualetto for the spot.
99
119
 
100
- == 0.3.2 - 29-Dec-2009
120
+ ## 0.3.2 - 29-Dec-2009
101
121
  * Source has been moved to github.
102
122
  * Added the 'gem' task and removed build logic from the gemspec.
103
123
  * Updated the install task.
@@ -105,23 +125,23 @@
105
125
  * Removed some junk build files that were inadvertently included in
106
126
  the last gem.
107
127
 
108
- == 0.3.1 - 5-Aug-2009
128
+ ## 0.3.1 - 5-Aug-2009
109
129
  * Now compatible with Ruby 1.9.x.
110
130
  * Changed license to Artistic 2.0
111
131
  * Updated the gemspec, including the explicit addition of a license and
112
132
  test-unit as a development dependency, as well as an updated description.
113
133
 
114
- == 0.3.0 - 26-Feb-2009
134
+ ## 0.3.0 - 26-Feb-2009
115
135
  * Added support for OS X and FreeBSD thanks to an awesome patch by Nobuyoshi
116
136
  Miyokawa.
117
137
  * Added the Filesystem.mount_point method that takes a file and returns
118
138
  the mount point it's sitting on.
119
139
 
120
- == 0.2.0 - 30-Dec-2008
140
+ ## 0.2.0 - 30-Dec-2008
121
141
  * Added the Filesystem.mounts method for iterating over mount or volume
122
142
  information.
123
143
 
124
- == 0.1.1 - 28-Mar-2007
144
+ ## 0.1.1 - 28-Mar-2007
125
145
  * Bug fix for BSD flavors. Thanks go to Jeremy Kemper and Ole Christian
126
146
  Rynning for the spot.
127
147
  * Bug fix for OS X (along the same lines as the BSD fix). Thanks go to
@@ -130,5 +150,5 @@
130
150
  * Tweaks to the gemspec.
131
151
  * Added synopsis to the README.
132
152
 
133
- == 0.1.0 - 17-Nov-2006
153
+ ## 0.1.0 - 17-Nov-2006
134
154
  * Initial release. Alpha. Code is stable, but API is not.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'https://rubygems.org' do
2
+ gemspec
3
+ end
data/LICENSE ADDED
@@ -0,0 +1,177 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
@@ -1,5 +1,7 @@
1
- * MANIFEST.rdoc
2
1
  * CHANGES.rdoc
2
+ * Gemfile
3
+ * LICENSE
4
+ * MANIFEST.rdoc
3
5
  * Rakefile
4
6
  * README.rdoc
5
7
  * sys-fileystem.gemspec
data/README.md ADDED
@@ -0,0 +1,89 @@
1
+ [![Ruby](https://github.com/djberg96/sys-filesystem/actions/workflows/ruby.yml/badge.svg)](https://github.com/djberg96/sys-filesystem/actions/workflows/ruby.yml)
2
+
3
+ ## Description
4
+
5
+ A cross platform Ruby interface for getting file system information.
6
+
7
+ ## Installation
8
+
9
+ `gem install sys-filesystem`
10
+
11
+ ## Synopsis
12
+
13
+ ```ruby
14
+ require 'sys/filesystem'
15
+ include Sys
16
+
17
+ # Display information about a particular filesystem.
18
+ p Filesystem.stat('/')
19
+
20
+ # Sample output
21
+
22
+ #<Sys::Filesystem::Stat:0x517440
23
+ @base_type = "ufs",
24
+ @flags = 4,
25
+ @files_available = 3817457,
26
+ @block_size = 8192,
27
+ @blocks_available = 19957633,
28
+ @blocks = 34349612,
29
+ @name_max = 255,
30
+ @path = "/",
31
+ @filesystem_id = 35651592,
32
+ @files = 4135040,
33
+ @fragment_size = 1024,
34
+ @files_free = 3817457,
35
+ @blocks_free = 20301129
36
+ >
37
+
38
+ # Describe all mount points on the system
39
+ Filesystem.mounts{ |mount| p mount }
40
+
41
+ # Find the mount point of any particular file
42
+ puts Filesystem.mount_point('/home/djberge/some_file.txt') => '/home'
43
+ ```
44
+
45
+ ## Notes
46
+
47
+ This is a pure Ruby implementation that uses FFI. This means it should work
48
+ with JRuby, too.
49
+
50
+ ## Sample code
51
+
52
+ Run 'rake example' if you want to see a basic sample run. The actual code
53
+ is 'example_stat.rb' in the 'examples' directory. Modify it as you see fit.
54
+
55
+ ## Known Bugs
56
+
57
+ None that I'm aware of. Please report bugs on the project page at:
58
+
59
+ https://github.com/djberg96/sys-filesystem
60
+
61
+ ## Future Plans
62
+
63
+ * Add better 64-bit support for Linux and BSD.
64
+ * Other suggestions welcome.
65
+
66
+ ## Acknowledgements
67
+
68
+ * Mike Hall, for ideas and code that I borrowed from his 'filesystem' library.
69
+ * Park Heesob, for implementation and API ideas for the MS Windows version.
70
+ * Nobuyoshi Miyokawa, for adding the original FreeBSD and OS X support.
71
+
72
+ ## License
73
+
74
+ Apache-2.0
75
+
76
+ ## Copyright
77
+
78
+ (C) 2003-2020 Daniel J. Berger
79
+ All Rights Reserved
80
+
81
+ ## Warranty
82
+
83
+ This library is provided "as is" and without any express or
84
+ implied warranties, including, without limitation, the implied
85
+ warranties of merchantability and fitness for a particular purpose.
86
+
87
+ ## Author
88
+
89
+ Daniel J. Berger