rwdgutenberg 0.09 → 0.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. data/Readme.txt +20 -7
  2. data/code/01rwdcore/01rwdcore.rb +3 -0
  3. data/code/01rwdcore/openhelpwindow.rb +1 -1
  4. data/code/01rwdcore/runopentinkerdocument.rb +1 -1
  5. data/code/01rwdcore/rwdtinkerversion.rb +1 -1
  6. data/code/superant.com.gutenberg/0uninstallapplet.rb +17 -11
  7. data/code/superant.com.gutenberg/changegutenbergname.rb +2 -2
  8. data/code/superant.com.gutenberg/clearbookscreendisplay.rb +5 -5
  9. data/code/superant.com.gutenberg/cleargutenbergfiles.rb +0 -0
  10. data/code/superant.com.gutenberg/cleargutrecordfiles.rb +0 -0
  11. data/code/superant.com.gutenberg/copyfilename.rb +2 -2
  12. data/code/superant.com.gutenberg/createnewnote.rb +13 -12
  13. data/code/superant.com.gutenberg/deletegutenbergrecord.rb +9 -8
  14. data/code/superant.com.gutenberg/gutenbergcreatefile.rb +22 -10
  15. data/code/superant.com.gutenberg/helptexthashload.rb +21 -0
  16. data/code/superant.com.gutenberg/launchurl.rb +13 -0
  17. data/code/superant.com.gutenberg/listdirectories.rb +32 -0
  18. data/code/superant.com.gutenberg/listnamerecord.rb +10 -10
  19. data/code/superant.com.gutenberg/listnotedirshtml3.rb +57 -0
  20. data/code/superant.com.gutenberg/listtextfilesgutenberg.rb +72 -47
  21. data/code/superant.com.gutenberg/loadbookrecord.rb +55 -17
  22. data/code/superant.com.gutenberg/loadconfigurationrecord.rb +4 -4
  23. data/code/superant.com.gutenberg/loadconfigurationvariables.rb +19 -9
  24. data/code/superant.com.gutenberg/loadhtmlnoterecord.rb +31 -0
  25. data/code/superant.com.gutenberg/openhelpwindowgutenberg.rb +8 -2
  26. data/code/superant.com.gutenberg/resetdir.rb +7 -0
  27. data/code/superant.com.gutenberg/runbackwindow.rb +16 -10
  28. data/code/superant.com.gutenberg/rungutenbergwindow.rb +89 -71
  29. data/code/superant.com.gutenberg/rwdgutenbergbackward.rb +27 -27
  30. data/code/superant.com.gutenberg/rwdtinkerversion.rb +10 -10
  31. data/code/superant.com.gutenberg/saveconfigurationrecord.rb +4 -4
  32. data/code/superant.com.gutenberg/savegutenbergrecord.rb +13 -11
  33. data/code/superant.com.gutenberg/updir.rb +7 -0
  34. data/code/superant.com.rwdtinkerbackwindow/initiateapplets.rb +110 -108
  35. data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +10 -8
  36. data/code/superant.com.rwdtinkerbackwindow/listzips.rb +8 -2
  37. data/code/superant.com.rwdtinkerbackwindow/removeappletvariables.rb +6 -6
  38. data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +1 -1
  39. data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +1 -1
  40. data/code/superant.com.rwdtinkerbackwindow/viewlogfile.rb +13 -0
  41. data/configuration/rwdtinker.dist +4 -8
  42. data/configuration/rwdwgutenberg.dist +23 -0
  43. data/configuration/tinkerwin2variables.dist +17 -7
  44. data/gui/00coreguibegin/applicationguitop.rwd +1 -1
  45. data/gui/frontwindow0/{viewlogo/cc0openphoto.rwd → cc0openphoto.rwd} +0 -0
  46. data/gui/{frontwindowselectionbegin/selectiontabbegin → frontwindowselections}/00selectiontabbegin.rwd +0 -0
  47. data/gui/frontwindowselections/jumplinkcommands.rwd +15 -0
  48. data/gui/{frontwindowselectionzend/viewselectionzend → frontwindowselections}/wwselectionend.rwd +0 -0
  49. data/gui/{frontwindowselectionzend/viewselectionzend/zzdocumentbegin.rwd → frontwindowtdocuments/00documentbegin.rwd} +0 -0
  50. data/gui/frontwindowtdocuments/{superant.com.documents/tinkerdocuments.rwd → tinkerdocuments.rwd} +0 -0
  51. data/gui/{helpaboutbegin/superant.com.helpaboutbegin → frontwindowtdocuments}/zzdocumentend.rwd +0 -0
  52. data/gui/helpaboutbegin/{superant.com.helpaboutbegin/zzzrwdlasttab.rwd → zzzrwdlasttab.rwd} +0 -0
  53. data/gui/helpaboutbegin/{superant.com.helpaboutbegin/zzzzhelpscreenstart.rwd → zzzzhelpscreenstart.rwd} +0 -0
  54. data/gui/{helpaboutinstalled/superant.com.tinkerhelpabout/helpabouttab.rwd → helpaboutbegin/zzzzzzhelpabouttab.rwd} +0 -0
  55. data/gui/helpaboutzend/{superant.com.helpaboutend/helpscreenend.rwd → helpscreenend.rwd} +0 -0
  56. data/gui/helpaboutzend/{superant.com.helpaboutend/zhelpscreenstart2.rwd → zhelpscreenstart2.rwd} +0 -0
  57. data/gui/helpaboutzend/{superant.com.helpaboutend/zzzzhelpabout2.rwd → zzzzhelpabout2.rwd} +0 -0
  58. data/gui/helpaboutzend/{superant.com.helpaboutend/zzzzhelpscreen2end.rwd → zzzzhelpscreen2end.rwd} +0 -0
  59. data/gui/tinkerbackwindows/superant.com.backgutenberg/10appletbegin.rwd +4 -0
  60. data/gui/tinkerbackwindows/{superant.com.gutenberg → superant.com.backgutenberg}/1tabfirst.rwd +0 -0
  61. data/gui/tinkerbackwindows/{superant.com.gutenberg → superant.com.backgutenberg}/20listfiles.rwd +5 -4
  62. data/gui/tinkerbackwindows/{superant.com.gutenberg → superant.com.backgutenberg}/30booklistutilities.rwd +0 -0
  63. data/gui/tinkerbackwindows/superant.com.backgutenberg/35displaytab.rwd +26 -0
  64. data/gui/tinkerbackwindows/{superant.com.gutenberg → superant.com.backgutenberg}/67viewconfiguration.rwd +0 -0
  65. data/gui/{frontwindowselections/superant.com.rwdtinkerwin2selectiontab/jumplinkcommands.rwd → tinkerbackwindows/superant.com.backgutenberg/81jumplinkcommands.rwd} +2 -0
  66. data/gui/tinkerbackwindows/superant.com.backgutenberg/9end.rwd +6 -0
  67. data/gui/tinkerbackwindows/superant.com.gutenberg/10htmlnote.rwd +46 -0
  68. data/gui/tinkerbackwindows/superant.com.gutenberg/12tabfirst.rwd +39 -0
  69. data/gui/tinkerbackwindows/superant.com.gutenberg/35displaytab.rwd +4 -1
  70. data/gui/tinkerbackwindows/superant.com.gutenberg/50listfiles.rwd +37 -0
  71. data/gui/tinkerbackwindows/superant.com.gutenberg/81jumplinkcommands.rwd +1 -1
  72. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/75rwdlogfile.rwd +20 -0
  73. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/81jumplinkcommands.rwd +1 -1
  74. data/gui/zzcoreguiend/{tinkerapplicationguiend/yy9rwdend.rwd → yy9rwdend.rwd} +0 -0
  75. data/init.rb +15 -10
  76. data/installed/gutenbergdata02.inf +2 -2
  77. data/installed/{rwdwgutenberg-0.09.inf → rwdwgutenberg.inf} +3 -2
  78. data/lang/en/rwdcore/languagefile.rb +4 -3
  79. data/lang/es/rwdcore/languagefile-es.rb +1 -0
  80. data/lang/fr/rwdcore/languagefile.rb +1 -0
  81. data/lang/jp/rwdcore/languagefile.rb +1 -0
  82. data/lang/nl/rwdcore/languagefile.rb +1 -0
  83. data/{extras → lib}/rconftool.rb +13 -6
  84. data/{ev → lib/rwd}/browser.rb +2 -2
  85. data/{ev → lib/rwd}/ftools.rb +0 -0
  86. data/{ev → lib/rwd}/mime.rb +0 -0
  87. data/{ev → lib/rwd}/net.rb +18 -7
  88. data/{ev → lib/rwd}/ruby.rb +1 -1
  89. data/{ev → lib/rwd}/rwd.rb +108 -625
  90. data/{ev → lib/rwd}/sgml.rb +1 -1
  91. data/{ev → lib/rwd}/thread.rb +1 -1
  92. data/{ev → lib/rwd}/tree.rb +2 -2
  93. data/{ev → lib/rwd}/xml.rb +1 -1
  94. data/lib/rwdthemes/default.rwd +317 -0
  95. data/lib/rwdthemes/pda.rwd +72 -0
  96. data/lib/rwdthemes/windowslike.rwd +171 -0
  97. data/lib/rwdtinker/rwdtinkertools.rb +24 -0
  98. data/{extras → lib}/zip/ioextras.rb +0 -0
  99. data/{extras → lib}/zip/stdrubyext.rb +0 -0
  100. data/{extras → lib}/zip/tempfile_bugfixed.rb +0 -0
  101. data/{extras → lib}/zip/zip.rb +2 -2
  102. data/{extras → lib}/zip/zipfilesystem.rb +0 -0
  103. data/{extras → lib}/zip/ziprequire.rb +0 -0
  104. data/rwd_files/Books/marip10.lnk +6 -0
  105. data/{Books → rwd_files/Books}/marip10.txt +0 -0
  106. data/{Books → rwd_files/Books}/shannon1948.html +0 -0
  107. data/{Books/Shannon.gut → rwd_files/Books/shannon1948.lnk} +1 -1
  108. data/rwd_files/Books/shannon1948.txt +2667 -0
  109. data/rwd_files/HowTo_Gutenberg.txt +21 -1
  110. data/rwd_files/HowTo_Tinker.txt +58 -1
  111. data/rwd_files/log/rwdtinker.log +2082 -0
  112. data/{code/superant.com.gutenberg/helptexthashrwdgutenberg.rb → rwd_files/rwdgutenberghelpfiles.txt} +26 -19
  113. data/rwdconfig.dist +14 -13
  114. data/tests/makedist-rwdwgutenberg.rb +9 -7
  115. data/tests/makedist.rb +2 -2
  116. data/zips/rwdwcalc-0.63.zip +0 -0
  117. data/zips/rwdwfoldeditor-0.05.zip +0 -0
  118. data/zips/rwdwgutenberg-0.12.zip +0 -0
  119. data/zips/rwdwruby-1.08.zip +0 -0
  120. data/zips/wrubyslippers-1.07.zip +0 -0
  121. metadata +74 -59
  122. data/Books/Mariposa.gut +0 -6
  123. data/code/superant.com.gutenberg/rwdhypernotehelpabout.rb +0 -14
  124. data/code/superant.com.rwdtinkerbackwindow/installapplet.rb +0 -27
  125. data/configuration/language.dist +0 -8
  126. data/configuration/rwdapplicationidentity.dist +0 -3
  127. data/configuration/rwdwgutenberg-0.09.dist +0 -20
  128. data/gui/tinkerbackwindows/superant.com.gutenberg/36displaytab.rwd +0 -15
  129. data/gui/tinkerbackwindows/superant.com.gutenberg/40rwdgutenberg.rwd +0 -16
  130. data/gui/tinkerbackwindows/superant.com.gutenberg/40rwdgutenberghtml.rwd +0 -16
  131. data/lib/temp.rb +0 -1
