On Oct 3, 2014, at 6:54 PM, roro codeath <rorocodeath / gmail.com> wrote:

> for instance, there are two exist files, 'path/to/dir/file' and =
'path/to/dir/file2'
> require 'path/to/dir/**=92

Most probably, no. For security reasons.

>=20
> is eql with
>=20
> require 'path/to/dir/file'
> require 'path/to/dir/file2=92

That is not what it equals. It could equal:

require =91path/to/dir/file=92
require =91path/to/dir/file2=92
require =91path/to/dir/some_thing_nasty=92
require =91path/to/dir/something_you_dont_want=92
require =91path/to/dir/god_knows_what=92
require =91path/to/dir/omg_what_is_this=92
etc.

If *you* know (ruby doesn't) that you want all the files in a given =
directory, you can use Dir, something like:

Dir[=91path/to/dir/*.rb'].each {|file| require file }

But, I think that has the same security issue. A better way is to list =
the exact files you want to require, or if you don=92t want to do that, =
maybe something like:

%w{file file2 file3}.each {|file|
  require =93path/to/dir/#{file}"
}

Regards,
Ammar