---
name: "Test::File::ShareDir::Object::Module"
section: "3pm"
platform: "linux"
package: "libtest-file-sharedir-perl"
version: "1.001002-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Test::File::ShareDir::Object::Module"
---

# Test::File::ShareDir::Object::Module(3pm)

Object Oriented ShareDir creation for modules

## NAME

Test::File::ShareDir::Object::Module - Object Oriented ShareDir creation for modules

## VERSION

version 1.001002

## SYNOPSIS

```
    use Test::File::ShareDir::Object::Module;
    my $dir = Test::File::ShareDir::Object::Module->new(
        root    => "some/path",
        modules => {
            "Hello::Nurse" => "share/HN"
        },
    );
    $dir->install_all_modules;
    $dir->add_to_inc;
```

## METHODS

### "module\_names"

```
    my @names = $instance->module_names();
```

Returns the names of all modules listed in the `"modules"` set.

### "module\_share\_target\_dir"

```
    my $dir = $instance->module_share_target_dir("Module::Name");
```

Returns the path where the `"ShareDir"` will be created for `"Module::Name"`

### "module\_share\_source\_dir"

```
    my $dir = $instance->module_share_source_dir("Module::Name");
```

Returns the path where the `"ShareDir"` will be **COPIED** *FROM* for `"Module::Name"`

### "install\_module"

```
    $instance->install_module("Module::Name");
```

Installs `"Module::Name"`'s `"ShareDir"`

### "install\_all\_modules"

```
    $instance->install_all_modules();
```

Installs all `"module_names"`.

### "add\_to\_inc"

**DEPRECATED:** Use `"register"` instead.

### "register"

```
    $instance->register();
```

Adds the `"Tempdir"` `"ShareDir"` (  `"inc"` ) to the global `@INC`

*Since 1.001000*

### "clear"

```
    $instance->clear();
```

Removes the `"Tempdir"` `"ShareDir"` ( `"inc"` ) from the global `@INC`

*Since 1.001000*

## ATTRIBUTES

### "inc"

A `"Test::File::ShareDir::Object::Inc"` object.

### "modules"

A hash of :

```
    Module::Name => "relative/path"
```

### "root"

The origin all paths's are relative to.

( Defaults to `"cwd"` )

## AUTHOR

Kent Fredric \<kentnl@cpan.org\>

## COPYRIGHT AND LICENSE

This software is copyright (c) 2017 by Kent Fredric \<kentnl@cpan.org\>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
