BSD Ports

devel/ruby-anonymous_loader 0.1.3 NetBSD

Load Ruby source files inside anonymous namespaces

System
NetBSD
Repository
pkgsrc
Maintainer
[email protected]
Port added
Last update
Commit
6e007bd5de
License
mit
Categories
devel, ruby
Package size
66.0 KiB, 207.3 KiB installed

Description

AnonymousLoader

AnonymousLoader evaluates Ruby source files inside fresh anonymous modules. It is useful when a tool needs to inspect or reuse code that declares constants whose top-level names may collide with the host process.

The loaded source keeps its normal constant nesting, but that nesting starts inside the returned anonymous namespace. For example, source that declares Auth::Sanitizer becomes namespace::Auth::Sanitizer, and does not create Object::Auth.

AnonymousLoader can load explicitly named files, or resolve a file using RubyGems metadata with a $LOAD_PATH fallback. The fallback is intended for Bundler standalone and similar environments where code is loadable but a gem is not visible through Gem.loaded_specs or the normal RubyGems index.

Install

Binary package:

pkgin install ruby33-anonymous_loader

From pkgsrc:

cd /usr/pkgsrc/devel/ruby-anonymous_loader && make install clean

Dependencies

Run dependencies 2
Required by 1

Configuration

No options to configure.

Service scripts
none
Flavors
ruby34-anonymous_loader-0.1.3, ruby40-anonymous_loader-0.1.3

Commit history 1

DateCommitCreditsLog message
6e007bd5de taca devel/anonymous_loader: add version 0.1.3
This package is required by ruby-oauth-tty 1.0.13. AnonymousLoader AnonymousLoader evaluates Ruby source files inside fresh anonymous modules. It is useful when a tool needs to inspect or reuse code that declares constants whose top-level names may collide with the host process. The loaded source keeps its normal constant nesting, but that nesting starts inside the returned anonymous namespace. For example, source that declares Auth::Sanitizer becomes namespace::Auth::Sanitizer, and does not create Object::Auth. AnonymousLoader can load explicitly named files, or resolve a file using RubyGems metadata with a $LOAD_PATH fallback. The fallback is intended for Bundler standalone and similar environments where code is loadable but a gem …