aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/db_tests.rb
blob: 4a18f69466c0184052f38013e875953a06455742 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# coding: utf-8
=begin

 * Name: SiSU

 * Description: a framework for document structuring, publishing and search

 * Author: Ralph Amissah

 * Copyright: (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
   2007, 2008 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 <http://www.gnu.org/licenses/>.

   If you have Internet connection, the latest version of the GPL should be
   available at these locations:
   <http://www.fsf.org/licensing/licenses/gpl.html>
   <http://www.gnu.org/licenses/gpl.html>

   <http://www.jus.uio.no/sisu/gpl.fsf/toc.html>
   <http://www.jus.uio.no/sisu/gpl.fsf/doc.html>
   <http://www.jus.uio.no/sisu/gpl.fsf/plain.txt>

 * SiSU uses:
   * Standard SiSU markup syntax,
   * Standard SiSU meta-markup syntax, and the
   * Standard SiSU object citation numbering and system

 * Hompages:
   <http://www.jus.uio.no/sisu>
   <http://www.sisudoc.org>

 * Download:
   <http://www.jus.uio.no/sisu/SiSU/download.html>

 * Ralph Amissah
   <ralph@amissah.com>
   <ralph.amissah@gmail.com>

 ** Description: modules shared by the different db types, dbi, postgresql,
    sqlite

=end
module SiSU_DB_tests
  class Test
    def initialize(info,opt)
      @ck,@opt=info,opt
      unless @opt.cmd =~/q/
        puts @ck.tp[:fns]  if @ck.tp[:fns] and not @ck.tp[:fns].empty?
        puts @ck.tp[:title] if @ck.tp[:title] and not @ck.tp[:title].empty?
        puts @ck.tp[:creator] if @ck.tp[:creator] and not @ck.tp[:creator].empty?
      end
    end
    def verify
      unless @opt.cmd =~/q/
      puts @ck.tp[:fns].length.to_s            + ' checklength ' + @ck.tp[:fns]            if @ck.tp[:fns]            and @ck.tp[:fns].length            >@ck.lt_filename
      puts @ck.tp[:title].length.to_s          + ' checklength ' + @ck.tp[:title]          if @ck.tp[:title]          and @ck.tp[:title].length          >@ck.lt_title
      puts @ck.tp[:subtitle].length.to_s       + ' checklength ' + @ck.tp[:subtitle]       if @ck.tp[:subtitle]       and @ck.tp[:subtitle].length       >@ck.lt_subtitle
      puts @ck.tp[:creator].length.to_s        + ' checklength ' + @ck.tp[:creator]        if @ck.tp[:creator]        and @ck.tp[:creator].length        >@ck.lt_creator
      puts @ck.tp[:illustrator].length.to_s    + ' checklength ' + @ck.tp[:illustrator]    if @ck.tp[:illustrator]    and @ck.tp[:illustrator].length    >@ck.lt_illustrator
      puts @ck.tp[:translator].length.to_s     + ' checklength ' + @ck.tp[:translator]     if @ck.tp[:translator]     and @ck.tp[:translator].length     >@ck.lt_translator
      puts @ck.tp[:prepared_by].length.to_s    + ' checklength ' + @ck.tp[:prepared_by]    if @ck.tp[:prepared_by]    and @ck.tp[:prepared_by].length    >@ck.lt_prepared_by
      puts @ck.tp[:digitized_by].length.to_s   + ' checklength ' + @ck.tp[:digitized_by]   if @ck.tp[:digitized_by]   and @ck.tp[:digitized_by].length   >@ck.lt_digitized_by
      puts @ck.tp[:subject].length.to_s        + ' checklength ' + @ck.tp[:subject]        if @ck.tp[:subject]        and @ck.tp[:subject].length        >@ck.lt_subject
      puts @ck.tp[:description].length.to_s    + ' checklength ' + @ck.tp[:description]    if @ck.tp[:description]    and @ck.tp[:description].length    >@ck.lt_description
      puts @ck.tp[:publisher].length.to_s      + ' checklength ' + @ck.tp[:publisher]      if @ck.tp[:publisher]      and @ck.tp[:publisher].length      >@ck.lt_publisher
      puts @ck.tp[:contributor].length.to_s    + ' checklength ' + @ck.tp[:contributor]    if @ck.tp[:contributor]    and @ck.tp[:contributor].length    >@ck.lt_contributor
      puts @ck.tp[:date].length.to_s           + ' checklength ' + @ck.tp[:date]           if @ck.tp[:date]           and @ck.tp[:date].length           >@ck.lt_date
      puts @ck.tp[:date_created].length.to_s   + ' checklength ' + @ck.tp[:date_created]   if @ck.tp[:date_created]   and @ck.tp[:date_created].length   >@ck.lt_date_created
      puts @ck.tp[:date_issued].length.to_s    + ' checklength ' + @ck.tp[:date_issued]    if @ck.tp[:date_issued]    and @ck.tp[:date_issued].length    >@ck.lt_date_issued
      puts @ck.tp[:date_valid].length.to_s     + ' checklength ' + @ck.tp[:date_valid]     if @ck.tp[:date_valid]     and @ck.tp[:date_valid].length     >@ck.lt_date_valid
      puts @ck.tp[:date_available].length.to_s + ' checklength ' + @ck.tp[:date_available] if @ck.tp[:date_available] and @ck.tp[:date_available].length >@ck.lt_date_available
      puts @ck.tp[:date_modified].length.to_s  + ' checklength ' + @ck.tp[:date_modified]  if @ck.tp[:date_modified]  and @ck.tp[:date_modified].length  >@ck.lt_date_modified
      puts @ck.tp[:type].length.to_s           + ' checklength ' + @ck.tp[:type]           if @ck.tp[:type]           and @ck.tp[:type].length           >@ck.lt_type
      puts @ck.tp[:format].length.to_s         + ' checklength ' + @ck.tp[:format]         if @ck.tp[:format]         and @ck.tp[:format].length         >@ck.lt_format
      puts @ck.tp[:identifier].length.to_s     + ' checklength ' + @ck.tp[:identifier]     if @ck.tp[:identifier]     and @ck.tp[:identifier].length     >@ck.lt_identifier
      puts @ck.tp[:source].length.to_s         + ' checklength ' + @ck.tp[:source]         if @ck.tp[:source]         and @ck.tp[:source].length         >@ck.lt_source
      puts @ck.tp[:language].length.to_s       + ' checklength ' + @ck.tp[:language]       if @ck.tp[:language]       and @ck.tp[:language].length       >@ck.lt_language
      puts @ck.tp[:language_original].length.to_s + ' checklength ' + @ck.tp[:language_original] if @ck.tp[:language_original] and @ck.tp[:language_original].length >@ck.lt_language_original
      #puts @ck.tp[:language_char].length.to_s     + ' checklength ' + @ck.tp[:language_char]       if @ck.tp[:language_char]       and @ck.tp[:language_char].length       >@ck.lt_language_char
      #puts @ck.tp[:language_original_char].length.to_s + ' checklength ' + @ck.tp[:language_original_char]       if @ck.tp[:language_original_char]       and @ck.tp[:language_original_char].length       >@ck.lt_language_original_char
      puts @ck.tp[:relation].length.to_s       + ' checklength ' + @ck.tp[:relation]       if @ck.tp[:relation]       and @ck.tp[:relation].length       >@ck.lt_relation
      puts @ck.tp[:coverage].length.to_s       + ' checklength ' + @ck.tp[:coverage]       if @ck.tp[:coverage]       and @ck.tp[:coverage].length       >@ck.lt_coverage
      puts @ck.tp[:rights].length.to_s         + ' checklength ' + @ck.tp[:rights]         if @ck.tp[:rights]         and @ck.tp[:rights].length         >@ck.lt_rights
      puts @ck.tp[:copyright].length.to_s      + ' checklength ' + @ck.tp[:copyright]      if @ck.tp[:copyright]      and @ck.tp[:copyright].length      >@ck.lt_copyright
      puts @ck.tp[:owner].length.to_s          + ' checklength ' + @ck.tp[:owner]          if @ck.tp[:owner]          and @ck.tp[:owner].length          >@ck.lt_owner
      puts @ck.tp[:keywords].length.to_s       + ' checklength ' + @ck.tp[:keywords]       if @ck.tp[:keywords]       and @ck.tp[:keywords].length       >@ck.lt_keywords
      puts @ck.tp[:abstract].length.to_s       + ' checklength ' + @ck.tp[:abstract]       if @ck.tp[:abstract]       and @ck.tp[:abstract].length       >@ck.lt_abstract
      puts @ck.tp[:comment].length.to_s        + ' checklength ' + @ck.tp[:comment]        if @ck.tp[:comment]        and @ck.tp[:comment].length        >@ck.lt_comment
      puts @ck.tp[:loc].length.to_s            + ' checklength ' + @ck.tp[:loc]            if @ck.tp[:loc]            and @ck.tp[:loc].length            >@ck.lt_loc
      puts @ck.tp[:dewey].length.to_s          + ' checklength ' + @ck.tp[:dewey]          if @ck.tp[:dewey]          and @ck.tp[:dewey].length          >@ck.lt_dewey
      puts @ck.tp[:isbn].length.to_s           + ' checklength ' + @ck.tp[:isbn]           if @ck.tp[:isbn]           and @ck.tp[:isbn].length           >@ck.lt_isbn
      puts @ck.tp[:pg].length.to_s             + ' checklength ' + @ck.tp[:pg]             if @ck.tp[:pg]             and @ck.tp[:pg].length             >@ck.lt_pg
      puts @ck.tp[:date]                                                                   if  @ck.tp[:date] and not @ck.tp[:date].empty? and @ck.tp[:date] !~/\d\d-\d\d-\d\d/
      end
    end
  end
end
__END__