@@ -2,30 +2,68 @@
2
2
  def rwdgutenloadbookrecord
3
3
 
4
4
  require 'fileutils'
5
- @a_gutenbergdatapath = ""
6
- @a_gutenbergdatainfo = ""
7
- @a_gutenbergdatalocation = ""
8
- @a_gutenbergdatalines = ""
9
- @a_gutenbergdataspeed = ""
10
- @a_gutenbergdatacomments = ""
5
+ @a_gutenbergdatapath = ""
6
+ @a_gutenbergdatainfo = ""
7
+ @a_gutenbergdatalocation = ""
8
+ @a_gutenbergdatalines = ""
9
+ @a_gutenbergdataspeed = ""
10
+ @a_gutenbergdatacomments = ""
11
11
 
12
12
 
13
13
  begin # exception trapped block
14
14
 
15
-
16
- tmpfileName = @a_viewgutenberg + ".gut"
15
+ if File.extname(@a_viewgutenberg) == ".lnk"
16
+ tmpfileName = @a_viewgutenberg
17
+ else
18
+ tmpdirname = File.dirname(@a_viewgutenberg)
19
+ tmpext = File.extname(@a_viewgutenberg)
20
+ tmpfilename = File.basename(@a_viewgutenberg,"#{tmpext}")
21
+ tmpfileName = tmpfilename.to_s + ".lnk"
22
+
23
+ end
17
24
  fileName = File.join($rwdgutenberg_directory,tmpfileName)
