Aion-Fs
view release on metacpan or search on metacpan
```
ÐÑполÑзÑеÑÑÑ Ð² ÑилÑÑÑаÑ
ÑÑнкÑии `find`.
### See also
* [File::Wildcard](https://metacpan.org/pod/File::Wildcard).
* [String::Wildcard::Bash](https://metacpan.org/pod/String::Wildcard::Bash).
* [Text::Glob](https://metacpan.org/pod/Text::Glob) â `glob_to_regex("*.{pm,pl}")`.
## goto_editor ($path, $line)
ÐÑкÑÑÐ²Ð°ÐµÑ Ñайл в ÑедакÑоÑе из .config на Ñказанной ÑÑÑоке. Ðо ÑмолÑÐ°Ð½Ð¸Ñ Ð¸ÑполÑзÑÐµÑ `vscodium %p:%l`.
Файл .config.pm:
```perl
package config;
config_module 'Aion::Fs' => {
EDITOR => 'echo %p:%l > ed.txt',
};
1;
```
```perl
goto_editor "mypath", 10;
cat "ed.txt" # => mypath:10\n
eval { goto_editor "`", 1 }; $@ # ~> `:1 --> 512
```
## from_pkg (;$pkg)
ÐеÑÐµÐ²Ð¾Ð´Ð¸Ñ Ð¿Ð°ÐºÐµÑ Ð² пÑÑÑ Ð¤Ð¡. Ðез паÑамеÑÑа иÑполÑзÑÐµÑ `$_`.
```perl
from_pkg "Aion::Fs" # => Aion/Fs.pm
[map from_pkg, "Aion::Fs", "A::B::C"] # --> ["Aion/Fs.pm", "A/B/C.pm"]
```
i18n/Aion/Fs.ru-en.po view on Meta::CPAN
msgid ""
"* [File::Wildcard](https://metacpan.org/pod/File::Wildcard).\n"
"* [String::Wildcard::Bash](https://metacpan.org/pod/String::Wildcard::Bash).\n"
"* [Text::Glob](https://metacpan.org/pod/Text::Glob) â `glob_to_regex(\"*.{pm,pl}\")`."
msgstr ""
"* [File::Wildcard](https://metacpan.org/pod/File::Wildcard).\n"
"* [String::Wildcard::Bash](https://metacpan.org/pod/String::Wildcard::Bash).\n"
"* [Text::Glob](https://metacpan.org/pod/Text::Glob) â `glob_to_regex(\"*.{pm,pl}\")`."
msgid "ÐÑкÑÑÐ²Ð°ÐµÑ Ñайл в ÑедакÑоÑе из .config на Ñказанной ÑÑÑоке. Ðо ÑмолÑÐ°Ð½Ð¸Ñ Ð¸ÑполÑзÑÐµÑ `vscodium %p:%l`."
msgstr "Opens the file in the editor from .config at the specified line. Defaults to `vscodium %p:%l`."
msgid "Файл .config.pm:"
msgstr ".config.pm file:"
msgid "ÐеÑÐµÐ²Ð¾Ð´Ð¸Ñ Ð¿Ð°ÐºÐµÑ Ð² пÑÑÑ Ð¤Ð¡. Ðез паÑамеÑÑа иÑполÑзÑÐµÑ `$_`."
msgstr "Transfers the packet to the FS path. Without a parameter, uses `$_`."
msgid "ÐеÑÐµÐ²Ð¾Ð´Ð¸Ñ Ð¿ÑÑÑ Ð¸Ð· ФС в пакеÑ. Ðез паÑамеÑÑа иÑполÑзÑÐµÑ `$_`."
msgstr "Translates the path from the FS to the package. Without a parameter, uses `$_`."
lib/Aion/Fs.md view on Meta::CPAN
```
ÐÑполÑзÑеÑÑÑ Ð² ÑилÑÑÑаÑ
ÑÑнкÑии `find`.
### See also
* [File::Wildcard](https://metacpan.org/pod/File::Wildcard).
* [String::Wildcard::Bash](https://metacpan.org/pod/String::Wildcard::Bash).
* [Text::Glob](https://metacpan.org/pod/Text::Glob) â `glob_to_regex("*.{pm,pl}")`.
## goto_editor ($path, $line)
ÐÑкÑÑÐ²Ð°ÐµÑ Ñайл в ÑедакÑоÑе из .config на Ñказанной ÑÑÑоке. Ðо ÑмолÑÐ°Ð½Ð¸Ñ Ð¸ÑполÑзÑÐµÑ `vscodium %p:%l`.
Файл .config.pm:
```perl
package config;
config_module 'Aion::Fs' => {
EDITOR => 'echo %p:%l > ed.txt',
};
1;
```
```perl
goto_editor "mypath", 10;
cat "ed.txt" # => mypath:10\n
eval { goto_editor "`", 1 }; $@ # ~> `:1 --> 512
```
## from_pkg (;$pkg)
ÐеÑÐµÐ²Ð¾Ð´Ð¸Ñ Ð¿Ð°ÐºÐµÑ Ð² пÑÑÑ Ð¤Ð¡. Ðез паÑамеÑÑа иÑполÑзÑÐµÑ `$_`.
```perl
from_pkg "Aion::Fs" # => Aion/Fs.pm
[map from_pkg, "Aion::Fs", "A::B::C"] # --> ["Aion/Fs.pm", "A/B/C.pm"]
```
lib/Aion/Fs.pm view on Meta::CPAN
exists $+{w1}? "(":
exists $+{w2}? ")":
exists $+{comma}? "|":
quotemeta $&
}gxe;
qr/^$wildcard$/ns
}
# ÐÑкÑÑÐ²Ð°ÐµÑ Ñайл на Ñказанной ÑÑÑоке в ÑедакÑоÑе
use config EDITOR => "vscodium %p:%l";
sub goto_editor($$) {
my ($path, $line) = @_;
my $p = EDITOR;
$p =~ s!%p!$path!;
$p =~ s!%l!$line!;
my $status = system $p;
die "$path:$line --> $status" if $status;
return;
}
# Ðз пакеÑа в ÑайловÑй пÑÑÑ
lib/Aion/Fs.pm view on Meta::CPAN
=over
=item * L<File::Wildcard>.
=item * L<String::Wildcard::Bash>.
=item * L<Text::Glob> â C<glob_to_regex("*.{pm,pl}")>.
=back
=head2 goto_editor ($path, $line)
Opens the file in the editor from .config at the specified line. Defaults to C<vscodium %p:%l>.
.config.pm file:
package config;
config_module 'Aion::Fs' => {
EDITOR => 'echo %p:%l > ed.txt',
};
1;
goto_editor "mypath", 10;
cat "ed.txt" # => mypath:10\n
eval { goto_editor "`", 1 }; $@ # ~> `:1 --> 512
=head2 from_pkg (;$pkg)
Transfers the packet to the FS path. Without a parameter, uses C<$_>.
from_pkg "Aion::Fs" # => Aion/Fs.pm
[map from_pkg, "Aion::Fs", "A::B::C"] # --> ["Aion/Fs.pm", "A/B/C.pm"]
=head2 to_pkg (;$path)
t/aion/fs.t view on Meta::CPAN
#
# ÐÑполÑзÑеÑÑÑ Ð² ÑилÑÑÑаÑ
ÑÑнкÑии `find`.
#
# ### See also
#
# * [File::Wildcard](https://metacpan.org/pod/File::Wildcard).
# * [String::Wildcard::Bash](https://metacpan.org/pod/String::Wildcard::Bash).
# * [Text::Glob](https://metacpan.org/pod/Text::Glob) â `glob_to_regex("*.{pm,pl}")`.
#
# ## goto_editor ($path, $line)
#
# ÐÑкÑÑÐ²Ð°ÐµÑ Ñайл в ÑедакÑоÑе из .config на Ñказанной ÑÑÑоке. Ðо ÑмолÑÐ°Ð½Ð¸Ñ Ð¸ÑполÑзÑÐµÑ `vscodium %p:%l`.
#
# Файл .config.pm:
#@> .config.pm
#>> package config;
#>>
#>> config_module 'Aion::Fs' => {
#>> EDITOR => 'echo %p:%l > ed.txt',
#>> };
#>>
#>> 1;
#@< EOF
#
::done_testing; }; subtest 'goto_editor ($path, $line)' => sub {
goto_editor "mypath", 10;
local ($::_g0 = do {cat "ed.txt"}, $::_e0 = "mypath:10\n"); ::ok $::_g0 eq $::_e0, 'cat "ed.txt" # => mypath:10\n' or ::diag ::_string_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
::like scalar do {eval { goto_editor "`", 1 }; $@}, qr{`:1 --> 512}, 'eval { goto_editor "`", 1 }; $@ # ~> `:1 --> 512'; undef $::_g0; undef $::_e0;
#
# ## from_pkg (;$pkg)
#
# ÐеÑÐµÐ²Ð¾Ð´Ð¸Ñ Ð¿Ð°ÐºÐµÑ Ð² пÑÑÑ Ð¤Ð¡. Ðез паÑамеÑÑа иÑполÑзÑÐµÑ `$_`.
#
::done_testing; }; subtest 'from_pkg (;$pkg)' => sub {
local ($::_g0 = do {from_pkg "Aion::Fs"}, $::_e0 = "Aion/Fs.pm"); ::ok $::_g0 eq $::_e0, 'from_pkg "Aion::Fs" # => Aion/Fs.pm' or ::diag ::_string_diff($::_g0, $::_e0); undef $::_g0; undef $::_e0;
local ($::_g0 = do {[map from_pkg, "Aion::Fs", "A::B::C"]}, $::_e0 = do {["Aion/Fs.pm", "A/B/C.pm"]}); ::is_deeply $::_g0, $::_e0, '[map from_pkg, "Aion::Fs", "A::B::C"] # --> ["Aion/Fs.pm", "A/B/C.pm"]' or ::diag ::_struct_diff($::_g0, $::_e0); und...
( run in 2.008 seconds using v1.01-cache-2.11-cpan-98e64b0badf )