From 7372f56054259457f77c64cbdb34e736531cfc0e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 4 Jul 2009 11:57:29 -0400 Subject: move lib to version 1 directory, (lib/sisu/v1) and make related changes --- lib/sisu/v0/sst_identify_markup.rb | 439 ------------------------------------- 1 file changed, 439 deletions(-) delete mode 100644 lib/sisu/v0/sst_identify_markup.rb (limited to 'lib/sisu/v0/sst_identify_markup.rb') diff --git a/lib/sisu/v0/sst_identify_markup.rb b/lib/sisu/v0/sst_identify_markup.rb deleted file mode 100644 index 7d8e0eda..00000000 --- a/lib/sisu/v0/sst_identify_markup.rb +++ /dev/null @@ -1,439 +0,0 @@ -# coding: utf-8 -=begin - - * Name: SiSU - - * Description: a framework for document structuring, publishing and search - - * Author: Ralph Amissah - - * Copyright: (C) 1997 - 2009 Ralph Amissah All Rights Reserved. - - * License: GPL 3 or later: - - SiSU, a framework for document structuring, publishing and search - - Copyright (C) Ralph Amissah - - This program is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the Free - Software Foundation, either version 3 of the License, or (at your option) - any later version. - - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - more details. - - You should have received a copy of the GNU General Public License along with - this program. If not, see . - - If you have Internet connection, the latest version of the GPL should be - available at these locations: - - - - - - - - * SiSU uses: - * Standard SiSU markup syntax, - * Standard SiSU meta-markup syntax, and the - * Standard SiSU object citation numbering and system - - * Hompages: - - - - * Download: - - - * Ralph Amissah - - - - ** Description: A conversion script for canned substitutions, a fairly generic - simple tool that can be used to store other canned conversions, used here for - altering SiSU markup - -=end -module SiSU_Markup - class Markup_inform - attr_accessor :version - def initialize(version,message,declared_markup='',declared_type='') - @version,@message,@declared_markup,@declared_type=version,message,declared_markup,declared_type - end - def version - @version - end - def message - @message - end - def declared_version - @declared_markup - end - def declared_type - @declared_type - end - def history - Markup_history.new(@version).query - end - end - class Markup_identify - def initialize(opt) - @opt=opt - @description='This is a script attempts to identify the version of markup used in SiSU (and provides information on changes in markup)' - end - def help - print <= 200 - if y =~ /(?:~{\*+|~\[\*|~\[\+)\s/ - version='0.42' - markup=Markup_inform.new(version,'0.42' + oldlinks,@declared_markup,@declared_type) - break - end - end - if (y =~/^1~/ and f =~/(?:\.sst|\.ssm|\.ssi)/) \ - and not @flag_38 - version='0.37' - markup=Markup_inform.new(version,'0.37 is substantially 0.16 - 0.36 markup with new file-extension' + oldlinks,@declared_markup,@declared_type) - break - end - if y =~/^1~/ \ - and f =~/\.([rs])([123])/ \ - and not @flag_38 - t,n=$1,$2 - version='0.16' - instruct=if t =~/r/ - " (change file extension from .#{t}#{n} to .ssm)" - else " (change file extension from .#{t}#{n} to .sst)" - end - markup=Markup_inform.new(version,'0.16 - 0.36' + instruct + links,@declared_markup,@declared_type) - break - end - if y =~/^0\{~/ \ - and not @flag_38 - version='0.1' - markup=Markup_inform.new(version,'0.1 - 0.15',@declared_markup,@declared_type) - break - end - if y =~/^0\{{3}/ \ - and not @flag_38 - markup=Markup_inform.new('circa. 1997','old, check date',@declared_markup,@declared_type) - break - end - markup='Not a recognised file type ' - end - end - markup - else Markup_history.new(@opt).help_query - end - end - def determine_markup_version - if @opt.fns.nil? \ - or @opt.fns.empty? - Markup_history.new(@opt).help_identify - end - if File.exist?(@opt.fns) - if @opt.fns =~/\.(?:sst|ssm|ssi|s[123i]|r[123])/ - markup=identify #(@opt.fns) - if defined? markup.version - #if defined? markup and defined? markup.version - unless @opt.cmd =~/q/ - message=unless markup.declared_version.empty? - "#{@opt.fns}\n markup Type Declared as SiSU #{markup.declared_version} #{markup.declared_type}\n appears to be SiSU #{markup.version}" - else - "Markup Type Appears to be SiSU #{markup.version}\n in file #{@opt.fns}" - end - puts message - #puts markup.message - puts %{"sisu --query-#{markup.version}" for a brief description of markup type} - end - end - else puts 'file-type not recognised: ' + @opt.fns - end - else puts 'file not found: ' + @opt.fns - end - if defined? markup.version; markup.version - else 'markup type/version not determined' - end - end - def markup_version? - if @opt.fns.empty? - @opt.files.each do |fns| - @opt.fns=fns - determine_markup_version - end - else determine_markup_version - end - end - end - class Markup_history - def initialize(opt) - @opt=opt - end - def sisu_0_69 - < -f=$* -cf=f[0].to_s -f.shift -match_and_replace=[] -unless f.length > 0; f=Dir.glob("[a-z]*.ss?") #restricted to sisu type files, it need not be -end -puts "SiSU files:" -puts f -f.each do |x| - SiSU_Markup::Markup_identify.new(x).markup_version? -end -- cgit v1.2.3