rwdgutenberg 0.03
Sign up to get free protection for your applications and to get access to all the features.
- data/Books/8sam810.txt +8522 -0
- data/Books/Sam2.gut +2 -0
- data/Readme.txt +94 -0
- data/bin/rwdgutenberg +19 -0
- data/code/01rwdcore/01rwdcore.rb +20 -0
- data/code/01rwdcore/02helptexthashbegin.rb +4 -0
- data/code/01rwdcore/03helptexthash.rb +31 -0
- data/code/01rwdcore/04helptextend.rb +6 -0
- data/code/01rwdcore/openhelpwindow.rb +31 -0
- data/code/01rwdcore/returntomain.rb +10 -0
- data/code/01rwdcore/rwdtinkerversion.rb +15 -0
- data/code/01rwdcore/rwdwindowreturn.rb +11 -0
- data/code/01rwdcore/uploadreturns.rb +62 -0
- data/code/superant.com.gutenberg/changegutenbergname.rb +16 -0
- data/code/superant.com.gutenberg/clearbookscreendisplay.rb +8 -0
- data/code/superant.com.gutenberg/copyfilename.rb +24 -0
- data/code/superant.com.gutenberg/createnewnote.rb +23 -0
- data/code/superant.com.gutenberg/deletegutenbergrecord.rb +21 -0
- data/code/superant.com.gutenberg/gutenbergcreatefile.rb +9 -0
- data/code/superant.com.gutenberg/helptexthashrwdgutenberg.rb +41 -0
- data/code/superant.com.gutenberg/listnamerecord.rb +15 -0
- data/code/superant.com.gutenberg/listtextfilesgutenberg.rb +58 -0
- data/code/superant.com.gutenberg/loadbookrecord.rb +21 -0
- data/code/superant.com.gutenberg/loadconfigurationrecord.rb +36 -0
- data/code/superant.com.gutenberg/loadconfigurationvariables.rb +13 -0
- data/code/superant.com.gutenberg/openhelpwindowgutenberg.rb +29 -0
- data/code/superant.com.gutenberg/returntomain.rb +10 -0
- data/code/superant.com.gutenberg/rungutenbergwindow.rb +42 -0
- data/code/superant.com.gutenberg/rwdgutenbergbackward.rb +27 -0
- data/code/superant.com.gutenberg/rwdhypernotehelpabout.rb +14 -0
- data/code/superant.com.gutenberg/saveconfigurationrecord.rb +18 -0
- data/code/superant.com.gutenberg/savegutenbergrecord.rb +20 -0
- data/code/superant.com.gutenberg/savelinkrecord.rb +23 -0
- data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +99 -0
- data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +25 -0
- data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +61 -0
- data/code/superant.com.rwdtinkerbackwindow/installapplet.rb +24 -0
- data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +20 -0
- data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +19 -0
- data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +12 -0
- data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +54 -0
- data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +11 -0
- data/code/superant.com.rwdtinkerbackwindow/listzips.rb +31 -0
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +32 -0
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +13 -0
- data/code/superant.com.rwdtinkerbackwindow/network.rb +87 -0
- data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +18 -0
- data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +42 -0
- data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +24 -0
- data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +32 -0
- data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +12 -0
- data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +14 -0
- data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +18 -0
- data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +21 -0
- data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +21 -0
- data/code/zz0applicationend/zz0end.rb +4 -0
- data/configuration/language.dist +7 -0
- data/configuration/rwdapplicationidentity.dist +3 -0
- data/configuration/rwdgutenberg.dist +12 -0
- data/configuration/rwdtinker.dist +15 -0
- data/configuration/tinkerwin2variables.dist +17 -0
- data/ev/browser.rb +109 -0
- data/ev/ftools.rb +170 -0
- data/ev/net.rb +750 -0
- data/ev/ruby.rb +819 -0
- data/ev/rwd.rb +1849 -0
- data/ev/sgml.rb +236 -0
- data/ev/thread.rb +63 -0
- data/ev/tree.rb +343 -0
- data/ev/xml.rb +4 -0
- data/extras/rconftool.rb +380 -0
- data/extras/zip/ioextras.rb +114 -0
- data/extras/zip/stdrubyext.rb +111 -0
- data/extras/zip/tempfile_bugfixed.rb +195 -0
- data/extras/zip/zip.rb +1377 -0
- data/extras/zip/zipfilesystem.rb +558 -0
- data/extras/zip/ziprequire.rb +61 -0
- data/gui/00coreguibegin/applicationguitop.rwd +4 -0
- data/gui/frontwindow0/superant.com.gutenberg/10viewnote.rwd +32 -0
- data/gui/frontwindow0/superant.com.gutenberg/20listfiles.rwd +35 -0
- data/gui/frontwindow0/superant.com.gutenberg/30booklistutilities.rwd +28 -0
- data/gui/frontwindow0/superant.com.gutenberg/35displaytab.rwd +10 -0
- data/gui/frontwindow0/superant.com.gutenberg/40rwdgutenberg.rwd +16 -0
- data/gui/frontwindow0/superant.com.gutenberg/67viewconfiguration.rwd +40 -0
- data/gui/frontwindowselectionbegin/selectiontabbegin/selectiontabbegin.rwd +16 -0
- data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/rwdwin2selectiontab.rwd +12 -0
- data/gui/frontwindowselectionzend/viewselectionzend/viewselectionend.rwd +3 -0
- data/gui/frontwindowtdocumentbegin/superant.com.documentsbegin/tt0documentbegin.rwd +6 -0
- data/gui/frontwindowtdocuments/superant.com,rwdgutenbergdocument/rwdgutenbergdocument.rwd +5 -0
- data/gui/frontwindowtdocuments/superant.com.documents/uu5documents.rwd +15 -0
- data/gui/frontwindowtdocuments/superant.com.tinkerwin2documents/uu5documents.rwd +6 -0
- data/gui/frontwindowtdocumentzend/superant.com.documentsend/ww0documentend.rwd +12 -0
- data/gui/frontwindowz1end/frontwindowend/xx0rwdfirsttab.rwd +6 -0
- data/gui/helpaboutbegin/superant.com.helpaboutbegin/ya0helpscreenstart.rwd +3 -0
- data/gui/helpaboutinstalled/superant.com.rwdgutenberghelpabout/1versionname.rwd +6 -0
- data/gui/helpaboutinstalled/superant.com.rwdgutenberghelpabout/5version.rwd +9 -0
- data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/1appname.rwd +4 -0
- data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/3copyright.rwd +3 -0
- data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/5version.rwd +10 -0
- data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/1appname.rwd +4 -0
- data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/3copyright.rwd +3 -0
- data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/5version.rwd +10 -0
- data/gui/helpaboutzend/superant.com.helpaboutend/helpscreenend.rwd +3 -0
- data/gui/tinkerbackwindows/superant.com.gutendisplay/gutendisplaywindow.rwd +9 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/1appname.rwd +5 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40rwdlistzips.rwd +42 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/45installremotezip.rwd +44 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistapplets.rwd +44 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/60editconfiguration.rwd +38 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/70rwddiagnostics.rwd +29 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/75rwdcontrol.rwd +33 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/80tab1.rwd +11 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/9backend.rwd +6 -0
- data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/1appname.rwd +31 -0
- data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/9end.rwd +4 -0
- data/gui/tinkerbackwindows/superant.com.versionwindow/1appname.rwd +19 -0
- data/gui/zzcoreguiend/tinkerapplicationguiend/yy9rwdend.rwd +4 -0
- data/init.rb +274 -0
- data/installed/rwdviewlogo-0.4.inf +4 -0
- data/lang/en/rwdcore/languagefile.rb +16 -0
- data/lang/es/rwdcore/languagefile-es.rb +14 -0
- data/lang/jp/rwdcore/languagefile.rb +9 -0
- data/lang/nl/rwdcore/languagefile.rb +19 -0
- data/lib/temp.rb +1 -0
- data/rwd_files/HowTo_Gutenberg.txt +94 -0
- data/rwd_files/HowTo_Tinker.txt +400 -0
- data/rwd_files/HowTo_TinkerWin2.txt +202 -0
- data/rwd_files/Readme.txt +57 -0
- data/rwd_files/favicon.ico +0 -0
- data/rwd_files/rdoc-style.css +175 -0
- data/rwd_files/rwdapplications.html +54 -0
- data/rwd_files/rwdindex.html +6 -0
- data/rwd_files/tinker.png +0 -0
- data/rwdconfig.dist +6 -0
- data/rwdgutenberg-0.03.gem +0 -0
- data/tests/checkdepends.sh +4 -0
- data/tests/cleancnf.sh +5 -0
- data/tests/makedist.rb +29 -0
- data/tests/rdep.rb +354 -0
- data/tests/rwdtinkertestEN.rb +163 -0
- data/tests/test.result +32 -0
- data/tests/totranslate.lang +93 -0
- data/zips/rwdahelloworld-0.5.zip +0 -0
- metadata +198 -0
data/Books/Sam2.gut
ADDED
data/Readme.txt
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
= rwdgutenberg - for rwdtinker and RubyWebDialogs
|
2
|
+
|
3
|
+
rwdgutenberg is a bookreading program
|
4
|
+
|
5
|
+
The GUI interface used is RubyWebDialogs
|
6
|
+
|
7
|
+
RubyWebDialogs is a platform independent graphical user interface for Ruby applications. It generates HTML and serves it with an internal HTTP server, so you can use your favorite web browser as the front end for your Ruby application. All this means, that it can be used on almost every platform, like Ruby itself. http://www.erikveen.dds.nl/rubywebdialogs/
|
8
|
+
|
9
|
+
== Quick Start
|
10
|
+
Start the program by typing
|
11
|
+
ruby init.rb
|
12
|
+
|
13
|
+
Then point your web browser to:
|
14
|
+
http://localhost:7705/
|
15
|
+
|
16
|
+
To exit, press the x inside the browser window.
|
17
|
+
|
18
|
+
== rwdgutenberg
|
19
|
+
|
20
|
+
This program is a book reader
|
21
|
+
a book info can be entered and saved in a book directory
|
22
|
+
|
23
|
+
Bookdata can be saved in a file in the book directory
|
24
|
+
|
25
|
+
|
26
|
+
== Tabs
|
27
|
+
|
28
|
+
There are tabs to enter bookdata and links and edit configurations
|
29
|
+
|
30
|
+
View/Edit Note - to create a bookdata or edit and existing bookdata
|
31
|
+
|
32
|
+
View/Edit Links - to edit links
|
33
|
+
|
34
|
+
Note Utilities - to rename or delete bookdata
|
35
|
+
|
36
|
+
Edit Configuration - to change the configuration of rwdgutenberg
|
37
|
+
|
38
|
+
|
39
|
+
== Using over a Network
|
40
|
+
|
41
|
+
To serve the application over your local LAN,change the last line in the
|
42
|
+
init.rb file to something like:
|
43
|
+
RwdTinker.file(RWDFile).serve(8080, "-r" ? ".rwduids" : nil)
|
44
|
+
Then you should be able to login at: http://yourhostname:8080
|
45
|
+
|
46
|
+
You have to authorize yourself. The .rwuids example is a string with
|
47
|
+
the name of the authorization file, relative to the home directory
|
48
|
+
of the user that started the service. This file has to be in the form of:
|
49
|
+
|
50
|
+
user1 = password
|
51
|
+
user2 = pass phrase
|
52
|
+
|
53
|
+
Thus the file .rwduids might contain:
|
54
|
+
|
55
|
+
erik = secret
|
56
|
+
|
57
|
+
== Requirements:
|
58
|
+
RubyWebDialogs - I am using 0.0.12
|
59
|
+
Ruby I am using version 1.8.2
|
60
|
+
|
61
|
+
|
62
|
+
I have tested this under Linux-Debian kernel 2.6.9
|
63
|
+
|
64
|
+
== PROBLEMS:
|
65
|
+
|
66
|
+
Closing the browser doesn't terminate the application. You have to use the application's close-button And terminating the application doesn't terminate the application when running in network mode. You just log out.
|
67
|
+
|
68
|
+
Don't use the back-button of the browser! Strange and unpredictable things may and will happen!
|
69
|
+
|
70
|
+
|
71
|
+
== contacts
|
72
|
+
For more information see:
|
73
|
+
http://rwdapplications.rubyforge.org/wiki/wiki.pl
|
74
|
+
|
75
|
+
|
76
|
+
For more information about RubyWebDialogs see:
|
77
|
+
http://www.erikveen.dds.nl/rubywebdialogs/index.html
|
78
|
+
|
79
|
+
|
80
|
+
Steven Gibson
|
81
|
+
steven@superant.com
|
82
|
+
|
83
|
+
== Changelog
|
84
|
+
version 0.03
|
85
|
+
edit data doc
|
86
|
+
delete file, rename file
|
87
|
+
|
88
|
+
version 0.02
|
89
|
+
search directories
|
90
|
+
create new data files
|
91
|
+
|
92
|
+
version 0.01
|
93
|
+
First Release
|
94
|
+
|
data/bin/rwdgutenberg
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#--
|
3
|
+
# Copyright 2004 Steven Gibson <steven@superant.com>
|
4
|
+
# RwdTinker application
|
5
|
+
#
|
6
|
+
# This program is free software. It may be redistributed and/or modified under
|
7
|
+
# the terms of the GPL version 2 (or later), or the
|
8
|
+
# Ruby licence.
|
9
|
+
#
|
10
|
+
#++
|
11
|
+
|
12
|
+
|
13
|
+
$progdir = File::expand_path( File.dirname(__FILE__))
|
14
|
+
|
15
|
+
Dir.chdir($progdir)
|
16
|
+
|
17
|
+
Dir.chdir("..")
|
18
|
+
|
19
|
+
`ruby init.rb`
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
|
2
|
+
# This application is a framework for writing programs from RubyWebDialogs
|
3
|
+
# http://www.erikveen.dds.nl/rubywebdialogs/index.html
|
4
|
+
# For more information about RwdTinker see http://www.rubyforge.net/projects/rwdapplications
|
5
|
+
# This class is the top class for the RwdTinker application
|
6
|
+
|
7
|
+
class RwdTinker < RWDialog
|
8
|
+
|
9
|
+
def main
|
10
|
+
@rwd_window = "main"
|
11
|
+
@result = "idle"
|
12
|
+
@display= "idle"
|
13
|
+
|
14
|
+
|
15
|
+
end
|
16
|
+
|
17
|
+
def inspect
|
18
|
+
"Rwdtinker Application "
|
19
|
+
end
|
20
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# Help files for RwdTinker core
|
2
|
+
|
3
|
+
|
4
|
+
:general_help => "You can work with Applets: go to 'Selection tab',
|
5
|
+
On that back screen you will find:
|
6
|
+
List Applets: you can see and delete installed applets
|
7
|
+
List Zips: you can see lists of applets that you can install
|
8
|
+
Edit Configuration: You can view the rwdtinker configuration and change it
|
9
|
+
Diagnostic Tab: You can view the environments variables that rwdtinker is running with
|
10
|
+
",
|
11
|
+
:network_help => "Using over a Network: To serve the application over your local LAN,change the last line in the
|
12
|
+
init.rb file to something like:\n
|
13
|
+
RwdTinker.file(RWDFile).serve(8080, '-r' ? '.rwduids' : nil)\n
|
14
|
+
Then you should be able to login at: http://yourhostname:8080",
|
15
|
+
|
16
|
+
|
17
|
+
:documents_rwdtinker => "Documents:
|
18
|
+
|
19
|
+
|
20
|
+
when you click on a document name, the document should pop up in a
|
21
|
+
browser window, or in another browser tab.",
|
22
|
+
:remote_control => "Remote control gives you a way to determine what applications are running on which ports
|
23
|
+
|
24
|
+
The name of the application is set in the config file
|
25
|
+
You need to click the show remote command choices first - this will show the port and query choices
|
26
|
+
Then you can click in 'Run Command' to see if other applications are running.
|
27
|
+
|
28
|
+
The remote ports daemon will not be running unless you start it.
|
29
|
+
|
30
|
+
"
|
31
|
+
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# this code is to call the help window
|
2
|
+
def runhelpwindow
|
3
|
+
$helptopicsarray = $helptopicsarray | ["applet_installation","applet_viewing","applet_tinkerbackeditconfiguration","remote_control"]
|
4
|
+
|
5
|
+
if @rwd_window == "main"
|
6
|
+
if @rwd_tab == "documentsrwdtinkerone"
|
7
|
+
$help_topic = "documents_rwdtinker"
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
|
+
if @rwd_window == "rwdtinkerhelpwindow"
|
13
|
+
puts "in help window processing"
|
14
|
+
else
|
15
|
+
$previouswindow = @rwd_window
|
16
|
+
$previoustab = @rwd_tab
|
17
|
+
end
|
18
|
+
|
19
|
+
|
20
|
+
@rwdhelptopic = $help_topic
|
21
|
+
@rwdhelpdataoutput = "#{Helptext[:"#{$help_topic}"]}"
|
22
|
+
@rwdhelpsubchoicesoutput = $helptopicsarray.rwd_method("choosenewhelptopic")
|
23
|
+
@rwd_window = "rwdtinkerhelpwindow"
|
24
|
+
end
|
25
|
+
|
26
|
+
def choosenewhelptopic(inffile)
|
27
|
+
$help_topic = inffile
|
28
|
+
runhelpwindow
|
29
|
+
end
|
30
|
+
|
31
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Application RwdTinker orginally (c) 2004 Steven Gibson under GPL.
|
2
|
+
# This application is a framework for writing programs from RubyWebDialogs
|
3
|
+
# http://www.erikveen.dds.nl/rubywebdialogs/index.html
|
4
|
+
# For more information about RwdTinker see http://www.rubyforge.net/projects/rwdapplications
|
5
|
+
|
6
|
+
# return the version constant defined in the config file
|
7
|
+
def runrwdtinkerversion
|
8
|
+
@rwd_window = "applicationversion"
|
9
|
+
@versionappnamedisplay = "RwdTinker"
|
10
|
+
@versioncopyrightdisplay = "(c) 2004 Steven Gibson "
|
11
|
+
@versionnumberdisplay = "Version " + RwdTinkerVersion
|
12
|
+
|
13
|
+
end
|
14
|
+
|
15
|
+
|
@@ -0,0 +1,62 @@
|
|
1
|
+
def uploadreturnsfile
|
2
|
+
require 'net/ftp'
|
3
|
+
BasicSocket.do_not_reverse_lookup = true
|
4
|
+
@returnsftpdisplays = ""
|
5
|
+
randomnumber = rand(9999) + 1000
|
6
|
+
puts randomnumber.to_i
|
7
|
+
|
8
|
+
|
9
|
+
returns_ftpsite = "ftp.superant.com"
|
10
|
+
returns_ftplogin = "anonymous@superant.com"
|
11
|
+
returns_ftppassword = "anonymous@superant.com"
|
12
|
+
returns_ftpdirectory = "/incoming/returns/"
|
13
|
+
|
14
|
+
begin
|
15
|
+
platformdisplay = "Platform is " + RUBY_PLATFORM + "\n"
|
16
|
+
platformdisplay = platformdisplay + "Ruby Version " + VERSION + "\n"
|
17
|
+
platformdisplay = platformdisplay + "rwdtinker version " + RwdTinkerVersion + "\n"
|
18
|
+
platformdisplay = platformdisplay + "application name " + $rwdapplicationidentity + "\n"
|
19
|
+
platformdisplay = platformdisplay + "program directory " + $progdir + "\n"
|
20
|
+
platformdisplay = platformdisplay + "hostname " + Resolv.getname(Resolv.getaddress("localhost")) + "\n"
|
21
|
+
platformdisplay = platformdisplay + "Date " + Date.today().to_s + "\n"
|
22
|
+
if ! @a_emailupload.empty?
|
23
|
+
platformdisplay = platformdisplay + @a_emailupload + "\n"
|
24
|
+
end
|
25
|
+
if ! @a_emailupload.empty?
|
26
|
+
platformdisplay = platformdisplay + @a_commentupload + "\n"
|
27
|
+
end
|
28
|
+
updatefile = Date.today().to_s + Resolv.getname(Resolv.getaddress("localhost")) + randomnumber.to_s
|
29
|
+
|
30
|
+
tmpdir = ENV['TMP']
|
31
|
+
if tmpdir.to_s.empty?
|
32
|
+
tmpdir = "/tmp"
|
33
|
+
end
|
34
|
+
fileName = File.join( tmpdir, updatefile)
|
35
|
+
fd = File.open(fileName,"w")
|
36
|
+
fd.print(platformdisplay) # save the record info to the file
|
37
|
+
fd.close
|
38
|
+
ftp = Net::FTP::new(returns_ftpsite)
|
39
|
+
@returnsftpdisplay = "data uploaded" + "\n"
|
40
|
+
|
41
|
+
filedirname = File.join(tmpdir,updatefile)
|
42
|
+
|
43
|
+
ftp.debug_mode = false
|
44
|
+
ftp.login(returns_ftplogin, returns_ftppassword)
|
45
|
+
ftp.chdir(returns_ftpdirectory)
|
46
|
+
print "I'm in the directory ", ftp.pwd(), "\n"
|
47
|
+
|
48
|
+
puts filedirname
|
49
|
+
ftp.puttextfile(filedirname , updatefile)
|
50
|
+
@returnsftpdisplay = @returnsftpdisplay + platformdisplay
|
51
|
+
|
52
|
+
|
53
|
+
ftp.close
|
54
|
+
|
55
|
+
rescue
|
56
|
+
@returnsftpdisplay = "upload error"
|
57
|
+
if ftp
|
58
|
+
ftp.close
|
59
|
+
end
|
60
|
+
print "ftp error"
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# this code is to change the note name
|
2
|
+
def changegutenbergdata
|
3
|
+
if ! @a_changegutenbergdata.empty?
|
4
|
+
if ! @a_viewgutenberg.empty?
|
5
|
+
oldName = @a_viewgutenberg + ".gut"
|
6
|
+
|
7
|
+
|
8
|
+
newName = @a_changehypernotedata + ".gut"
|
9
|
+
if File.exist?(oldName)
|
10
|
+
File.rename(oldName, newName)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# this code is to reproduce the note name
|
2
|
+
def copygutenbergfilename
|
3
|
+
|
4
|
+
|
5
|
+
if ! @a_viewgutenberg.empty?
|
6
|
+
|
7
|
+
sourcefile = $rwdgutenberg_directory + "/" + @a_viewgutenberg + ".gut"
|
8
|
+
begin
|
9
|
+
if File.exist?(sourcefile)
|
10
|
+
if ! @a_changegutenbergdata.empty?
|
11
|
+
distfile = $rwdgutenberg_directory + "/" + @a_changegutenbergdata + ".gut"
|
12
|
+
File.copy(sourcefile,distfile)
|
13
|
+
@gutenbergfilechangeresult = "#{@a_changegutenbergdata} Created"
|
14
|
+
else
|
15
|
+
@gutenbergfilechangeresult = "need distination filename"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
rescue
|
19
|
+
@gutenbergfilechangeresult = "Copy Error"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#
|
2
|
+
def rwdgutenbergcreatebookrecord
|
3
|
+
if @a_gutenbergdata.empty?
|
4
|
+
newnotecontent = 'new note'
|
5
|
+
else
|
6
|
+
newnotecontent = @a_gutenbergdata.to_s
|
7
|
+
end
|
8
|
+
if @a_viewgutenberg.empty?
|
9
|
+
newnotefilename = $rwdgutenberg_directory + "/" + "newnote.gut"
|
10
|
+
else
|
11
|
+
newnotefilename = $rwdgutenberg_directory + "/" + @a_viewgutenberg.to_s + ".gut"
|
12
|
+
end
|
13
|
+
begin # exception trapped block
|
14
|
+
|
15
|
+
fd = File.open(newnotefilename,"w")
|
16
|
+
fd.print( newnotecontent) # save the record info to the file
|
17
|
+
fd.close
|
18
|
+
|
19
|
+
rescue SystemCallError, StandardError
|
20
|
+
$stderr.print "system call error: " + $!
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# this method deletes a record
|
2
|
+
def deletegutenbergrecord
|
3
|
+
|
4
|
+
require 'fileutils'
|
5
|
+
if ! @a_viewgutenberg.empty?
|
6
|
+
fileName = $rwdgutenberg_directory + "/" + @a_viewgutenberg + ".gut"
|
7
|
+
|
8
|
+
begin # exception trapped block
|
9
|
+
if File.exist?(fileName)
|
10
|
+
File.delete(fileName)
|
11
|
+
|
12
|
+
end
|
13
|
+
|
14
|
+
#gutenbergrecordsresult = ""
|
15
|
+
|
16
|
+
@gutenbergfilechangeresult = "File Deleted!"
|
17
|
+
rescue
|
18
|
+
@gutenbergfilechangeresult = "File Deletion error"
|
19
|
+
end # exception rescue
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# create new gutenberg data file
|
2
|
+
def gutenbergcreatefile
|
3
|
+
|
4
|
+
filelocation = $rwdgutenberg_directory + "/" +@a_newgutenbergdata + ".gut"
|
5
|
+
p filelocation
|
6
|
+
fileB=File.open(filelocation,"w") #deletes and opens a the file in fileName
|
7
|
+
fileB.write(@a_newfilegutenberg) #writes the contents of doc into the file
|
8
|
+
fileB.close
|
9
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
Helptext.update( :rwdgutenberg_generalhelp => "This program is a text file reader
|
4
|
+
|
5
|
+
links to a text file can be saved in the Books directory
|
6
|
+
|
7
|
+
There are tabs to enter notes and links and edit configurations
|
8
|
+
|
9
|
+
'View/Edit Booklist' - to create or edit a file
|
10
|
+
|
11
|
+
'Booklist Utilities' - to rename or delete files
|
12
|
+
|
13
|
+
'Edit Configuration' - to change the configuration of rwdgutenberg
|
14
|
+
|
15
|
+
.",
|
16
|
+
:gutenbergedit_help => "You can create or edit booklists
|
17
|
+
click the bottom button 'list Booklists' to see a lists
|
18
|
+
of the notes you already have.
|
19
|
+
'save changes' to save your edits
|
20
|
+
'clear' to clear the screen
|
21
|
+
'Create New List' to start a new booklist
|
22
|
+
After creating a new note, you must list below to find it
|
23
|
+
and select it, or it will NOT be SAVED",
|
24
|
+
:gutenbergutility_help => "You can change the file
|
25
|
+
rename
|
26
|
+
delete
|
27
|
+
copy name
|
28
|
+
",
|
29
|
+
|
30
|
+
|
31
|
+
|
32
|
+
:rwdgutenberg_configuration => " click on 'Edit Configuration'
|
33
|
+
You can view the configuration file
|
34
|
+
|
35
|
+
You can edit the configuration
|
36
|
+
|
37
|
+
Remember to reload the configuration variables if you want your
|
38
|
+
changes used.
|
39
|
+
"
|
40
|
+
|
41
|
+
)
|