opt
/
alt
/
ruby26
/
lib64
/
ruby
/
2.6.0
/
rubygems
/
commands
/
Go to Home Directory
+
Upload
Create File
root@0UT1S:~$
Execute
By Order of Mr.0UT1S
[DIR] ..
N/A
build_command.rb
2.03 KB
Rename
Delete
cert_command.rb
9.02 KB
Rename
Delete
check_command.rb
2.23 KB
Rename
Delete
cleanup_command.rb
4.48 KB
Rename
Delete
contents_command.rb
4.07 KB
Rename
Delete
dependency_command.rb
5.14 KB
Rename
Delete
environment_command.rb
5.16 KB
Rename
Delete
fetch_command.rb
1.77 KB
Rename
Delete
generate_index_command.rb
2.55 KB
Rename
Delete
help_command.rb
10.14 KB
Rename
Delete
info_command.rb
713 bytes
Rename
Delete
install_command.rb
8.40 KB
Rename
Delete
list_command.rb
939 bytes
Rename
Delete
lock_command.rb
2.69 KB
Rename
Delete
mirror_command.rb
624 bytes
Rename
Delete
open_command.rb
1.96 KB
Rename
Delete
outdated_command.rb
852 bytes
Rename
Delete
owner_command.rb
2.82 KB
Rename
Delete
pristine_command.rb
5.39 KB
Rename
Delete
push_command.rb
3.53 KB
Rename
Delete
query_command.rb
9.28 KB
Rename
Delete
rdoc_command.rb
2.47 KB
Rename
Delete
search_command.rb
884 bytes
Rename
Delete
server_command.rb
2.38 KB
Rename
Delete
setup_command.rb
17.81 KB
Rename
Delete
signin_command.rb
890 bytes
Rename
Delete
signout_command.rb
896 bytes
Rename
Delete
sources_command.rb
5.18 KB
Rename
Delete
specification_command.rb
3.27 KB
Rename
Delete
stale_command.rb
962 bytes
Rename
Delete
uninstall_command.rb
5.41 KB
Rename
Delete
unpack_command.rb
5.07 KB
Rename
Delete
update_command.rb
6.99 KB
Rename
Delete
which_command.rb
2.15 KB
Rename
Delete
yank_command.rb
2.29 KB
Rename
Delete
# frozen_string_literal: true require 'rubygems/command' class Gem::Commands::WhichCommand < Gem::Command def initialize super 'which', 'Find the location of a library file you can require', :search_gems_first => false, :show_all => false add_option '-a', '--[no-]all', 'show all matching files' do |show_all, options| options[:show_all] = show_all end add_option '-g', '--[no-]gems-first', 'search gems before non-gems' do |gems_first, options| options[:search_gems_first] = gems_first end end def arguments # :nodoc: "FILE name of file to find" end def defaults_str # :nodoc: "--no-gems-first --no-all" end def description # :nodoc: <<-EOF The which command is like the shell which command and shows you where the file you wish to require lives. You can use the which command to help determine why you are requiring a version you did not expect or to look at the content of a file you are requiring to see why it does not behave as you expect. EOF end def execute found = true options[:args].each do |arg| arg = arg.sub(/#{Regexp.union(*Gem.suffixes)}$/, '') dirs = $LOAD_PATH spec = Gem::Specification.find_by_path arg if spec if options[:search_gems_first] dirs = spec.full_require_paths + $LOAD_PATH else dirs = $LOAD_PATH + spec.full_require_paths end end # TODO: this is totally redundant and stupid paths = find_paths arg, dirs if paths.empty? alert_error "Can't find Ruby library file or shared library #{arg}" found &&= false else say paths end end terminate_interaction 1 unless found end def find_paths(package_name, dirs) result = [] dirs.each do |dir| Gem.suffixes.each do |ext| full_path = File.join dir, "#{package_name}#{ext}" if File.exist? full_path and not File.directory? full_path result << full_path return result unless options[:show_all] end end end result end def usage # :nodoc: "#{program_name} FILE [FILE ...]" end end
Save