App-Requirement-Arch

 view release on metacpan or  search on metacpan

scripts/ra_edit.pl  view on Meta::CPAN

	found in ~/.ra/

	On exit the file contents is checked for format validity. Extra checks are available through options
	
ARGUMENTS
  --master_template_file     file containing the master template
  --master_categories_file   file containing the categories template
  --free_form_template       user defined template matching the master template
  --no_check_categories      do not check the requirement categories
  --no_spellcheck            perform no spellchecking
  --no_backup                do not save a backup file

FILES
	~/.ra/templates/master_template.pl
	~/.ra/templates/master_categories.pl
	~/.ra/templates/free_form_template.rat

AUTHORS
	Khemir Nadim ibn Hamouda

EOH

exit(1) ;
}

#------------------------------------------------------------------------------------------------------------------

my ($master_template_file, $master_categories_file, $free_form_template) ;
my ($no_spellcheck, $raw, $no_backup, $no_check_categories) ;

die 'Error parsing options!'unless 
	GetOptions
		(
		'master_template_file=s' => \$master_template_file,
		'master_categories_file=s' => \$master_categories_file,
		'free_form_template=s' => \$free_form_template,
		'no_spellcheck' => \$no_spellcheck,
		'raw=s' => \$raw,
		'no_backup' => \$no_backup,
		'no_check_categories' => \$no_check_categories,
		'h|help' => \&display_help, 
		
		'dump_options' => 
			sub 
				{
				print join "\n", map {"-$_"} 
					qw(
					master_template_file
					master_categories_file
					free_form_template
					no_spellcheck
					raw
					no_backup
					no_check_categories
					help
					) ;
					
				exit(0) ;
				},

		) ;

($master_template_file, $master_categories_file, $free_form_template)  

scripts/ra_edit.pl  view on Meta::CPAN

		$requirement_text = Dumper $requirement ;
		$requirement_text =~ s/\$VAR1 =// ;
		$requirement_text =~ s/^\s*//gm ;
		}
	}
	
eval
	{
	my $edited_requirement_text = Proc::InvokeEditor->edit($requirement_text, '.pl') ;

	# save backup
	write_file("$requirement_file.bak", $requirement_text) unless $no_backup ;

	# remove violation message
	$edited_requirement_text =~ s/\Q$violations_text// ;
	
	# save edited requirement
	write_file($requirement_file, $edited_requirement_text) ;

	# check
	my $violations = check_requirement_file
			(



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