rwdgutenberg 0.07 → 0.08
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Books/Mariposa.gut +0 -0
- data/Books/Shannon.gut +0 -0
- data/Books/marip10.txt +0 -0
- data/Readme.txt +3 -0
- data/bin/rwdgutenberg +0 -0
- data/code/01rwdcore/01rwdcore.rb +0 -0
- data/code/01rwdcore/02helptexthashbegin.rb +0 -0
- data/code/01rwdcore/03helptexthash.rb +20 -20
- data/code/01rwdcore/04helptextend.rb +0 -0
- data/code/01rwdcore/jumplinkcommand.rb +0 -0
- data/code/01rwdcore/openhelpwindow.rb +0 -0
- data/code/01rwdcore/returntomain.rb +0 -0
- data/code/01rwdcore/rundocuments.rb +0 -0
- data/code/01rwdcore/runeditconfiguration.rb +0 -0
- data/code/01rwdcore/runhelpabout.rb +0 -0
- data/code/01rwdcore/runopentinkerdocument.rb +0 -0
- data/code/01rwdcore/rwdtinkerversion.rb +0 -0
- data/code/01rwdcore/rwdwindowreturn.rb +0 -0
- data/code/01rwdcore/selectiontab.rb +0 -0
- data/code/01rwdcore/setuphelpaboutoptions.rb +0 -0
- data/code/01rwdcore/setuptinkerdocuments.rb +0 -0
- data/code/01rwdcore/test_cases.rb +0 -0
- data/code/01rwdcore/test_harness.rb +0 -0
- data/code/01rwdcore/uploadreturns.rb +0 -0
- data/code/dd0viewphoto/dd0viewphoto.rb +3 -0
- data/code/superant.com.gutenberg/changegutenbergname.rb +0 -0
- data/code/superant.com.gutenberg/clearbookscreendisplay.rb +0 -0
- data/code/superant.com.gutenberg/cleargutenbergfiles.rb +0 -0
- data/code/superant.com.gutenberg/cleargutrecordfiles.rb +0 -0
- data/code/superant.com.gutenberg/copyfilename.rb +0 -0
- data/code/superant.com.gutenberg/deletegutenbergrecord.rb +0 -0
- data/code/superant.com.gutenberg/gutenbergcreatefile.rb +0 -0
- data/code/superant.com.gutenberg/helptexthashrwdgutenberg.rb +0 -0
- data/code/superant.com.gutenberg/jumplinkupdate.rb +0 -0
- data/code/superant.com.gutenberg/listnamerecord.rb +0 -0
- data/code/superant.com.gutenberg/listtextfilesgutenberg.rb +0 -0
- data/code/superant.com.gutenberg/loadbookrecord.rb +0 -0
- data/code/superant.com.gutenberg/loadconfigurationrecord.rb +0 -0
- data/code/superant.com.gutenberg/loadconfigurationvariables.rb +0 -0
- data/code/superant.com.gutenberg/openhelpwindowgutenberg.rb +0 -0
- data/code/superant.com.gutenberg/returntomain.rb +0 -0
- data/code/superant.com.gutenberg/runbackwindow.rb +0 -0
- data/code/superant.com.gutenberg/rungutenbergwindow.rb +0 -0
- data/code/superant.com.gutenberg/rwdgutenbergbackward.rb +0 -0
- data/code/superant.com.gutenberg/rwdhypernotehelpabout.rb +0 -0
- data/code/superant.com.gutenberg/rwdtinkerversion.rb +0 -0
- data/code/superant.com.gutenberg/saveconfigurationrecord.rb +0 -0
- data/code/superant.com.gutenberg/savegutenbergrecord.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/helptexthashtinkerwin2.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/installapplet.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/installgemapplet.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/installremotegem.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/listgemdirs.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/listgemzips.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/listinstalledfiles.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/listzips.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationrecord.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/loadconfigurationvariables.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/network.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/openappletname.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/openhelpwindowtinkerwin2.rb +1 -5
- data/code/superant.com.rwdtinkerbackwindow/remotegemlist.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/removeapplet.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/runremoteinstall.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/runrwdtinkerbackwindow.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/rwdtinkerwin2version.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/saveconfigurationrecord.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/viewappletcontents.rb +0 -0
- data/code/superant.com.rwdtinkerbackwindow/viewgemappletcontents.rb +0 -0
- data/code/zz0applicationend/zz0end.rb +0 -0
- data/configuration/language.dist +2 -1
- data/configuration/rwdapplicationidentity.dist +1 -1
- data/configuration/rwdgutenberg.dist +3 -3
- data/configuration/rwdtinker.dist +3 -3
- data/configuration/tinkerwin2variables.dist +3 -3
- data/ev/browser.rb +24 -10
- data/ev/ftools.rb +23 -19
- data/ev/mime.rb +328 -0
- data/ev/net.rb +154 -38
- data/ev/ruby.rb +96 -26
- data/ev/rwd.rb +162 -89
- data/ev/sgml.rb +1 -1
- data/ev/thread.rb +0 -0
- data/ev/tree.rb +33 -5
- data/ev/xml.rb +97 -0
- data/extras/rconftool.rb +0 -0
- data/extras/zip/ioextras.rb +0 -0
- data/extras/zip/stdrubyext.rb +0 -0
- data/extras/zip/tempfile_bugfixed.rb +0 -0
- data/extras/zip/zip.rb +0 -0
- data/extras/zip/zipfilesystem.rb +0 -0
- data/extras/zip/ziprequire.rb +0 -0
- data/gui/00coreguibegin/applicationguitop.rwd +1 -1
- data/gui/frontwindow0/superant.com.gutenberg/10viewnote.rwd +0 -0
- data/gui/frontwindow0/superant.com.gutenberg/20listfiles.rwd +0 -0
- data/gui/frontwindow0/superant.com.gutenberg/30booklistutilities.rwd +0 -0
- data/gui/frontwindow0/superant.com.gutenberg/35displaytab.rwd +0 -0
- data/gui/frontwindow0/superant.com.gutenberg/36displaytab.rwd +0 -0
- data/gui/frontwindow0/superant.com.gutenberg/40rwdgutenberg.rwd +0 -0
- data/gui/frontwindow0/superant.com.gutenberg/40rwdgutenberghtml.rwd +0 -0
- data/gui/frontwindow0/superant.com.gutenberg/67viewconfiguration.rwd +0 -0
- data/gui/frontwindowselectionbegin/selectiontabbegin/00selectiontabbegin.rwd +1 -1
- data/gui/frontwindowselections/superant.com.rwdtinkerwin2selectiontab/jumplinkcommands.rwd +2 -2
- data/gui/frontwindowselectionzend/viewselectionzend/wwselectionend.rwd +0 -0
- data/gui/frontwindowselectionzend/viewselectionzend/zzdocumentbegin.rwd +0 -0
- data/gui/frontwindowtdocuments/superant.com.documents/tinkerdocuments.rwd +2 -2
- data/gui/helpaboutbegin/superant.com.helpaboutbegin/zzdocumentend.rwd +1 -1
- data/gui/helpaboutbegin/superant.com.helpaboutbegin/zzzrwdlasttab.rwd +0 -0
- data/gui/helpaboutbegin/superant.com.helpaboutbegin/zzzzhelpscreenstart.rwd +1 -1
- data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/helpabouttab.rwd +2 -2
- data/gui/helpaboutzend/superant.com.helpaboutend/helpscreenend.rwd +0 -0
- data/gui/helpaboutzend/superant.com.helpaboutend/zhelpscreenstart2.rwd +1 -1
- data/gui/helpaboutzend/superant.com.helpaboutend/zzzzhelpabout2.rwd +2 -2
- data/gui/helpaboutzend/superant.com.helpaboutend/zzzzhelpscreen2end.rwd +0 -0
- data/gui/tinkerbackwindows/superant.com.gutenberg/10viewnote.rwd +0 -0
- data/gui/tinkerbackwindows/superant.com.gutenberg/20listfiles.rwd +0 -0
- data/gui/tinkerbackwindows/superant.com.gutenberg/30booklistutilities.rwd +0 -0
- data/gui/tinkerbackwindows/superant.com.gutenberg/35displaytab.rwd +0 -0
- data/gui/tinkerbackwindows/superant.com.gutenberg/36displaytab.rwd +0 -0
- data/gui/tinkerbackwindows/superant.com.gutenberg/40rwdgutenberg.rwd +0 -0
- data/gui/tinkerbackwindows/superant.com.gutenberg/40rwdgutenberghtml.rwd +0 -0
- data/gui/tinkerbackwindows/superant.com.gutenberg/67viewconfiguration.rwd +0 -0
- data/gui/tinkerbackwindows/superant.com.gutendisplay/gutendisplayhtmlwindow.rwd +0 -0
- data/gui/tinkerbackwindows/superant.com.gutendisplay/gutendisplaywindow.rwd +0 -0
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/1appname.rwd +1 -1
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/40rwdlistzips.rwd +9 -10
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/45installremotezip.rwd +5 -5
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/50rwdlistapplets.rwd +9 -9
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/60editconfiguration.rwd +2 -2
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/70rwddiagnostics.rwd +1 -1
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/81jumplinkcommands.rwd +3 -3
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/9backend.rwd +0 -0
- data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/1appname.rwd +1 -1
- data/gui/tinkerbackwindows/superant.com.tinkerhelpwindow/9end.rwd +0 -0
- data/gui/tinkerbackwindows/superant.com.versionwindow/1appname.rwd +2 -2
- data/gui/tinkerbackwindows/superant.com.versionwindow/helpaboutwindow.rwd +3 -3
- data/gui/zzcoreguiend/tinkerapplicationguiend/yy9rwdend.rwd +0 -0
- data/init.rb +0 -0
- data/installed/gutenbergdata02.inf +5 -0
- data/installed/rwdwgutenberg-0.06.inf +7 -0
- data/lang/en/rwdcore/languagefile.rb +63 -15
- data/lang/es/rwdcore/languagefile-es.rb +67 -13
- data/lang/fr/rwdcore/languagefile.rb +64 -0
- data/lang/jp/rwdcore/languagefile.rb +69 -6
- data/lang/nl/rwdcore/languagefile.rb +62 -0
- data/lib/temp.rb +0 -0
- data/rwd_files/HowTo_Gutenberg.txt +0 -6
- data/rwd_files/HowTo_Tinker.txt +6 -0
- data/rwd_files/HowTo_TinkerWin2.txt +0 -0
- data/rwd_files/Readme.txt +0 -0
- data/rwd_files/RubyWebDialogs.html +0 -0
- data/rwd_files/favicon.ico +0 -0
- data/rwd_files/rdoc-style.css +0 -0
- data/rwd_files/rwdapplications.html +0 -0
- data/rwd_files/tinker.png +0 -0
- data/rwdconfig.dist +1 -1
- data/tests/checkdepends.sh +0 -0
- data/tests/cleancnf.sh +0 -0
- data/tests/makedist.rb +1 -1
- data/tests/rdep.rb +0 -0
- data/tests/totranslate.lang +0 -0
- data/zips/temp.rb +1 -0
- metadata +221 -204
- data/code/superant.com.rwdtinkerbackwindow/controlclient.rb +0 -96
- data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/75rwdcontrol.rwd +0 -33
- data/installed/rwdviewlogo-0.4.inf +0 -4
data/Books/Mariposa.gut
CHANGED
|
File without changes
|
data/Books/Shannon.gut
CHANGED
|
File without changes
|
data/Books/marip10.txt
CHANGED
|
File without changes
|
data/Readme.txt
CHANGED
data/bin/rwdgutenberg
CHANGED
|
File without changes
|
data/code/01rwdcore/01rwdcore.rb
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
# Help files for RwdTinker core
|
|
2
2
|
|
|
3
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
|
|
4
|
+
:general_help => "You can work with Applets: go to 'Selection tab', <br>
|
|
5
|
+
On that back screen you will find:<br>
|
|
6
|
+
List Applets: you can see and delete installed applets<br>
|
|
7
|
+
List Zips: you can see lists of applets that you can install<br>
|
|
8
|
+
Edit Configuration: You can view the rwdtinker configuration and change it<br>
|
|
9
|
+
Diagnostic Tab: You can view the environments variables that rwdtinker is running with<br>
|
|
10
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
|
|
11
|
+
:network_help => "Using over a Network: To serve the application over your local LAN,change the last line in the<br>
|
|
12
|
+
init.rb file to something like:\n<br>
|
|
13
|
+
RwdTinker.file(RWDFile).serve(8080, '-r' ? '.rwduids' : nil)\n<br>
|
|
14
14
|
Then you should be able to login at: http://yourhostname:8080",
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
:documents_rwdtinker => "Documents:
|
|
17
|
+
:documents_rwdtinker => "<b>Documents:
|
|
18
|
+
<p>
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
when you click on a document name, the document should pop up in a <br>
|
|
21
|
+
browser window, or in another browser tab.</b>",
|
|
22
|
+
:remote_control => "<b>Remote control gives you a way to determine what applications are running on which ports
|
|
23
|
+
<p>
|
|
24
|
+
The name of the application is set in the config file<br>
|
|
25
|
+
You need to click the show remote command choices first - this will show the port and query choices<br>
|
|
26
|
+
Then you can click in 'Run Command' to see if other applications are running.<br>
|
|
27
|
+
<p>
|
|
28
28
|
The remote ports daemon will not be running unless you start it.
|
|
29
|
-
|
|
29
|
+
</b>
|
|
30
30
|
"
|
|
31
31
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -18,11 +18,7 @@ def runhelpwindowtinkerwin2
|
|
|
18
18
|
end
|
|
19
19
|
if @rwd_tab == "editconfigurationfile"
|
|
20
20
|
$help_topic = "applet_tinkerbackeditconfiguration"
|
|
21
|
-
|
|
22
|
-
end
|
|
23
|
-
if @rwd_tab == "rwdremotecontrol"
|
|
24
|
-
$help_topic = "remote_control"
|
|
25
|
-
|
|
21
|
+
|
|
26
22
|
end
|
|
27
23
|
if @rwd_tab == "superantcomremotezipsinstall"
|
|
28
24
|
$help_topic = "remotegemapplet_install"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/configuration/language.dist
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
##VERSION:0.
|
|
1
|
+
##VERSION:0.08
|
|
2
2
|
##NAME:$rwdgutenberg_directory:0
|
|
3
3
|
$rwdgutenberg_directory = "Books"
|
|
4
4
|
##NAME:$gutenbergcommand:0
|
|
@@ -6,11 +6,11 @@ $gutenbergcommand = "openbook"
|
|
|
6
6
|
##NAME:$booklocation:0
|
|
7
7
|
$booklocation = 0
|
|
8
8
|
##NAME:$booksteps:0
|
|
9
|
-
$booksteps =
|
|
9
|
+
$booksteps = 12
|
|
10
10
|
##NAME:BookViewDisplay:0
|
|
11
11
|
BookViewDisplay = 15
|
|
12
12
|
$tinkerdocumentsarray += ["HowTo_Gutenberg.txt"]
|
|
13
13
|
$tinkerhelpaboutarray += ["RwdGutenberg"]
|
|
14
14
|
##NAME:RwdGutenbergVersion:0
|
|
15
|
-
RwdGutenbergVersion = "0.
|
|
15
|
+
RwdGutenbergVersion = "0.08"
|
|
16
16
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
##VERSION:1.
|
|
1
|
+
##VERSION:1.69
|
|
2
2
|
ConfigurationDir = "configuration" # for use in program - init.rb has this value without using this constant
|
|
3
3
|
CodeName = "rwdtinker"
|
|
4
4
|
CodeNameFile = CodeName + ".rb"
|
|
@@ -13,7 +13,7 @@ LangDir = "lang"
|
|
|
13
13
|
$port = 7705
|
|
14
14
|
$rwdjumplink = ["helpscreen","tinkerbackwindow","returntomain","opendocuments","editconfiguration"]
|
|
15
15
|
Browser_Exe = 'mozilla '
|
|
16
|
-
$tinkerdocumentsarray +=["
|
|
17
|
-
RwdTinkerVersion = "1.
|
|
16
|
+
$tinkerdocumentsarray +=["HowTo_Tinker.txt","rwdapplications.html","RubyWebDialogs.html"]
|
|
17
|
+
RwdTinkerVersion = "1.69"
|
|
18
18
|
|
|
19
19
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
##VERSION:1.
|
|
1
|
+
##VERSION:1.69
|
|
2
2
|
TinkerWin2ConfigurationFileName = "tinkerwin2variables.cnf" # this file name - do not change
|
|
3
3
|
##NAME:$zipslocation:0
|
|
4
4
|
$zipslocation = "zips" # location of applets to add
|
|
@@ -7,11 +7,11 @@ $zipslocation = "zips" # location of applets to add
|
|
|
7
7
|
$xpcommand = " " # Linux machines
|
|
8
8
|
# $xpcommand = "cmd /C " # XP machines with cmd shell
|
|
9
9
|
##NAME:$gemdirectory_withgemfiles:0
|
|
10
|
-
$gemdirectory_withgemfiles = "/
|
|
10
|
+
$gemdirectory_withgemfiles = "/var/lib/gems/1.8/gems"
|
|
11
11
|
# $gemdirectory_withgemfiles = "c:\\ruby\\lib\\ruby\\gems\\1.8\\gems" # XP machine
|
|
12
12
|
##NAME:$geminstalled_directory:0
|
|
13
13
|
# $geminstalled_directory = "/ruby/lib/ruby/gems/1.8/gems" # XP machine
|
|
14
|
-
$geminstalled_directory = "/
|
|
14
|
+
$geminstalled_directory = "/var/lib/gems/1.8/gems" # Debian Linux
|
|
15
15
|
|
|
16
16
|
RwdTinkerWin2Version = "0.8"
|
|
17
17
|
|
data/ev/browser.rb
CHANGED
|
@@ -16,20 +16,33 @@ def windowsbrowser
|
|
|
16
16
|
application = nil
|
|
17
17
|
|
|
18
18
|
begin
|
|
19
|
-
Win32::Registry::HKEY_CLASSES_ROOT.open(
|
|
19
|
+
Win32::Registry::HKEY_CLASSES_ROOT.open(".html") do |reg|
|
|
20
20
|
filetype = reg[""]
|
|
21
21
|
end
|
|
22
22
|
|
|
23
|
-
Win32::Registry::HKEY_CLASSES_ROOT.open(filetype +
|
|
23
|
+
Win32::Registry::HKEY_CLASSES_ROOT.open(filetype + "\\shell\\open\\command") do |reg|
|
|
24
24
|
application = reg[""]
|
|
25
25
|
end
|
|
26
26
|
rescue NameError
|
|
27
|
-
$stderr.puts "Only available for Windows."
|
|
27
|
+
$stderr.puts "Only available for Windows and Cygwin."
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
application
|
|
31
31
|
end
|
|
32
32
|
|
|
33
|
+
def cygwinbrowser
|
|
34
|
+
browser, *args = windowsbrowser.splitwords
|
|
35
|
+
browser = browser.gsub(/\\/, "/")
|
|
36
|
+
#browser = browser
|
|
37
|
+
|
|
38
|
+
args.collect!{|a| a.gsub(/\\/, "/")}
|
|
39
|
+
#args.collect!{|a| "\"%s\"" % [a.gsub(/\\/, "/")]}
|
|
40
|
+
#args.collect!{|a| "\"%s\"" % [a]}
|
|
41
|
+
|
|
42
|
+
res = "\"%s\" %s" % [browser, args.join(" ")]
|
|
43
|
+
res
|
|
44
|
+
end
|
|
45
|
+
|
|
33
46
|
def linuxbrowser
|
|
34
47
|
application = ""
|
|
35
48
|
|
|
@@ -47,25 +60,26 @@ end
|
|
|
47
60
|
def defaultbrowser
|
|
48
61
|
res = nil
|
|
49
62
|
res = windowsbrowser if windows?
|
|
63
|
+
res = cygwinbrowser if cygwin?
|
|
50
64
|
res = linuxbrowser if linux?
|
|
51
65
|
res
|
|
52
66
|
end
|
|
53
67
|
|
|
68
|
+
def showurlinbrowser(url, browser=defaultbrowser)
|
|
69
|
+
command = "#{browser} \"#{url}\""
|
|
70
|
+
|
|
71
|
+
system(command) or $stderr.puts "Starting of the browser failed, or the browser terminated abnormally.\nCommand => #{command}"
|
|
72
|
+
end
|
|
73
|
+
|
|
54
74
|
def showinbrowser(html, browser=defaultbrowser)
|
|
55
75
|
port, io = TCPServer.freeport(7701, 7709)
|
|
56
76
|
|
|
57
77
|
unless browser.nil?
|
|
58
78
|
Thread.new do
|
|
59
79
|
begin
|
|
60
|
-
#command = "1234 \"http://localhost:#{port}\"" if linux?
|
|
61
|
-
#command = "L:/prog/MozillaFirefox/firefox.exe \"http://localhost:#{port}\"" if cygwin?
|
|
62
|
-
#command = Win32::Registry::HKEY_CLASSES_ROOT.open('htmlfile\shell\open\command')[0] + " \"http://localhost:#{port}/\"" if windows?
|
|
63
|
-
|
|
64
|
-
command = "#{browser} \"http://localhost:#{port}\""
|
|
65
|
-
|
|
66
80
|
Thread.pass
|
|
67
81
|
|
|
68
|
-
|
|
82
|
+
showurlinbrowser("http://localhost:#{port}/", browser)
|
|
69
83
|
rescue
|
|
70
84
|
end
|
|
71
85
|
end
|
data/ev/ftools.rb
CHANGED
|
@@ -1,22 +1,12 @@
|
|
|
1
1
|
require "ftools"
|
|
2
2
|
|
|
3
3
|
class Dir
|
|
4
|
-
def self.mkdirrec(dir)
|
|
5
|
-
pdir = File.dirname(dir)
|
|
6
|
-
|
|
7
|
-
if not pdir.empty? and not File.directory?(pdir)
|
|
8
|
-
Dir.mkdirrec(pdir)
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
Dir.mkdir(dir) rescue nil
|
|
12
|
-
end
|
|
13
|
-
|
|
14
4
|
def self.copy(from, to)
|
|
15
5
|
if File.directory?(from)
|
|
16
6
|
pdir = Dir.pwd
|
|
17
7
|
todir = File.expand_path(to)
|
|
18
8
|
|
|
19
|
-
|
|
9
|
+
File.mkpath(todir)
|
|
20
10
|
|
|
21
11
|
Dir.chdir(from)
|
|
22
12
|
Dir.new(".").each do |e|
|
|
@@ -26,7 +16,7 @@ class Dir
|
|
|
26
16
|
else
|
|
27
17
|
todir = File.dirname(File.expand_path(to))
|
|
28
18
|
|
|
29
|
-
|
|
19
|
+
File.mkpath(todir)
|
|
30
20
|
|
|
31
21
|
File.copy(from, to)
|
|
32
22
|
end
|
|
@@ -38,6 +28,8 @@ class Dir
|
|
|
38
28
|
end
|
|
39
29
|
|
|
40
30
|
def self.rm_rf(entry)
|
|
31
|
+
File.chmod(0755, entry)
|
|
32
|
+
|
|
41
33
|
if File.ftype(entry) == "directory"
|
|
42
34
|
pdir = Dir.pwd
|
|
43
35
|
|
|
@@ -47,16 +39,24 @@ class Dir
|
|
|
47
39
|
end
|
|
48
40
|
Dir.chdir(pdir)
|
|
49
41
|
|
|
50
|
-
|
|
42
|
+
begin
|
|
43
|
+
Dir.delete(entry)
|
|
44
|
+
rescue => e
|
|
45
|
+
$stderr.puts e.message
|
|
46
|
+
end
|
|
51
47
|
else
|
|
52
|
-
|
|
48
|
+
begin
|
|
49
|
+
File.delete(entry)
|
|
50
|
+
rescue => e
|
|
51
|
+
$stderr.puts e.message
|
|
52
|
+
end
|
|
53
53
|
end
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def self.find(entry=nil, mask=nil)
|
|
57
57
|
entry = "." if entry.nil?
|
|
58
58
|
|
|
59
|
-
entry = entry.gsub
|
|
59
|
+
entry = entry.gsub(/[\/\\]*$/, "") unless entry.nil?
|
|
60
60
|
|
|
61
61
|
mask = /^#{mask}$/i if mask.kind_of?(String)
|
|
62
62
|
|
|
@@ -77,8 +77,8 @@ class Dir
|
|
|
77
77
|
ensure
|
|
78
78
|
Dir.chdir(pdir)
|
|
79
79
|
end
|
|
80
|
-
rescue Errno::EACCES =>
|
|
81
|
-
puts
|
|
80
|
+
rescue Errno::EACCES => e
|
|
81
|
+
$stderr.puts e.message
|
|
82
82
|
end
|
|
83
83
|
else
|
|
84
84
|
res += [entry] if mask.nil? or entry =~ mask
|
|
@@ -99,7 +99,7 @@ class File
|
|
|
99
99
|
# Rollback
|
|
100
100
|
|
|
101
101
|
if File.file?(backupfile) and File.file?(controlfile)
|
|
102
|
-
$
|
|
102
|
+
$stderr.puts "Restoring #{file}..."
|
|
103
103
|
|
|
104
104
|
File.copy(backupfile, file) # Rollback from phase 3
|
|
105
105
|
end
|
|
@@ -139,7 +139,11 @@ class File
|
|
|
139
139
|
end
|
|
140
140
|
|
|
141
141
|
def self.touch(file)
|
|
142
|
-
File.
|
|
142
|
+
if File.exists?(file)
|
|
143
|
+
File.utime(Time.now, File.mtime(file), file)
|
|
144
|
+
else
|
|
145
|
+
File.open(file, "a"){|f|}
|
|
146
|
+
end
|
|
143
147
|
end
|
|
144
148
|
|
|
145
149
|
def self.which(file)
|