18
25
  fd = File.open(fileName,"r")
19
- @a_gutenbergdatapath = fd.readline.chomp
20
- @a_gutenbergdatainfo = fd.readline.chomp
21
- @a_gutenbergdatalocation = fd.readline.chomp
22
- @a_gutenbergdatalines = fd.readline.chomp
23
- @a_gutenbergdataspeed = fd.readline.chomp
24
- @a_gutenbergdatacomments = fd.readline.chomp
25
-
26
- fd.close
26
+ @a_gutenbergdatapath = fd.readline.chomp
27
+ @a_gutenbergdatainfo = fd.readline.chomp
28
+ @a_gutenbergdatalocation = fd.readline.chomp
29
+ @a_gutenbergdatalines = fd.readline.chomp
30
+ @a_gutenbergdataspeed = fd.readline.chomp
31
+ @a_gutenbergdatacomments = fd.readline.chomp
32
+
33
+ fd.close
34
+ rescue SystemCallError, StandardError
35
+ $rwdtinkerlog.error "rwdgutenloadbookrecord: system call error #{$!}"
36
+
37
+ end # exception rescue
38
+
39
+ end
40
+ def rwdgutenloadbookrecord2
41
+
42
+ require 'fileutils'
43
+ @a_gutenbergdata = ""
44
+
45
+
46
+
47
+ begin # exception trapped block
48
+
49
+ if File.extname(@a_viewgutenberg) == ".lnk"
50
+ tmpfilename = File.basename(@a_viewgutenberg,".lnk")
51
+ tmpfileName = tmpfilename.to_s + ".txt"
52
+
53
+ else
54
+ tmpfileName = @a_viewgutenberg
55
+
56
+
57
+ end
58
+ fileName = File.join($rwdgutenberg_directory,tmpfileName)
59
+ fd = File.open(fileName,"r")
60
+ @a_gutenbergdata = fd.read
61
+
62
+ fd.close
27
63
  rescue SystemCallError, StandardError
