LibreCat / Catmandu

Catmandu - a data processing toolkit
https://librecat.org
175 stars 31 forks source link

Feature/library - adding support for library(PKG_NAME,as:NAME) import of fixes,binds,conditions #327

Closed phochste closed 6 years ago

phochste commented 6 years ago

The library method makes it possible to have more freedom for conditional import fixes, binds and conditions in the Catmandu::Fix namespace. E.g.

library("Foo::Bar",as:x) # import all the fixes,binds and imports from the Foo::Bar package 
x::foo_fix()
if x::foo_condition()
  do x::foo_bind()
  end
end

or

library("Foo::Bar") # import all the fixes,binds and imports from the Foo::Bar package 
foo_fix()
if foo_condition()
  do foo_bind()
  end
end

The Foo::Bar package should has a method manifest which returns a list of package names of Fixes, Binds and Conditions that are available for Catmandu.

package Foo::Bar

sub manifest {
   qw( Foo::Bar::foo_fix Foo::Bar::Condition::foo_condition Foo::Bar::Bind::foo_bind )
}
coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.005%) to 94.298% when pulling 56c4e229949879a171b711788bb5e14e4f91f0c1 on feature/library into 13143f06131848bc710a738bfb42980e14030b33 on master.

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.005%) to 94.298% when pulling 56c4e229949879a171b711788bb5e14e4f91f0c1 on feature/library into 13143f06131848bc710a738bfb42980e14030b33 on master.