Skip to content

Commit

Permalink
Item14237: Renamed Foswiki::Aux namespace to Foswiki::Util
Browse files Browse the repository at this point in the history
Aux is a specfial device name in Windows...
  • Loading branch information
vrurg committed Oct 12, 2017
1 parent 74ad037 commit 2d3c449
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 38 deletions.
8 changes: 4 additions & 4 deletions EmptyExtension/lib/Foswiki/Extension/Empty.pm
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,10 @@ callbackHandler postConfig => sub {
The coderef acts as an extension's method. The method gets reference to the
object which actually initiated this callback; and reference to a hash with
parameters supplied by the object – see =params= key of callback arguments in
=Foswiki::Aux::Callbacks=.
=Foswiki::Util::Callbacks=.
%X% *NOTE:* The method arguments are different from common callback handler as
described in =%PERLDOC{Foswiki::Aux::Callbacks}%= because there is no point of
described in =%PERLDOC{Foswiki::Util::Callbacks}%= because there is no point of
passing the =data= key of arguments hash. Instead extension callback method can
rely on object's internals whenever needed.
=cut
Expand Down Expand Up @@ -256,7 +256,7 @@ correspondingly.
To allow support for this feature by a core class it must add =extensible=
parameter to =use Foswiki::Class=. This will implicitly apply
=Foswiki::Aux::_ExtensibleRole= role to the class and export =pluggable=
=Foswiki::Util::_ExtensibleRole= role to the class and export =pluggable=
subroutine to declare pluggable methods:
<verbatim>
Expand All @@ -281,7 +281,7 @@ Method overriding can only work within properly initialized %WIKITOOLNAME%
application environment. I.e. it requires initialized extensions on application
object. On the other hand not only classes with =%PERLDOC{Foswiki::AppObject}%=
role applied can use this feature. This is because
=Foswiki::Aux::_ExtensibleRole= implicitly adds =__appObj= attribute to the
=Foswiki::Util::_ExtensibleRole= implicitly adds =__appObj= attribute to the
class it is applied to. In distinction to =%PERLDOC{"Foswiki::AppObject"
attr="app"}%= attribute =__appObj= is not required and can remain undefined.
Expand Down
6 changes: 3 additions & 3 deletions UnitTestContrib/lib/Unit/FoswikiTestRole.pm
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ sub sentMail {
---++ ObjectMethod saveState
Preserves current state of test object. This method is utilizing
=Foswiki::Aux::Localize= facilities.
=Foswiki::Util::Localize= facilities.
=cut

Expand All @@ -282,7 +282,7 @@ sub saveState {
---++ ObjectMethod restoreState
Restores last saved by =saveState= method object state. In addition to
functionality provided by =Foswiki::Aux::Localize= this method also restore the
functionality provided by =Foswiki::Util::Localize= this method also restore the
application and config globals =$Foswiki::app= and =%Foswiki::cfg=,
correspondingly.
Expand Down Expand Up @@ -582,7 +582,7 @@ sub _fixupAppObjects {

my $app = $this->app;

# SMELL FIXME Doesn't deal with Foswiki::Aux::_ExtensibleRole.
# SMELL FIXME Doesn't deal with Foswiki::Util::_ExtensibleRole.
foreach my $attr ( keys %$this ) {
if (
blessed( $this->{$attr} )
Expand Down
4 changes: 2 additions & 2 deletions UnitTestContrib/lib/Unit/PlackTestCase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ require Unit::TestRunner;

use Foswiki::Class;
extends qw(Unit::TestCase);
with qw(Foswiki::Aux::Localize Unit::FoswikiTestRole);
with qw(Foswiki::Util::Localize Unit::FoswikiTestRole);

=begin TML
Expand Down Expand Up @@ -761,7 +761,7 @@ sub setLocalizableAttributes {
---++ See Also
=Foswiki::Aux::Localize=, =Unit::FoswikiTestRole=, =Plack::Test=,
=Foswiki::Util::Localize=, =Unit::FoswikiTestRole=, =Plack::Test=,
=[[CPAN:HTTP::Request::Common][HTTP::Request::Common]]=.
Expand Down
2 changes: 1 addition & 1 deletion UnitTestContrib/lib/Unit/TestApp.pm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extends qw(Foswiki::App);
---++ Callbacks
This class defines the following callbacks (see =Foswiki::Aux::Callbacks=):
This class defines the following callbacks (see =Foswiki::Util::Callbacks=):
| *name* | *Description* |
| =testPreHandleRequest= | Executed before control is passed over to =Foswiki::App= =handleRequest()= method. |
Expand Down
2 changes: 1 addition & 1 deletion UnitTestContrib/test/unit/ExtensionsTests.pm
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ EXT3

my $testObj = $this->create('Foswiki::ExtensionsTests::SampleClass');

$this->assert( $testObj->DOES('Foswiki::Aux::_ExtensibleRole'),
$this->assert( $testObj->DOES('Foswiki::Util::_ExtensibleRole'),
"Test object of class "
. ref($testObj)
. " doesn't have extensible role!" );
Expand Down
2 changes: 1 addition & 1 deletion UnitTestContrib/test/unit/FoswikiTestCase.pm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ our $didOnlyOnceChecks = 0;

use Foswiki::Class;
extends qw(Unit::TestCase);
with qw(Foswiki::Aux::Localize Unit::FoswikiTestRole);
with qw(Foswiki::Util::Localize Unit::FoswikiTestRole);

#has twiki =>
# ( is => 'rw', clearer => 1, lazy => 1, default => sub { $_[0]->app }, );
Expand Down
14 changes: 7 additions & 7 deletions core/lib/Foswiki/Class.pm
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ See =Foswiki::AppObject= role which is applied to class with this modifier.
A class with this modifier wants to get callbacks support. This is done by:
1. applying =Foswiki::Aux::Callbacks= role
1. applying =Foswiki::Util::Callbacks= role
1. exporting =callback_names= public method.
a subroutine =callback_names= is exported into a class' namespace and
=Foswiki::Aux::Callbacks= role gets applied. =callback_names= accepts a list
=Foswiki::Util::Callbacks= role gets applied. =callback_names= accepts a list
and registers names from the list as callbacks supported by the class.
For example:
Expand All @@ -120,7 +120,7 @@ sub someMethod {
Here we get two callbacks registered: =Foswiki::SomeClass::callback1= and
=Foswiki::SomeClass::callback2=.
See =Foswiki::Aux::Callbacks=.
See =Foswiki::Util::Callbacks=.
---+++ extension
Expand Down Expand Up @@ -534,14 +534,14 @@ sub _handler_stubMethods (@) {

sub _handler_callback_names {
my $target = caller;
Foswiki::Aux::Callbacks::registerCallbackNames( $target, @_ );
Foswiki::Util::Callbacks::registerCallbackNames( $target, @_ );
}

sub _install_callbacks {
my ( $class, $target ) = @_;

Foswiki::load_package('Foswiki::Aux::Callbacks');
_assign_role( $target, 'Foswiki::Aux::Callbacks' );
Foswiki::load_package('Foswiki::Util::Callbacks');
_assign_role( $target, 'Foswiki::Util::Callbacks' );
_inject_code( $target, "callback_names", *_handler_callback_names );
}

Expand Down Expand Up @@ -641,7 +641,7 @@ sub _install_extensible {

#say STDERR "--- INSTALLING extensible ON $target";

_assign_role( $target, 'Foswiki::Aux::_ExtensibleRole' );
_assign_role( $target, 'Foswiki::Util::_ExtensibleRole' );
_inject_code( $target, 'pluggable', \&_handler_pluggable );
}

Expand Down
4 changes: 2 additions & 2 deletions core/lib/Foswiki/Config.pm
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ package Foswiki::Exception::_expandStr::UndefVal {

use Foswiki::Class qw(app extensible);
extends qw(Foswiki::Object);
with qw(Foswiki::Aux::Localize);
with qw(Foswiki::Util::Localize);

# Enable to trace auto-configuration (Bootstrap)
use constant TRAUTO => 1;
Expand Down Expand Up @@ -622,7 +622,7 @@ sub _workOutOS {
This method preserves current =data= attribute on =_dataStack= and sets =data=
to the values provided in =%init=.
See also: =Foswiki::Aux::Localize=
See also: =Foswiki::Util::Localize=
=cut

Expand Down
2 changes: 1 addition & 1 deletion core/lib/Foswiki/Config/Spec/File.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use constant CACHE_SUBDIR => '.specCache';

use Foswiki::Class qw(app extensible);
extends qw(Foswiki::File);
with qw(Foswiki::Config::CfgObject Foswiki::Aux::Localize);
with qw(Foswiki::Config::CfgObject Foswiki::Util::Localize);

# Spec file format:
# - 'legacy' for classical pre-3.0 format
Expand Down
6 changes: 3 additions & 3 deletions core/lib/Foswiki/FeatureSet.pm
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ namespace to which the following features will belong. For example:
<verbatim>
features_provided
FEATURE1 => [ undef, undef, undef, ],
-namespace => 'Aux::NS',
-namespace => 'Auxiliary::NS',
FEATURE2 => [ undef, undef, undef, ],
FEATURE1 => [ undef, undef, undef, ],
;
</verbatim>
In this code the first =FEATURE1= would belong to the default namespace
while =FEATURE2= and second =FEATURE1= will go into =Aux::NS=. Note also
while =FEATURE2= and second =FEATURE1= will go into =Auxiliary::NS=. Note also
that without the =-namespace= option this call would generate a fatal
exception because of the duplicating features.
Expand All @@ -208,7 +208,7 @@ above could be rewritten in the following way:
<verbatim>
features_provided
-namespace => 'Aux::NS',
-namespace => 'Auxiliary::NS',
FEATURE2 => [ undef, undef, undef, ],
FEATURE1 => [ undef, undef, undef, ],
-namespace => '',
Expand Down
2 changes: 1 addition & 1 deletion core/lib/Foswiki/IncludeHandlers/doc.pm
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ sub INCLUDE {
);
my %classAttributes2Roles = (
app => 'Foswiki::AppObject',
callbacks => 'Foswiki::Aux::Callbacks',
callbacks => 'Foswiki::Util::Callbacks',
);

if (USE_LEXICAL_PARSER) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

=begin TML
---+!! Role Foswiki::Aux::Callbacks
---+!! Role Foswiki::Util::Callbacks
Support of callbacks for classes which may need them.
Expand Down Expand Up @@ -117,7 +117,7 @@ sub cbHandler {
=cut

package Foswiki::Aux::Callbacks;
package Foswiki::Util::Callbacks;
use v5.14;

use Assert;
Expand Down Expand Up @@ -183,7 +183,7 @@ sub _getApp {
$this->isa('Foswiki::App') ? $this
: (
$this->does('Foswiki::AppObject') ? $this->app
: ( $this->does('Foswiki::Aux::_ExtensibleRole')
: ( $this->does('Foswiki::Util::_ExtensibleRole')
&& $this->_has__appObj ? $this->__appObj : $Foswiki::app )
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

=begin TML
---++ Class Foswiki::Aux::Holder
---++ Class Foswiki::Util::Holder
Auxiliary class.
=cut

package Foswiki::Aux::Holder;
package Foswiki::Util::Holder;
use v5.14;

require Foswiki::Object;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

=begin TML
---++ Role Foswiki::Aux::Localize
---++ Role Foswiki::Util::Localize
This role determines classes which are able to simulate =local= Perl operator
using OO approach. They do it by providing two methods: =localize()= and
=restore()=. The first one cleans up object to some desired state. For example –
by cleaning up all attributes and by settings some of them to user-provided
values. An instance of =Foswiki::Aux::Holder= class is been created then and stores
values. An instance of =Foswiki::Util::Holder= class is been created then and stores
a refernce to the object being localized. The holder is supposed to be stored in
a =my= variable within same scope for where we would like the =local= operator
to be active. When we leaving the scope the holder object destroyer method calls
Expand Down Expand Up @@ -40,10 +40,10 @@ class.
=cut

package Foswiki::Aux::Localize;
package Foswiki::Util::Localize;
use v5.14;

use Foswiki::Aux::Holder ();
use Foswiki::Util::Holder ();

use Moo::Role;

Expand Down Expand Up @@ -122,7 +122,7 @@ This method pushes on =_dataStack= all attributes defined by
=_localizableAttributes=. New attribute values are set using =%newAttributes=
hash.
Returns a newly created =Foswiki::Aux::Holder= instance.
Returns a newly created =Foswiki::Util::Holder= instance.
If a class with this role wants to implement its own localization method then it
must not inherit this method but =doLocalize()=.
Expand Down Expand Up @@ -153,7 +153,7 @@ sub localize {
$this->_clear_localizeState;
};

return Foswiki::Aux::Holder->new( object => $this );
return Foswiki::Util::Holder->new( object => $this );
}

sub doLocalize {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# See bottom of file for license and copyright information

package Foswiki::Aux::_ExtensibleRole;
package Foswiki::Util::_ExtensibleRole;
use v5.14;

use Moo::Role;
Expand Down

0 comments on commit 2d3c449

Please sign in to comment.