28
- $stderr.print "system call error: " + $!
64
+
65
+ $rwdtinkerlog.error "rwdgutenloadbookrecord2: system call error "
66
+
29
67
  end # exception rescue
30
68
 
31
69
  end
@@ -3,20 +3,20 @@
3
3
 
4
4
  require 'fileutils'
5
5
 
6
- @a_gutenconfigurationfilename = "rwdwgutenberg-" + RwdGutenbergVersion + ".cnf"
6
+ @a_gutenconfigurationfilename = "rwdwgutenberg.cnf"
7
7
 
8
8
 
9
9
  begin # exception trapped block
10
10
 
11
11
  Dir.chdir($progdir)
12
- fileName = File.join(ConfigurationDir, "rwdwgutenberg-" + RwdGutenbergVersion + ".cnf")
12
+ fileName = File.join(ConfigurationDir, "rwdwgutenberg.cnf")
13
13
 
14
14
 
15
15
  fd = File.open(fileName,"r")
16
- @a_gutenconfigurationfile = fd.read
16
+ @a_gutenconfigurationfile = fd.read
17
17
  fd.close
18
18
  rescue SystemCallError, StandardError
19
- $stderr.print "system call error: " + $!
19
+ $rwdtinkerlog.error "system call error: #{$!}"
20
20
  end # exception rescue
