file_exists 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +8 -1
- data/file_exists.gemspec +1 -1
- data/lib/file_exists/version.rb +1 -1
- data/lib/file_exists.rb +11 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2949fd0efe630e88431768a2564e2321fe55be4eea3fec9915583ebea421c70d
|
4
|
+
data.tar.gz: ee1486540d72b0c21da85cdeb2b7872a7943132315dedca97afc0810d9bb3d83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35474dfe3830387147bbf5d506e0f37b7ef3b5c7791051abf6ced343ddf08d327c3751bf716dcc6fcfb086a8c1ea04eaa842b9af8f4df63833cd56eaeed0f304
|
7
|
+
data.tar.gz: 3d6955d7b4defafd2593e9ebcfeace4602ca300afe09207bbcec969af425579fb1d43cebb06a1ad16343923c18c7fcbdc177512200070934668f4a53749417b0
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# FileExists
|
2
2
|
|
3
|
-
File.exists? and Dir.exists? were deprecated in Ruby 3.2. If you still need these methods
|
3
|
+
File.exists? and Dir.exists? were deprecated a long time ago and removed in Ruby 3.2. If you still need these methods just require this Gem
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
@@ -14,6 +14,13 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
14
14
|
|
15
15
|
## Usage
|
16
16
|
|
17
|
+
The following command needs to go to the top of your first file before any other requires.
|
18
|
+
|
19
|
+
```
|
20
|
+
require 'file_exists'
|
21
|
+
```
|
22
|
+
|
23
|
+
|
17
24
|
```
|
18
25
|
require 'file_exists'
|
19
26
|
File.exists?("Filename.txt")
|
data/file_exists.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = "File.exists? and Dir.exists? for Ruby 3.2+"
|
12
12
|
spec.description = "File.exists? and Dir.exists? were deprecated in Ruby 3.2. If you still need these methods. just require this Gem"
|
13
13
|
spec.homepage = "https://github.com/largo/file_exists"
|
14
|
-
spec.required_ruby_version = ">=
|
14
|
+
spec.required_ruby_version = ">= 2.0.0"
|
15
15
|
|
16
16
|
|
17
17
|
spec.metadata["homepage_uri"] = spec.homepage
|
data/lib/file_exists/version.rb
CHANGED
data/lib/file_exists.rb
CHANGED
@@ -1,14 +1,17 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "file_exists/version"
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
|
5
|
+
# Monkeypatch the File Class with the exists? method
|
6
|
+
unless Dir.respond_to?(:exists?)
|
7
|
+
class << Dir
|
8
|
+
alias_method :exists?, :exist?
|
8
9
|
end
|
9
10
|
end
|
10
11
|
|
11
|
-
# Monkeypatch the
|
12
|
-
File.
|
13
|
-
|
14
|
-
|
12
|
+
# Monkeypatch the Dir Class with the exists? method
|
13
|
+
unless File.respond_to?(:exists?)
|
14
|
+
class << File
|
15
|
+
alias_method :exists?, :exist?
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: file_exists
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andi Idogawa
|
@@ -43,7 +43,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
43
43
|
requirements:
|
44
44
|
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version:
|
46
|
+
version: 2.0.0
|
47
47
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
48
48
|
requirements:
|
49
49
|
- - ">="
|