Carrot

 view release on metacpan or  search on metacpan

Documentation/Changes.txt  view on Meta::CPAN

1.1.309 17th August 2014
	- re-packed 1.1.308 with bsdtar, because it's compatible with Archive::Tar.

1.1.308 16th August 2014
	- installs like a standard Perl module
	- writable overlay enables straightforward use by non-developers

1.1.307 23th July 2014
	- fixed cosmetic issues

1.1.306 22th July 2014
	- test of new release workflow

0.0.0	30th October 2012
	- empty release to reserve the name before writing the documentation

lib/Carrot/Individuality/Controlled/Customized_Settings/Monad.pm  view on Meta::CPAN

			my $distinguished_exceptions = '::Distinguished_Exceptions');

	$class_names->provide(
		my $cursor_class = '::Personality::Reflective::Iterate::Array::Cursor',
		'[=project_pkg=]::',
			my $line_class = '::Dot_Cfg::Line',
			my $source_class = '::Source::Here::Plain',
			my $dot_cdf_class = '::Dot_Cdf');

	$class_names->provide_instance(
		my $writable_overlay = '::Meta::Greenhouse::Writable_Overlay',
		my $compilation_name = '::Meta::Greenhouse::Compilation_Name');

	$distinguished_exceptions->provide(
		my $unsupported_data_type = 'unsupported_data_type',
		my $hash_element_missing = 'hash_element_missing');

	Carrot::Meta::Greenhouse::Package_Loader::provide_instance(
		my $loader = '::Modularity::Package::Loader');

# =--------------------------------------------------------------------------= #

lib/Carrot/Individuality/Controlled/Customized_Settings/Monad.pm  view on Meta::CPAN

{
	my ($this, $meta_monad) = @ARGUMENTS;

	my $package_file = $meta_monad->package_file;
	my $dot_directory = $package_file->dot_directory;
	my $default_settings = $dot_directory->entry('default_settings.cdf');
	$default_settings->consider_regular_content;

	my $compiled_settings = $dot_directory->entry(
		"default_settings-$$compilation_name.pl");
	$writable_overlay->redirect_read($compiled_settings);
	if ($default_settings->modification_timestamp_is_newer($compiled_settings))
	{
	# NOTE: manually setting @ARGUMENTS copies but doesn't alias them
		@ARGUMENTS = ($loader, \$this->[ATR_VALUES]);
		require($compiled_settings->value);
		$this->[ATR_ARE_MODIFIED] = IS_FALSE;
		return;
	}
	$this->[ATR_ARE_MODIFIED] = IS_TRUE;

lib/Carrot/Individuality/Controlled/Customized_Settings/Monad.pm  view on Meta::CPAN

			"# Automatically created on $datetime GMT.\n"
			."# Manual changes will get lost.\n"
			."# package $pkg_name\n"
#			"use strict;\n"
#			. "use warnings;\n"
			. join("\n", map("\$_[0]->load('$_');", @$pkg_names))
			. "\n\${\$_[1]} = my "
			. $dumped
			. "\nreturn(1);";

		$writable_overlay->redirect_write($compiled_settings);
		$compiled_settings->consider_regular_content;
		$compiled_settings->overwrite_from($perl_code);
	}
	return;
}

sub are_modified
# /type method
# /effect ""
# //parameters