21
21
 
22
22
  end
@@ -1,13 +1,23 @@
1
1
  # this method loads the on screen variables into the running class
2
2
  def loadrwdgutenbergconfigurationvariables
3
-
4
- configfiletoload = File.join(ConfigurationDir,"rwdgutenberg.cnf")
5
- begin
6
- load configfiletoload
7
- @extragutenconfigdatadisplay = ""
8
- @newgutenconfigurationresult = "Config Variables loaded"
9
- rescue
10
- @extragutenconfigdatadisplay = ""
11
- @newgutenconfigurationresult = "loading error"
3
+
4
+ $rwdtinkerlog.debug "in loadrwdgutenbergconfigurationvariables"
5
+
6
+ filename = "rwdwgutenberg.cnf"
7
+ configfiletoload = File.join(ConfigurationDir,filename)
8
+ begin
9
+ load configfiletoload
10
+ @extragutenconfigdatadisplay = ""
11
+ @newgutenconfigurationresult = "Config Variables loaded"
12
+
13
+ $rwdtinkerlog.debug "Config Variables loaded"
14
+
15
+ rescue
16
+ @extragutenconfigdatadisplay = ""
17
+ @newgutenconfigurationresult = "loading error"
18
+
19
+ $rwdtinkerlog.debug "loadrwdgutenbergconfigurationvariables: loading error"
20
+
21
+ resc
12
22
  end
13
23
  end
@@ -0,0 +1,31 @@
1
+ # this method views an existing address record
2
+ def loadgutenbergrecord
3
+
4
+ require 'fileutils'
5
+
6
+
7
+ begin # exception trapped block
8
+
9
+ tmpdirname = File.dirname(@a_viewgutenberghtml)
10
+ tmpext = File.extname(@a_viewgutenberghtml)
11
+ tmpfilename = File.basename(@a_viewgutenberghtml,"#{tmpext}")
12
+ newname = tmpfilename.to_s + ".lnk"
13
+ fileName = File.join(tmpdirname,newname)
14
+ if File.file?( fileName)
15
+ fd = File.open(fileName,"r")
16
+ @a_gutenbergdata = fd.read
17
+ fd.close
18
+
19
+ else
20
+ @a_gutenbergdata = "#{fileName} does not exit"
21
+
22
+ end
23
+
24
+ tmpnewname = tmpfilename.to_s + tmpext
25
+ @a_viewgutenberg = File.join(tmpdirname,tmpnewname)
26
+ rescue SystemCallError, StandardError
27
+ $rwdtinkerlog.error "system call error: #{$!}"
28
+
29
+ end # exception rescue
30
+
31
+ end
@@ -9,9 +9,15 @@ def runhelpwindowrwdgutenberg
9
9
 
10
10
  if @rwd_tab == "superantcomgutenbergfile"
11
11
  $help_topic = "gutenbergedit_help"
12
- end
13
12
 
13
+ end
14
+
14
15
  if @rwd_tab == "rwdgutenberglistfiles"
16
+ $help_topic = "gutenlist_help"
17
+ end
15
18
 
16
-
19
+ if @rwd_tab == "gutendisplaytexttab"
20
+ $help_topic = "gutenbergtextdisplay_help"
21
+ end
22
+
17
23
  if @rwd_tab == "viewrwdgutenbergconfiguration"
18
24
  $help_topic = "rwdgutenberg_configuration"
19
25
  end
