fakefs 2.3.0 → 2.5.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/lib/fakefs/irb.rb +14 -0
- data/lib/fakefs/kernel.rb +4 -4
- data/lib/fakefs/safe.rb +1 -0
- data/lib/fakefs/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4a0f94695c0070ec3847b3177acebdf1160f2064ba02d950d04a31385c43207
|
4
|
+
data.tar.gz: bb0e627c6a32b31b8a1068cae3a5d4542b150d2ed06fecc0719a029889a0815c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 646053f9768a3a408c3d365ee2230f089131477decf9ccdb4e51bcd6c9080e1fb56bada71f2f661a685fa41866de408cab4b9de7c07cf50df3fe21b2dde09a85
|
7
|
+
data.tar.gz: 87d29cda1d981939b941023104f5b7a1ee6f58ea9ca983ca16e379a4471c55ce1aea045a2a6c560b07bd760dc238d14f56b68dd7881a651991a587ca0294e0f8
|
data/lib/fakefs/irb.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'irb'
|
2
|
+
|
3
|
+
# Make the original file system classes available in IRB.
|
4
|
+
::IRB::File = ::File
|
5
|
+
::IRB::FileUtils = ::FileUtils
|
6
|
+
::IRB::Dir = ::Dir
|
7
|
+
::IRB::Pathname = ::Pathname
|
8
|
+
|
9
|
+
# We need to setup IRB early, because the setup process itself requires locale files.
|
10
|
+
# Otherwise we'll get an error from Budler
|
11
|
+
# Bundler::GemspecError: The gemspec for GEM_NAME was missing or broken.
|
12
|
+
# Try running `gem pristine GEM_NAME -v GEM_VERSION` to fix the cached spec.
|
13
|
+
# because file sytem in bundler is stubbed.
|
14
|
+
IRB.setup(binding.source_location[0], argv: [])
|
data/lib/fakefs/kernel.rb
CHANGED
@@ -18,8 +18,8 @@ module FakeFS
|
|
18
18
|
def self.unhijack!
|
19
19
|
captives[:original].each do |name, _prc|
|
20
20
|
::Kernel.send(:remove_method, name.to_sym)
|
21
|
-
::Kernel.send(:define_method, name.to_sym, proc do |*args, &block|
|
22
|
-
::FakeFS::Kernel.captives[:original][name].call(*args, &block)
|
21
|
+
::Kernel.send(:define_method, name.to_sym, proc do |*args, **kwargs, &block|
|
22
|
+
::FakeFS::Kernel.captives[:original][name].call(*args, **kwargs, &block)
|
23
23
|
end)
|
24
24
|
::Kernel.send(:private, name.to_sym)
|
25
25
|
end
|
@@ -32,8 +32,8 @@ module FakeFS
|
|
32
32
|
end
|
33
33
|
|
34
34
|
hijack :open do |*args, &block|
|
35
|
-
|
36
|
-
|
35
|
+
# This is a system command or we're inside IRB internals
|
36
|
+
if args.first.start_with?('|') || self.class.to_s.start_with?("IRB::")
|
37
37
|
::FakeFS::Kernel.captives[:original][:open].call(*args, &block)
|
38
38
|
else
|
39
39
|
name = args.shift
|
data/lib/fakefs/safe.rb
CHANGED
data/lib/fakefs/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fakefs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Wanstrath
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2023-
|
15
|
+
date: 2023-05-23 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bump
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- lib/fakefs/fileutils.rb
|
121
121
|
- lib/fakefs/globber.rb
|
122
122
|
- lib/fakefs/io.rb
|
123
|
+
- lib/fakefs/irb.rb
|
123
124
|
- lib/fakefs/kernel.rb
|
124
125
|
- lib/fakefs/pathname.rb
|
125
126
|
- lib/fakefs/pry.rb
|