File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -379,11 +379,9 @@ def IRB.rc_file_generators
379
379
end
380
380
if xdg_config_home = ENV [ "XDG_CONFIG_HOME" ]
381
381
irb_home = File . join ( xdg_config_home , "irb" )
382
- unless File . exist? irb_home
383
- require 'fileutils'
384
- FileUtils . mkdir_p irb_home
382
+ if File . directory? ( irb_home )
383
+ yield proc { |rc | irb_home + "/irb#{ rc } " }
385
384
end
386
- yield proc { |rc | irb_home + "/irb#{ rc } " }
387
385
end
388
386
if home = ENV [ "HOME" ]
389
387
yield proc { |rc | home +"/.irb#{ rc } " }
Original file line number Diff line number Diff line change @@ -36,13 +36,16 @@ def test_setup_with_minimum_argv_does_not_change_dollar0
36
36
def test_rc_file
37
37
tmpdir = @tmpdir
38
38
Dir . chdir ( tmpdir ) do
39
+ ENV [ "XDG_CONFIG_HOME" ] = "#{ tmpdir } /xdg"
39
40
IRB . conf [ :RC_NAME_GENERATOR ] = nil
40
41
assert_equal ( tmpdir +"/.irb#{ IRB ::IRBRC_EXT } " , IRB . rc_file )
41
42
assert_equal ( tmpdir +"/.irb_history" , IRB . rc_file ( "_history" ) )
43
+ assert_file . not_exist? ( tmpdir +"/xdg" )
42
44
IRB . conf [ :RC_NAME_GENERATOR ] = nil
43
45
FileUtils . touch ( tmpdir +"/.irb#{ IRB ::IRBRC_EXT } " )
44
46
assert_equal ( tmpdir +"/.irb#{ IRB ::IRBRC_EXT } " , IRB . rc_file )
45
47
assert_equal ( tmpdir +"/.irb_history" , IRB . rc_file ( "_history" ) )
48
+ assert_file . not_exist? ( tmpdir +"/xdg" )
46
49
end
47
50
end
48
51
You can’t perform that action at this time.
0 commit comments