@@ -0,0 +1,7 @@
1
+ # this method resets the hypernote directory to the top default setting
2
+ def saggutenbergresetdir
3
+
4
+
5
+ $temp_rwdgutenberg_directory= $rwdgutenberg_directory
6
+ @gutenberg_directory = $temp_rwdhypernote_directory
7
+ end
@@ -1,10 +1,16 @@
1
- # Application RwdAddresses orginally (c) 2004 Steven Gibson under GPL.
2
- # This application is a contact book
3
- # For more information about see http://www.rubyforge.net/projects/rwdapplications
4
-
5
- # call the window
6
- def runrwdgutenbergbackwindow
7
- @rwd_window = "rwdgutenbergwindow"
8
- @rwd_tab = "superantcomgutenbergfile"
9
- end
10
-
1
+ # Application RwdAddresses orginally (c) 2004 Steven Gibson under GPL.
2
+ # This application is a contact book
3
+ # For more info see http://www.rubyforge.net/projects/rwdapplications
4
+
5
+ # call the window
6
+ def runrwdgutenbergwindow
7
+ @rwd_window = "rwdgutenbergwindow"
8
+ @rwd_tab = "rwdgutenbergedit"
9
+
10
+ end
11
+
12
+ def rungutenbergbackwindow
13
+ @rwd_window = "rwdgutenbergbackwindow"
14
+ @rwd_tab = "superantcomgutenbergfile"
15
+ end
16
+
@@ -1,71 +1,89 @@
1
- # method to open new TEXT gutenberg window
2
- def rungutenbergwindow
3
- @rwd_window = "gutendisplaywindowtwo"
4
- rwdgutenbergwindowtwo
5
- end
6
-
7
- # method to open new HTML gutenberg window
8
- def rungutenbergwindowhtml
9
- @rwd_window = "gutendisplayhtmlwindowtwo"
10
- rwdgutenbergwindowtwo
11
- end
12
- $tempnumber = 0
13
-
14
- # start book from beginning
15
- def rungutenbergreset
16
- $booklocation = 0
17
- $gutenbergcommand = "openbook"
18
-
19
- rwdgutenbergwindowtwo
20
- end
21
-
22
- # display text and advance text
23
- def rwdgutenbergwindowtwo
24
- begin
25
- tempdoc = ""
26
- @gutendisplayvariable = ""
27
- tempcount = 0
28
-
29
-
30
- if $gutenbergcommand == "openbook"
31
-
32
- fileName = $rwdgutenberg_directory + "/" + @a_viewgutenberg + ".gut"
33
- fd = File.open(fileName,"r")
34
- booktitle = fd.readline.chomp
35
-
36
- $bookfile=File.new(booktitle,"r") #opens the file thats in fileName as read only
37
- $gutenbergcommand == "continue"
38
-
39
- end
40
-
41
- if $gutenbergcommand == "continue"
42
- tempcount = 0
43
- while tempcount < $booksteps
44
- tempdoc += $bookfile.gets #reads the file into the doc string
45
- tempcount += 1
46
- end
47
- $booklocation = $booklocation + $booksteps
48
- end
49
- if $gutenbergcommand == "openbook"
50
-
51
- while tempcount < $booklocation + $booksteps
52
- tempdoc += $bookfile.gets #reads the file into the doc string
53
-
54
- tempcount += 1
55
- end
56
- $booklocation = $booksteps
57
- $gutenbergcommand = "continue"
58
- end
59
- if $gutenbergcommand == "closebook"
60
- $bookfile.close
61
- end
62
- @gutendisplayvariable = tempdoc
63
-
64
-
65
- rescue SystemCallError , StandardError, RuntimeError
66
- $stderr.print "system call error: " + $! + "\n"
67
-
68
- $gutenbergcommand == "closebook"
69
-
70
- end
71
- end
1
+ # method to open new TEXT gutenberg window
2
+ def rungutenbergwindow
3
+ @rwd_window = "gutendisplaywindowtwo"
4
+ rwdgutenbergwindowtwo
5
+ end
6
+
7
+ # method to open new HTML gutenberg window
8
+ def rungutenbergwindowhtml
9
+ @rwd_window = "gutendisplayhtmlwindowtwo"
10
+ rwdgutenbergwindowtwo
11
+ end
12
+ $tempnumber = 0
13
+
14
+ def loadoptionsgutenberg
15
+
16
+ gutenbergarray = [5,10,20,50,100,500]
17
+ @gutenbergspeedoptions = gutenbergarray.rwd_options
18
+
19
+ end
20
+
21
+ # start book from beginning
22
+ def rungutenbergreset
23
+ $booklocation = 0
24
+ $gutenbergcommand = "openbook"
25
+
26
+ rwdgutenbergwindowtwo
27
+ end
28
+
29
+ # display text and advance text
30
+ def rwdgutenbergwindowtwo
31
+ if @a_gutenbergspeedinput == nil
32
+ $rwdtinkerlog.debug "rwdgutenbergwindowtwo: steps = nil"
33
+ else
34
+ $booksteps = @a_gutenbergspeedinput.to_i
35
+ end
36
+
37
+ begin
38
+ tempdoc = ""
39
+ @gutendisplayvariable = ""
40
+ tempcount = 0
41
+
42
+
43
+ if $gutenbergcommand == "openbook"
44
+
45
+ if File.extname(@a_viewgutenberg) == ".lnk"
46
+ fileName = @a_viewgutenberg.strip
47
+
48
+ fd = File.open(fileName,"r")
49
+ booktitle = fd.readline.chomp
50
+ else
51
+ booktitle = @a_viewgutenberg.strip
52
+ end
53
+ if File.file?(booktitle)
54
+ $bookfile=File.new(booktitle,"r") #opens the file thats in fileName as read only
55
+ $gutenbergcommand == "continue"
56
+ end
57
+ end
58
+
59
+ if $gutenbergcommand == "continue"
60
+ tempcount = 0
61
+ while tempcount < $booksteps
62
+ tempdoc += $bookfile.gets #reads the file into the doc string
63
+ tempcount += 1
64
+ end
65
+ $booklocation = $booklocation + $booksteps
66
+ end
67
+ if $gutenbergcommand == "openbook"
68
+
69
+ while tempcount < $booklocation + $booksteps
70
+ tempdoc += $bookfile.gets #reads the file into the doc string
71
+
72
+ tempcount += 1
73
+ end
74
+ $booklocation = $booksteps
75
+ $gutenbergcommand = "continue"
76
+ end
77
+ if $gutenbergcommand == "closebook"
78
+ $bookfile.close
79
+ end
80
+ @gutendisplayvariable = tempdoc
81
+
82
+
83
+ rescue SystemCallError , StandardError, RuntimeError
84
+ $stderr.print "system call error: " + $! + "\n"
85
+
86
+ $gutenbergcommand == "closebook"
87
+
88
+ end
89
+ end
@@ -1,27 +1,27 @@
1
-
2
-
3
- def rwdgutenbergbackward
4
- tempdoc = ""
5
- @gutendisplayvariable = ""
6
-
7
- tempcount = 0
8
- if @rwd_tab== "rwdgutenberg"
9
- @rwd_window = "gutendisplaywindowtwo"
10
- end
11
- $booklocation = $booklocation - ($booksteps + $booksteps)
12
- while tempcount < $booklocation + $booksteps
13
- $bookfile.gets
14
- if tempcount > $booklocation -1
15
- tempdoc += $bookfile.gets #reads the file into the doc string
16
- end
17
-
18
- tempcount += 1
19
- end
20
-
21
- $booklocation = $booklocation + $booksteps
22
- if $gutenbergcommand == "closebook"
23
- $bookfile.close
24
- end
25
- @gutendisplayvariable = tempdoc
26
-
27
- end
1
+ # move back
2
+
3
+ def rwdgutenbergbackward
4
+ tempdoc = ""
5
+ @gutendisplayvariable = ""
6
+
7
+ tempcount = 0
8
+ if @rwd_tab== "rwdgutenberg"
9
+ @rwd_window = "gutendisplaywindowtwo"
10
+ end
11
+ $booklocation = $booklocation - ($booksteps + $booksteps)
12
+ while tempcount < $booklocation + $booksteps
13
+ $bookfile.gets
14
+ if tempcount > $booklocation -1
15
+ tempdoc += $bookfile.gets #reads the file into the doc string
16
+ end
17
+
18
+ tempcount += 1
19
+ end
20
+
21
+ $booklocation = $booklocation + $booksteps
22
+ if $gutenbergcommand == "closebook"
23
+ $bookfile.close
24
+ end
25
+ @gutendisplayvariable = tempdoc
26
+
27
+ end