lib/Carrot/Meta/Greenhouse/Writable_Overlay.pm  view on Meta::CPAN


	require Carrot::Meta::Greenhouse::Compilation_Name;
	my $compilation_name = Carrot::Meta::Greenhouse::Compilation_Name->constructor;

	require Carrot::Meta::Greenhouse::Fatal_Syscalls;
	my $fatal_syscalls = Carrot::Meta::Greenhouse::Fatal_Syscalls->constructor;

	require Carrot::Meta::Greenhouse::Translated_Errors;
	my $translated_errors = Carrot::Meta::Greenhouse::Translated_Errors->constructor;

	my $cache = "$ENV{'HOME'}/.carrot/writable_overlay/$$compilation_name";
	my $cache_fnl = length($cache);
	my $index_file = "$cache.idx";
	my $index = {};
	my $xedni = {};
	my $highest_id = 0;
	my $prefix = '';
	my $prefix_fnl = 1;

	if (REDIRECT_FLAG) {
		unless (-e $cache)

lib/Carrot/Meta/Monad/Phase/Begin.pm  view on Meta::CPAN

	BEGIN {
		require('Carrot/Meta/Monad/Phase/Begin./manual_modularity.pl');
	} #BEGIN

	Carrot::Meta::Greenhouse::Package_Loader::provide(
		my $managed_file_class = '::Meta::Monad::Managed_File',
		my $definitions_class = '::Meta::Monad::Phase::Begin::Definitions');

	Carrot::Meta::Greenhouse::Package_Loader::provide_instance(
		my $compilation_name = '::Meta::Greenhouse::Compilation_Name',
		my $writable_overlay = '::Meta::Greenhouse::Writable_Overlay',
		my $translated_errors = '::Meta::Greenhouse::Translated_Errors');

# =--------------------------------------------------------------------------= #

sub attribute_construction
# /type method
# /effect "Constructs the attribute(s) of a newly created instance."
# //parameters
#	that  ::Meta::Monad
# //returns

lib/Carrot/Meta/Monad/Phase/Begin.pm  view on Meta::CPAN


	return unless (defined($this->[ATR_PRINCIPLE]));
	my $manual_file = $this->[ATR_DOT_DIRECTORY]
		->entry('manual_modularity.pl');

	unless ($manual_file->exists)
	{
		my $managed_file = $managed_file_class->constructor($this);
		my $candidate = $this->[ATR_DOT_DIRECTORY]->entry(
			"managed_modularity-$$compilation_name.pl");
		$writable_overlay->redirect_write($candidate);

		$managed_file->set($candidate);
		eval {
			if ($managed_file->needs_update)
			{
				$this->_managed_modularity($managed_file);
			}
			$managed_file->require($this);
			return(IS_TRUE);

lib/Carrot/Meta/Monad/Phase/Prepare.pm  view on Meta::CPAN


	use strict;
	use warnings 'FATAL' => 'all';

	BEGIN {
		require('Carrot/Meta/Monad/Phase/Prepare./manual_modularity.pl');
	} #BEGIN

	Carrot::Meta::Greenhouse::Package_Loader::provide_instance(
		my $pkg_patterns = '::Modularity::Package::Patterns',
		my $writable_overlay = '::Meta::Greenhouse::Writable_Overlay',
		my $narrowed_re = '::Meta::Greenhouse::Narrowed_RE',
		my $compilation_name = '::Meta::Greenhouse::Compilation_Name');

	my $substitute_diversity1 = $narrowed_re->substitute_softspace_line(
		'DIVERSITY \{',
		'^-------^___');
	my $substitute_diversity2 = $narrowed_re->substitute_softspace_line(
		'\} #DIVERSITY',
		'____^-------^');

lib/Carrot/Meta/Monad/Phase/Prepare.pm  view on Meta::CPAN

# //returns
{
	my ($this, $pkg_name, $pkg_file) = @ARGUMENTS;

	my $source_code = $this->source_code;
	return if ($$source_code =~ m{require\('Carrot/}s);

	my $pmt_file = $pkg_patterns->dot_directory_from_file($pkg_file)
		. "/shadow-$$compilation_name.pmt";
	my $shadow_tmp = $pmt_file;
	$writable_overlay->redirect_write(\$shadow_tmp);
	$_[SPX_PKG_FILE] = $shadow_tmp;

	if ($substitute_diversity1->($source_code, 'PREPARE'))
	{
		$substitute_diversity2->($source_code, 'PREPARE');
	}
	if ($substitute_modularity1->($source_code, 'BEGIN'))
	{
		$substitute_modularity2->($source_code, 'BEGIN');
	}

lib/Carrot/Modularity/Package/Patterns.pm  view on Meta::CPAN

	use warnings 'FATAL' => 'all';

	BEGIN {
		require('Carrot/Modularity/Package/Patterns./manual_modularity.pl');
	} #BEGIN

	require Carrot::Modularity::Package::Tabulator;
	my $pkg_tabulator = Carrot::Modularity::Package::Tabulator->constructor;

	require Carrot::Meta::Greenhouse::Writable_Overlay;
	my $writable_overlay = Carrot::Meta::Greenhouse::Writable_Overlay->constructor;

	require Carrot::Meta::Greenhouse::Named_RE;
	my $named_re = Carrot::Meta::Greenhouse::Named_RE->constructor;

	$named_re->provide(
		my $re_perl_pkg_n_sub = 'perl_pkg_n_sub',
		my $re_perl_pkg_last_element = 'perl_pkg_last_element',
		my $re_carrot_dot_directory = 'carrot_dot_directory');

# =--------------------------------------------------------------------------= #

lib/Carrot/Modularity/Package/Patterns.pm  view on Meta::CPAN


sub dot_directory_from_file
# /type method
# /effect ""
# //parameters
#	pkg_file        ::Personality::Abstract::Text
# //returns
#	?
{
	my $pkg_file = $_[SPX_PKG_FILE];
	$writable_overlay->direct_read(\$pkg_file);
	return((($pkg_file =~ m{$re_carrot_dot_directory}so)
			? $1
			: $pkg_file)
		.'.');
}

sub pkg_n_sub
# /type method
# /effect ""
# //parameters

lib/Carrot/Modularity/Package/Shadow.pm  view on Meta::CPAN


#	require Carrot::Modularity::Package::Patterns;
#	my $pkg_patterns = Carrot::Modularity::Package::Patterns->constructor;

	require Carrot::Meta::Greenhouse::File_Content;
	my $file_content = Carrot::Meta::Greenhouse::File_Content->constructor;

	Carrot::Meta::Greenhouse::Package_Loader::provide_instance(
		my $pkg_patterns = '::Modularity::Package::Patterns',
#		my $file_content = '::Meta::Greenhouse::File_Content',
		my $writable_overlay = '::Meta::Greenhouse::Writable_Overlay',
		my $compilation_name = '::Meta::Greenhouse::Compilation_Name');

# =--------------------------------------------------------------------------= #

sub is_current
# /type function
# /effect ""
# //parameters
#	pkg_file
# //returns
#	::Personality::Abstract::Boolean
{
	my ($pkg_file) = @ARGUMENTS;

	my $shadow_pkg = $pkg_patterns->dot_directory_from_file($pkg_file)
		. "shadow-$$compilation_name.pm";
	$writable_overlay->redirect_read(\$shadow_pkg);

	if (-f $shadow_pkg and -s _)
	{
		my $mtime1 = (stat($shadow_pkg))[RDX_STAT_MTIME];
		my $mtime2 = (stat($pkg_file))[RDX_STAT_MTIME];
		if ($mtime1 > $mtime2)
		{
			$_[SPX_PKG_FILE] = $shadow_pkg;
			return(IS_TRUE);
#		} else {

lib/Carrot/Modularity/Package/Shadow.pm  view on Meta::CPAN

	my ($pkg_file) = @ARGUMENTS;

	return if ($PROCESS_EXIT_CODE > 0);

#	unless ($pkg_file =~ m{\.tmp\.}s)
#	{
#		die("$pkg_file: doesn't seem to be a temporary file.");
#	}

	my $shadow_pkg = ($pkg_file =~ s{\.pmt\z}{.pm}sr);
	$writable_overlay->redirect_write(\$shadow_pkg);

	$writable_overlay->redirect_read(\$pkg_file);
	unless (-f $pkg_file)
	{
		die("$pkg_file: can't compile a non-existing file.");
	}
	$file_content->read_into($pkg_file, my $buffer);

	my $external_modularity = $pkg_patterns
		->dot_directory_from_file($pkg_file)
		. 'manual_modularity.pll';
	unless (-f $external_modularity)
	{
		$external_modularity = $pkg_patterns
			->dot_directory_from_file($pkg_file)
			. "managed_modularity-$$compilation_name.pl";
		$writable_overlay->redirect_read(\$external_modularity);
	}

	if (-f $external_modularity)
	{
		$file_content->read_into(
			$external_modularity,
			my $extra_begin_code);

		$extra_begin_code =~ s{
			\A.*?

lib/Carrot/Modularity/Package/Shadow.pm  view on Meta::CPAN

		(?:\012|\015\012?)\h+(END)\h+\{\h+\#(\d+)
		.*
		(?:\012|\015\012?)\h+\}\h+\#\g{1}-\g{2}}{\n}sgx);
	unless ($modified == 1)
	{
		die("Could not remove end block in '$pkg_file'.");
	}
	$buffer =~ s{#--8<-- carrot-(modularity|individuality)-(start|end) -->8--#}{}saag;

	$file_content->overwrite_from($shadow_pkg, $buffer);
	$writable_overlay->remove($pkg_file);

	return;
}

# =--------------------------------------------------------------------------= #

	return(PERL_FILE_LOADED);
}
# //revision_control
#	version 1.1.160



( run in 0.388 second using v1.01-cache-2.11-cpan-49f99fa48dc )