Skip to content

Commit

Permalink
Autodetect ruby executables
Browse files Browse the repository at this point in the history
  • Loading branch information
mpapis committed Aug 23, 2017
1 parent ed75207 commit 11ad862
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/gem-wrappers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def self.install(executables)
end

# ruby executables
%w{ruby gem erb irb ri rdoc testrb}.each do |executable|
Dir.chdir(RbConfig::CONFIG["bindir"]) { Dir["*"] }.each do |executable|
installer.install(executable)
end
end
Expand Down
2 changes: 1 addition & 1 deletion test/gem-wrappers/fakes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def uninstall(executable)
@executables.delete(executable)
end
def executables
@executables
@executables.uniq
end
def ensure
@ensure = true
Expand Down
6 changes: 3 additions & 3 deletions test/gem-wrappers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
subject.install(%w{rake test})
@fake_envvironment.ensure?.must_equal(true)
@fake_installer.ensure?.must_equal(true)
@fake_installer.executables.must_equal(%w{rake test ruby gem erb irb ri rdoc testrb})
@fake_installer.executables.sort.must_equal(%w{erb gem irb rake rdoc ri ruby test testrb})
end

it "does remove wrapper" do
subject.install(%w{rake})
@fake_installer.executables.must_equal(%w{rake ruby gem erb irb ri rdoc testrb})
@fake_installer.executables.sort.must_equal(%w{erb gem irb rake rdoc ri ruby testrb})
subject.uninstall(%w{rake})
@fake_installer.executables.must_equal(%w{ruby gem erb irb ri rdoc testrb})
@fake_installer.executables.sort.must_equal(%w{erb gem irb rdoc ri ruby testrb})
end
end

Expand Down

0 comments on commit 11ad862

Please sign in to comment.