fakefs 2.3.0 → 2.4.0

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: 0b40516abdee28793eb6152f979b453e79ed3dfd42c205e65f500efca0bded1f
4
- data.tar.gz: 249b21fc04c49b15cf5f81e5a1497bdb957749d78261337490308f2fa1bb756a
3
+ metadata.gz: 1233eb5f53d2726d129d63b73b637d324eccd588bf2b91a03ea9c66ce4eaf315
4
+ data.tar.gz: 86ee22f93f37f84744da31813a43377a95b398337c45d08d2bddbfdab3794df9
5
5
  SHA512:
6
- metadata.gz: 54376515f03734c2058dcc29733830dae79882dc235042a15bf2bfde1d6256f0eb373c85ae2408118c3f32bec00730cb7a2304225149c97a2d3a44cfe8b0a2ee
7
- data.tar.gz: 2e15d1c5e506602d955bbcadc7b890946f133949a65e20327dd5bac5995fa6e69fc296750fd2dd3fe1e5b219e04f69a8f8f2cf9a528f63fe8971192e7c614aa8
6
+ metadata.gz: e1df486ce2856004f54e6ef9216754e008843282d5ad14f95700ce66d3f49185359217855be28cd5a4603e7b3168f2c5aec4bc5618c0f356abb6759193e0a2bf
7
+ data.tar.gz: 6cda052f83b1e7d3ec3e5ffcba0d29851eced5f450c4e60c24f459e8859b109b2ec22f94144e8cc2d24526eb254259c9ba08cf93b54e4d383e087d3275b73ca8
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
@@ -32,8 +32,8 @@ module FakeFS
32
32
  end
33
33
 
34
34
  hijack :open do |*args, &block|
35
- if args.first.start_with? '|'
36
- # This is a system command
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
@@ -1,6 +1,7 @@
1
1
  require 'fileutils'
2
2
  require 'pathname'
3
3
  require 'fakefs/pry'
4
+ require 'fakefs/irb'
4
5
  require 'fakefs/base'
5
6
  require 'fakefs/fake/file'
6
7
  require 'fakefs/fake/dir'
@@ -1,7 +1,7 @@
1
1
  module FakeFS
2
2
  # Version module
3
3
  module Version
4
- VERSION = '2.3.0'.freeze
4
+ VERSION = '2.4.0'.freeze
5
5
 
6
6
  def self.to_s
7
7
  VERSION
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.3.0
4
+ version: 2.4.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-02-12 00:00:00.000000000 Z
15
+ date: 2023-02-13 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