rwdaddresses 0.98 → 0.99

Sign up to get free protection for your applications and to get access to all the features.
data/Readme.txt CHANGED
@@ -147,6 +147,10 @@ erik = secret
147
147
  Thanks, Steven Gibson
148
148
 
149
149
  == Changelog
150
+ version 0.99
151
+ added rconftool use to update configuration files
152
+ changed applets removal to not use external rm
153
+
150
154
  version 0.98
151
155
  updated for rwdtinker 1.56
152
156
  first debian version
@@ -21,7 +21,15 @@
21
21
  @a_adconfigline6 = fd.readline.chomp
22
22
  @a_adconfigline7 =fd.readline.chomp
23
23
  @a_adconfigline8 = fd.readline.chomp
24
- @a_adconfigline9 = fd.readline.chomp
24
+ @a_adconfigline9 = fd.readline.chomp
25
+ @a_adconfigline10 = fd.readline.chomp
26
+ @a_adconfigline11 = fd.readline.chomp
27
+ @a_adconfigline12 = fd.readline.chomp
28
+ @a_adconfigline13 = fd.readline.chomp
29
+ @a_adconfigline14 = fd.readline.chomp
30
+ @a_adconfigline15 = fd.readline.chomp
31
+ @a_adconfigline16 = fd.readline.chomp
32
+ @a_adconfigline17 = fd.readline.chomp
25
33
 
26
34
  while ! fd.eof?
27
35
  @extraadconfigdatadisplay = fd.readline
@@ -2,7 +2,7 @@
2
2
  require 'fileutils'
3
3
  nametext = "%s" % [@a_removeapplet]
4
4
 
5
- begin # exception trapped block
5
+ # begin # exception trapped block
6
6
  fileName = "installed/" + nametext + ".inf"
7
7
  count = 0
8
8
  fd = File.open(fileName,"r")
@@ -10,19 +10,21 @@
10
10
 
11
11
  fd.each { |oneline|
12
12
  if count == 1
13
- commandline = "rm -r " + oneline
14
- system( commandline+' > temp.output' )
13
+ puts oneline
14
+ FileUtils.rm_rf( oneline.chop)
15
+
15
16
  end
16
17
  count = 1
17
18
  }
18
19
  fd.close
19
- commandline = "rm " + fileName
20
+ puts fileName
21
+ FileUtils.rm_rf( fileName)
22
+
20
23
 
21
- system(commandline)
22
24
  @removeapplettext = "applet files removed! - restart rwd to finish uninstalling"
23
25
 
24
- rescue
25
- @removeapplettext = "\n" + "error"
26
- end # exception rescue
26
+ # rescue
27
+ # @removeapplettext = "\n" + "error"
28
+ # end # exception rescue
27
29
 
28
30
  end
@@ -0,0 +1,7 @@
1
+ ##VERSION:1.57
2
+ #language selection file
3
+ ##NAME:$lang:0
4
+ #$lang = "jp"
5
+ $lang= "en"
6
+ #$lang= "nl"
7
+ #$lang= "es"
@@ -0,0 +1,19 @@
1
+ ##VERSION:0.99
2
+ #rwdaddresses contact book
3
+ $photodelay = 1
4
+ ##NAME:$addressfiles_directory:0
5
+ $addressfiles_directory="names"
6
+ ##NAME:$tmpphoto_directory:0
7
+ $tmpphoto_directory = "/tmp"
8
+ ##NAME:$rwdaddresses_ftpsite:0
9
+ $rwdaddresses_ftpsite = "ftp.mysite.com"
10
+ ##NAME:$rwdaddresses_ftplogin:0
11
+ $rwdaddresses_ftplogin = "mylogin"
12
+ ##NAME:$rwdaddresses_ftppassword:0
13
+ $rwdaddresses_ftppassword = "mypassword"
14
+ ##NAME:$rwdaddresses_ftpdirectory:0
15
+ $rwdaddresses_ftpdirectory = "/incoming/rwdnames/"
16
+ ##NAME:$rwdaddresses_updatedirectory:0
17
+ $rwdaddresses_updatedirectory = "updates"
18
+
19
+ RwdAddressesVersion = "0.99"
@@ -0,0 +1,3 @@
1
+ ##VERSION:1.57
2
+ $rwdapplicationidentity = "rwdtinker main application"
3
+
@@ -1,4 +1,4 @@
1
-
1
+ ##VERSION:1.57
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"
@@ -11,3 +11,5 @@ LangDir = "lang"
11
11
  $prevouswindow ="main"
12
12
  $rwdcontrolports =["13713","13714","13715","13716","13717","13718"]
13
13
  $port = 7705
14
+
15
+ RwdTinkerVersion = "1.57"
@@ -1,12 +1,17 @@
1
-
1
+ ##VERSION:1.57
2
2
  TinkerWin2ConfigurationFileName = "tinkerwin2variables.cnf" # this file name - do not change
3
+ ##NAME:$zipslocation:0
3
4
  $zipslocation = "zips" # location of applets to add
4
5
  $zipsarray = [""] ; $zipsarraylocal = [""]
6
+ ##NAME:$xpcommand:0
5
7
  $xpcommand = " " # Linux machines
6
8
  # $xpcommand = "cmd /C " # XP machines with cmd shell
9
+ ##NAME:$gemdirectory_withgemfiles:0
7
10
  $gemdirectory_withgemfiles = "/usr/lib/ruby/gems/1.8/gems"
8
11
  # $gemdirectory_withgemfiles = "c:\\ruby\\lib\\ruby\\gems\\1.8\\gems" # XP machine
12
+ ##NAME:$geminstalled_directory:0
9
13
  # $geminstalled_directory = "/ruby/lib/ruby/gems/1.8/gems" # XP machine
10
14
  $geminstalled_directory = "/usr/lib/ruby/gems/1.8/gems" # Debian Linux
11
15
 
16
+ RwdTinkerWin2Version = "0.8"
12
17
 
@@ -0,0 +1,380 @@
1
+ #!/usr/local/bin/ruby -w
2
+
3
+ # Copyright (c) 2005 Brian Candler
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to
7
+ # deal in the Software without restriction, including without limitation the
8
+ # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9
+ # sell copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in
13
+ # all copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
+ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21
+ # IN THE SOFTWARE.
22
+
23
+ ##########################################################################
24
+ # rconftool is a reimplementation of Sam Varshavchik's sysconftool in Ruby.
25
+ # See http://www.courier-mta.org/sysconftool/ for details of the original.
26
+ # Its purpose is to keep configuration files "fresh" when upgrading an
27
+ # application from one version to another, ensuring that all necessary
28
+ # settings are present and obsolete ones removed.
29
+ #
30
+ # rconftool can be called as a library function or from the command line. It
31
+ # can also install groups of files recursively from one directory tree into
32
+ # another.
33
+ ##########################################################################
34
+
35
+ require 'fileutils'
36
+
37
+ module Rconftool
38
+ VERSION = "0.1"
39
+ class NoVersionLine < RuntimeError; end
40
+
41
+ # This module function installs a single source (.dist) file to a target
42
+ # location, having first merged in any compatible settings from the
43
+ # target file if it existed previously [if it does not exist, any settings
44
+ # from 'oldfile' are used instead]
45
+ #
46
+ # If the distfile is not in sysconftool format (i.e. doesn't have a
47
+ # ##VERSION: header within the first 20 lines), then for safety it is only
48
+ # installed if the target file does not already exist. No attempt at data
49
+ # merging is made in that case.
50
+
51
+ def self.install(distfile, targetfile=nil, oldfile=nil, opt={})
52
+ debug = opt[:debug] || $stdout
53
+
54
+ targetfile ||= distfile
55
+ if opt[:strip_regexp]
56
+ targetfile = targetfile.sub(opt[:strip_regexp], '')
57
+ oldfile = oldfile.sub(opt[:strip_regexp], '') if oldfile
58
+ end
59
+ if opt[:add_suffix]
60
+ targetfile = targetfile + opt[:add_suffix]
61
+ oldfile = oldfile + opt[:add_suffix] if oldfile
62
+ end
63
+ raise Errno::EEXIST, "#{distfile}: dist and target filenames are the same" if distfile == targetfile
64
+
65
+ # Read in the source (.dist) file
66
+ begin
67
+ src = ConfigFile.new(distfile)
68
+ rescue NoVersionLine
69
+ # Fallback behaviour when installing a file which is not in sysconftool
70
+ # format: we install the file only if it doesn't already exist
71
+ if File.exist?(targetfile)
72
+ debug << "#{targetfile}: already exists, skipping\n"
73
+ return
74
+ end
75
+ return if opt[:noclobber]
76
+ copyfrom = (oldfile and File.exist?(oldfile)) ? oldfile : distfile
77
+ if File.symlink?(copyfrom)
78
+ File.symlink(File.readlink(copyfrom), targetfile)
79
+ debug << "#{targetfile}: symlink copied from #{copyfrom}\n"
80
+ else
81
+ FileUtils.cp copyfrom, targetfile, :preserve=>true
82
+ debug << "#{targetfile}: copied from #{copyfrom}\n"
83
+ end
84
+ return
85
+ end
86
+
87
+ # OK, so we have a sysconftool file to install. Read in the existing
88
+ # target file, or if that does not exist, the oldfile
89
+ begin
90
+ old = ConfigFile.new
91
+ old.read(targetfile)
92
+ rescue NoVersionLine
93
+ # That's OK; the old target will be renamed to .bak
94
+ rescue Errno::ENOENT
95
+ begin
96
+ target_missing = true
97
+ old.read(oldfile) if oldfile
98
+ rescue Errno::ENOENT, NoVersionLine
99
+ end
100
+ end
101
+
102
+ # Same VERSION? No merge is required
103
+ if src.version == old.version and not opt[:force]
104
+ if target_missing
105
+ FileUtils.cp oldfile, targetfile, :preserve=>true
106
+ debug << "#{targetfile}: same VERSION, copied from #{oldfile}\n"
107
+ return
108
+ end
109
+ debug << "#{targetfile}: same VERSION, no change\n"
110
+ return
111
+ end
112
+
113
+ # Merge in old settings (note: any settings which are in targetfile but
114
+ # not in distfile will be silently dropped)
115
+ debug << "#{targetfile}:\n"
116
+ src.settings[1..-1].each do |src_setting|
117
+ name = src_setting.name
118
+ old_setting = old[name]
119
+ unless old_setting
120
+ debug << " #{name}: new\n"
121
+ next
122
+ end
123
+ if old_setting.version == src_setting.version
124
+ debug << " #{name}: unchanged\n"
125
+ src_setting.add_comment("\n DEFAULT SETTING from #{distfile}:\n")
126
+ src_setting.add_comment(src_setting.content)
127
+ src_setting.content = old_setting.content
128
+ next
129
+ end
130
+ # Otherwise, must install updated setting and comment out
131
+ # the current setting for reference
132
+ debug << " #{name}: UPDATED\n"
133
+ src_setting.add_comment("\n Previous setting (inserted by rconftool):\n\n")
134
+ src_setting.add_comment(old_setting.content)
135
+ end
136
+
137
+ return if opt[:noclobber]
138
+
139
+ # Write out the new file and carry forward permissions
140
+ begin
141
+ tempfile = targetfile+".new#{$$}"
142
+ src.write(tempfile)
143
+ st = File.stat(distfile)
144
+ begin
145
+ File.chown(st.uid, st.gid, tempfile)
146
+ rescue Errno::EPERM
147
+ end
148
+ File.chmod(st.mode, tempfile)
149
+ File.rename(targetfile, targetfile+".bak") unless target_missing
150
+ File.rename(tempfile, targetfile)
151
+ rescue
152
+ File.delete(tempfile) rescue nil
153
+ raise
154
+ end
155
+ end
156
+
157
+ HEADER_ID = '__header__'
158
+
159
+ # Object to represent a single setting
160
+
161
+ class Setting
162
+ attr_reader :name, :version
163
+ attr_accessor :content
164
+
165
+ def initialize(name, version)
166
+ @name = name.gsub(/\s+/,'')
167
+ @version = version.gsub(/s+/,'')
168
+ @comment = ""
169
+ @content = ""
170
+ @in_content = false
171
+ end
172
+ def <<(str)
173
+ @in_content = true unless /\A#/ =~ str
174
+ if @in_content
175
+ @content << str
176
+ else
177
+ @comment << str
178
+ end
179
+ end
180
+ # Add text to 'comment' portion of setting, prefixing each line with '#'
181
+ def add_comment(str)
182
+ @comment << str.gsub(/^/,'#')
183
+ end
184
+ def to_s
185
+ return "#{@comment}#{@content}" if @name == HEADER_ID
186
+ return "##NAME: #{@name}:#{@version}\n#{@comment}#{@content}"
187
+ end
188
+ end # class Setting
189
+
190
+ # Object to represent an entire configuration file. It consists of
191
+ # an array of Setting objects, with the first one having a special name
192
+ # (__header__). We also keep a hash of setting name => setting object
193
+ # to enable us to find a particular setting quickly.
194
+
195
+ class ConfigFile
196
+ attr_reader :version, :settings
197
+
198
+ def initialize(filename=nil)
199
+ read(filename) if filename
200
+ end
201
+
202
+ # fetch a setting by name
203
+ def [](item)
204
+ @settings_hash[item]
205
+ end
206
+
207
+ def read(filename)
208
+ @version = nil
209
+ curr_setting = Setting.new(HEADER_ID,'')
210
+ @settings = [curr_setting]
211
+ @settings_hash = {}
212
+
213
+ File.open(filename) do |f|
214
+ # VERSION header must occur within first 20 lines
215
+ 20.times do
216
+ line = f.gets
217
+ break unless line
218
+ curr_setting << line
219
+ if line =~ /\A##VERSION:/
220
+ @version = line
221
+ break
222
+ end
223
+ end
224
+ raise NoVersionLine, "#{filename}: No VERSION line found" unless @version
225
+
226
+ while line = f.gets
227
+ unless line =~ /\A##NAME:(.*):(.*)/
228
+ curr_setting << line
229
+ next
230
+ end
231
+ curr_setting = Setting.new($1,$2)
232
+ @settings << curr_setting
233
+ @settings_hash[curr_setting.name] = curr_setting
234
+ end
235
+ end
236
+ end
237
+
238
+ def write(filename)
239
+ File.open(filename,"w") do |f|
240
+ @settings.each do |s|
241
+ f << s.to_s
242
+ end
243
+ end
244
+ end
245
+ end # class ConfigFile
246
+
247
+ # Yield directory contents recursively, without doing chdir(). Note
248
+ # that yielded pathnames are relative to the base directory given;
249
+ # so that, for example, you can simulate 'cp -r /foo/bar/ /baz/' by
250
+ # recurse_dir("/foo/bar") { |n| copy("/foo/bar/"+n,"/baz/"+n) unless
251
+ # File.directory?("/foo/bar/"+n) }
252
+ # Current behaviour is that if a directory is a symlink, we follow it.
253
+ # (Perhaps the block we yield should return true/false?)
254
+
255
+ def self.recurse_dir(base)
256
+ base = base+File::SEPARATOR unless base[-1,1] == File::SEPARATOR
257
+ dirs = ['']
258
+ while dir = dirs.pop
259
+ yield dir unless dir == ''
260
+ Dir.foreach(base+dir) do |n|
261
+ next if n == '.' || n == '..'
262
+ target = dir + n
263
+ if File.directory?(base+target)
264
+ dirs << target+File::SEPARATOR
265
+ next
266
+ end
267
+ yield target
268
+ end
269
+ end
270
+ end
271
+
272
+ class Processor
273
+ attr_reader :o
274
+
275
+ # Parse command-line options and set the @o options hash
276
+
277
+ def initialize(argv=nil)
278
+ require 'optparse'
279
+
280
+ @o = { :strip_regexp => /\.dist\z/ }
281
+ return unless argv
282
+ opts = OptionParser.new do |opts|
283
+ opts.banner = "rconftool version #{VERSION}"
284
+ opts.separator "Usage: #{$0} [options]"
285
+ opts.separator ""
286
+ opts.separator "Specific options:"
287
+
288
+ opts.on("-n", "--noclobber", "Dummy run") do
289
+ @o[:noclobber] = true
290
+ end
291
+ opts.on("-f", "--force", "Update files even if VERSION is same") do
292
+ @o[:force] = true
293
+ end
294
+ opts.on("-q", "--quiet", "No progress reporting") do
295
+ @o[:debug] = ""
296
+ end
297
+ opts.on("--targetdir DIR", "Where to write merged config files") do |dir|
298
+ @o[:targetdir] = dir
299
+ end
300
+ opts.on("--olddir DIR", "If file does not exist in targetdir,",
301
+ "try to merge from here") do |dir|
302
+ @o[:olddir] = dir
303
+ end
304
+ opts.on("--[no-]recursive", "Traverse directories recursively") do |v|
305
+ @o[:recursive] = v
306
+ end
307
+ opts.on("--strip-suffix FOO", "Remove suffix FOO from target filenames",
308
+ "(default .dist)") do |suffix|
309
+ @o[:strip_regexp] = /#{Regexp.escape(suffix)}\z/
310
+ end
311
+ opts.on("-a", "--add-suffix FOO", "Add suffix FOO to target filenames") do |suffix|
312
+ @o[:add_suffix] = suffix
313
+ end
314
+
315
+ opts.on_tail("-?", "--help", "Show this message") do
316
+ puts opts
317
+ exit
318
+ end
319
+ end
320
+ opts.parse!(argv)
321
+ end
322
+
323
+ # Process a list of files, [src1,src2,...]. If recursive mode has been
324
+ # enabled, then subdirectories of destdir are created as necessary
325
+ # when 'src' is a directory, and the mode/ownership of these newly
326
+ # created directories is copied from the original.
327
+
328
+ def run(files)
329
+ done_work = false
330
+ files.each do |f|
331
+ if not File.directory?(f)
332
+ dst = old = nil
333
+ dst = @o[:targetdir] + File::SEPARATOR + File.basename(f) if @o[:targetdir]
334
+ old = @o[:olddir] + File::SEPARATOR + File.basename(f) if @o[:olddir]
335
+ Rconftool::install(f, dst, old, @o)
336
+ elsif not @o[:recursive]
337
+ raise Errno::EISDIR, "#{f} (not copied). Need --recursive?"
338
+ else
339
+ Rconftool::recurse_dir(f) do |nf|
340
+ src = f + File::SEPARATOR + nf
341
+ dst = old = nil
342
+ dst = @o[:targetdir] + File::SEPARATOR + nf if @o[:targetdir]
343
+ old = @o[:olddir] + File::SEPARATOR + nf if @o[:olddir]
344
+ if File.directory?(src)
345
+ if dst and not File.directory?(dst)
346
+ orig = File.stat(src)
347
+ Dir.mkdir(dst, orig.mode)
348
+ begin
349
+ File.chown(orig.uid, orig.gid, dst)
350
+ rescue Errno::EPERM
351
+ end
352
+ end
353
+ else
354
+ Rconftool::install(src, dst, old, @o)
355
+ end
356
+ end
357
+ end
358
+ done_work = true
359
+ end
360
+ unless done_work
361
+ $stderr.puts "Usage: #{$0} [options] src1 src2 ...\n"+
362
+ "Try #{$0} --help for more information\n"
363
+ exit 1
364
+ end
365
+ end
366
+ end # class Processor
367
+
368
+ end # module Rconftool
369
+
370
+ # Run from command line?
371
+ if __FILE__ == $0
372
+
373
+ begin
374
+ s = Rconftool::Processor.new(ARGV)
375
+ s.run(ARGV)
376
+ rescue Exception => e
377
+ $stderr.puts "#{$0}: #{e}"
378
+ end
379
+
380
+ end
@@ -26,6 +26,14 @@ $rwdguivar=
26
26
  <row> <p align=\"right\">7:</p> <text size=70 name=\"a_adconfigline7\"/> </row>
27
27
  <row> <p align=\"right\">8:</p> <text size=70 name=\"a_adconfigline8\"/> </row>
28
28
  <row> <p align=\"right\">9:</p> <text size=70 name=\"a_adconfigline9\"/> </row>
29
+ <row> <p align=\"right\">10:</p> <text size=70 name=\"a_adconfigline10\"/> </row>
30
+ <row> <p align=\"right\">11:</p> <text size=70 name=\"a_adconfigline11\"/> </row>
31
+ <row> <p align=\"right\">12:</p> <text size=70 name=\"a_adconfigline12\"/> </row>
32
+ <row> <p align=\"right\">13:</p> <text size=70 name=\"a_adconfigline13\"/> </row>
33
+ <row> <p align=\"right\">14:</p> <text size=70 name=\"a_adconfigline14\"/> </row>
34
+ <row> <p align=\"right\">15:</p> <text size=70 name=\"a_adconfigline15\"/> </row>
35
+ <row> <p align=\"right\">16:</p> <text size=70 name=\"a_adconfigline16\"/> </row>
36
+ <row> <p align=\"right\">17:</p> <text size=70 name=\"a_adconfigline17\"/> </row>
29
37
 
30
38
  </table>
31
39
  <p>%extraadconfigdatadisplay%</p>
data/init.rb CHANGED
@@ -23,6 +23,7 @@
23
23
 
24
24
  require "ev/rwd"
25
25
  require 'fileutils'
26
+ require 'extras/rconftool'
26
27
 
27
28
  $progdir = File::expand_path( File.dirname(__FILE__))
28
29
 
@@ -59,8 +60,25 @@ $progdir = File::expand_path( File.dirname(__FILE__))
59
60
  end
60
61
  end
61
62
 
63
+ # integrate the new configuration files
64
+ MAINconfignew = "rwdconfig.cnf"
65
+ MAINconfigdist = "rwdconfig.dist"
66
+ Rconftool::install(MAINconfigdist,MAINconfignew)
67
+
68
+ Dir.chdir("configuration") #changes the current working directory
69
+
70
+ fileList = Dir.new(".").entries.sort.reverse.delete_if { |x| ! (x =~ /dist$/) } #creates an Array separated with \n
71
+ @doc = ""
72
+ fileList.length.times{ #opening of a block
73
+ configdist =fileList.pop #pops the first item out of the Array
74
+ tempconfigfile = configdist.gsub(/\.dist$/, "")
75
+ confignew = tempconfigfile + ".cnf"
76
+ Rconftool::install(configdist,confignew) #integrates new file with old
77
+ } #closing block
78
+ # END of configuration integration
79
+ Dir.chdir($progdir)
80
+
62
81
  # Read in the configuration files
63
-
64
82
  Dir.chdir("configuration") #changes the current working directory
65
83
 
66
84
  fileList = Dir.new(".").entries.sort.reverse.delete_if { |x| ! (x =~ /cnf$/) } #creates an Array separated with \n
@@ -70,7 +88,7 @@ $progdir = File::expand_path( File.dirname(__FILE__))
70
88
  load fileName #loads the the config file thats in fileName
71
89
  } #closing block
72
90
  # END of configuration reading
73
-
91
+
74
92
  Dir.chdir($progdir) # change back to top program directory
75
93
 
76
94
  # build the English Language hash file from the parts
@@ -147,6 +147,11 @@ erik = secret
147
147
  Thanks, Steven Gibson
148
148
 
149
149
  == Changelog
150
+ version 0.99
151
+ added rconftool use to update configuration files
152
+ changed applets removal to not use external rm
153
+ removed version number from directory name
154
+
150
155
  version 0.98
151
156
  updated for rwdtinker 1.56
152
157
  first debian version
@@ -227,6 +227,10 @@ http://www.erikveen.dds.nl/rubywebdialogs/index.html
227
227
  Thanks, Steven Gibson
228
228
 
229
229
  == Changelog
230
+ version 1.57
231
+ added rconftool use to update configuration files
232
+ changed applets remove to not used external rm
233
+
230
234
  version 1.56
231
235
  refactored gui files to load without intermediate files
232
236
  refactored code files to load without intermediate files
Binary file
data/rwdconfig.dist ADDED
@@ -0,0 +1,6 @@
1
+ ##VERSION:1.57
2
+ # rwdtinker core configuration file
3
+ ##NAME: ConfigLocation:0
4
+ ConfigLocation=""
5
+ ##NAME: ZipsLocation:0
6
+ ZipsLocation=""
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ ruby tests/rdep.rb *.rb
3
+ echo "checking installapplet.rb"
4
+ ruby rdep.rb code/superant.com.rwdtinkerbackwindow/installapplet.rb
data/tests/cleancnf.sh ADDED
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ rm *.cnf
3
+ rm *.bak
4
+ rm configuration/*.cnf
5
+ rm configuration/*.bak
data/tests/makedist.rb ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/ruby -w
2
+ #***********************************************************************
3
+ #* Rwd/Tinker -- A Ruby program for the RudyWebDialog.
4
+ #* Copyright (c) 2004, 2005 by Steven Gibson. All Rights Reserved.
5
+ #* at "steven@superant.com".
6
+ #***********************************************************************/
7
+
8
+ require 'fileutils'
9
+ load 'configuration/rwdaddresses.dist'
10
+
11
+ $progdir = File::expand_path( File.dirname(__FILE__))
12
+ results = " "
13
+ puts "creating rwdschedule distribution files version #{RwdAddressesVersion}"
14
+ puts "cleaning conf files"
15
+ `tests/cleancnf.sh`
16
+ puts "moving up one directory"
17
+ Dir.chdir("..")
18
+
19
+ zipcreatecmd = "zip -r rwdaddresses-#{RwdAddressesVersion}.zip rwdaddresses"
20
+ puts "#{zipcreatecmd}"
21
+ `#{zipcreatecmd}`
22
+ tarcreatecmd = "tar --gzip -cf rwdaddresses-#{RwdAddressesVersion}.tar.gz rwdaddresses"
23
+ puts "#{tarcreatecmd}"
24
+ `#{tarcreatecmd}`
25
+ tarcreatecmd2 = "tar --bzip2 -cf rwdaddresses-#{RwdAddressesVersion}.tar.bz2 rwdaddresses"
26
+ puts "#{tarcreatecmd2}"
27
+ `#{tarcreatecmd2}`
28
+
29
+ print Dir["rwdaddresses*.{gz,bz2,deb,gem}"]
data/tests/rdep.rb ADDED
@@ -0,0 +1,354 @@
1
+ =begin
2
+
3
+ rdep - The Ruby Dependency Tool
4
+ Version 1.4
5
+
6
+ Hal E. Fulton
7
+ 2 November 2002
8
+ Ruby's license
9
+
10
+ Purpose
11
+
12
+ Determine the library files on which a specified Ruby file is dependent
13
+ (and their location and availability).
14
+
15
+ Usage notes
16
+
17
+ Usage: ruby rdep.rb sourcefile
18
+
19
+ The sourcefile may or may not have a .rb extension.
20
+
21
+ The directories in the $: array (which includes the RUBYLIB environment
22
+ variable) are searched first. File extensions are currently searched for
23
+ in this order: no extension, .rb, .o, .so, .dll (this may not be correct).
24
+
25
+ If there are no detected dependencies, the program will give the
26
+ message, "No dependencies found."
27
+
28
+ If the program finds [auto]load and require statements that it can
29
+ understand, it searches for the specified files. Any recognized Ruby
30
+ source files (*.rb) are processed recursively in the same way. No attempt
31
+ is made to open the files that appear to be binary.
32
+
33
+ The program will print up to four lists (any or all may be omitted):
34
+ 1. A list of files it found by going through RUBYLIB.;
35
+ 2. A list of files found under the searchroot (or under '.');
36
+ 3. A list of directories under searchroot which should perhaps be
37
+ added to RUBYLIB; and
38
+ 4. A list of files (without extensions) which could not be found.
39
+
40
+ If there were unparseable [auto]load or require statements, a warning
41
+ will be issued.
42
+
43
+ Between lists 3 and 4, the program will give an opinion about the overall
44
+ situation. The worst case is that files were not found; the uncertain
45
+ case is when there were unparseable statements; and the best case is
46
+ when all files could be found (lists 1 and 2).
47
+
48
+ Exit codes
49
+
50
+ 0 - Usage or successful execution
51
+ 1 - Nonexistent sourcefile specified
52
+ 2 - Improper sourcefile (pipe, special file, ...)
53
+ 3 - Some kind of problem reading a file
54
+
55
+ Limitations
56
+
57
+ Requires Ruby 1.6.0 or higher
58
+ No recursion on binaries
59
+ Can't look at dynamically built names
60
+ Can't detect "tested" requires (e.g.: flag = require "foo.rb")
61
+ [auto]load/require can be preceded only by whitespace on the line
62
+ Only recognizes simple strings ("file" or 'file')
63
+ Does not recognized named constants (e.g.: require MyFile)
64
+ Assumes every directory entry is either a file or subdirectory
65
+ Does not handle the Windows variable RUBYLIB_PREFIX
66
+ May be SLOW if a directory structure is deep (especially
67
+ on Windows with 1.6.x)
68
+
69
+ Known bugs:
70
+
71
+ Logic may be incorrect in terms of search order, file extensions, etc.
72
+ Injected a bug in 1.3: In rare cases will recurse until stack overflow
73
+
74
+ Revision history
75
+
76
+ Version 1.0 - 13 October 2000 - Initial release
77
+ Version 1.1 - 10 July 2001 - Bug fixes
78
+ Version 1.2 - 15 August 2002 - Works correctly on Win98
79
+ Version 1.3 - 21 October 2002 - Removed globals; removed search root;
80
+ added $: instead of RUBYLIB; etc.
81
+ Version 1.4 - 2 November 2002 - Fixed autoload recursion bug
82
+
83
+ To-do list
84
+
85
+ Possibly change extension search order?
86
+ Possibly add extensions to list?
87
+ Are explicit extensions allowed other than .rb?
88
+ Is a null extension really legal?
89
+ Additional tests/safeguards? (file permissions, non-empty files,...)
90
+ Change inconsistent expansion of tilde, dot, etc.?
91
+ Make it smarter somehow??
92
+
93
+ =end
94
+
95
+ #
96
+ # File.doc_skip - iterator to skip embedded docs in Ruby input file
97
+ #
98
+
99
+ class File
100
+
101
+ def doc_skip
102
+ loop do
103
+ str = gets
104
+ break if not str
105
+ if str =~ /^=begin([ \t]|$)/
106
+ loop do
107
+ str = gets
108
+ break if not str
109
+ break if str =~ /^=end([ \t]|$)/
110
+ end
111
+ else
112
+ yield str
113
+ end
114
+ end
115
+ end
116
+
117
+ end
118
+
119
+ class Dependency
120
+
121
+ #
122
+ # unquote - Find the value of a string. Called from scan.
123
+ #
124
+
125
+ def unquote(str)
126
+ # Still more kludgy code.
127
+ return nil if str == nil
128
+ if [?', ?"].include? str[0] # ' Unconfuse gvim
129
+ str = str[1..-2]
130
+ else
131
+ ""
132
+ end
133
+ end
134
+
135
+ #
136
+ # scan - Scans a line and returns the filename from a load or require
137
+ # statement. Returns null string if there was a parsing problem.
138
+ # Returns nil if this is not a load or require.
139
+ #
140
+
141
+ def scan(line)
142
+ line.strip!
143
+ if line =~ /^load/ or line =~ /^auto/ or line =~ /^require/
144
+ @has_dep = true # At least one dependency found.
145
+ # Kludge!!
146
+ junk = %w[ require load autoload ( ) , ] + [""]
147
+ temp = line.split(/[ \t\(\),]/) - junk
148
+ if temp[2] and temp[2][0].chr =~ /[#;]/ # Comments, semi...
149
+ temp = temp[0..1]
150
+ end
151
+ if temp[-1] =~ /\#\{/ # #{} means trouble
152
+ str = ""
153
+ else
154
+ str = unquote(temp[-1]) # May return nil.
155
+ end
156
+ str
157
+ else
158
+ nil
159
+ end
160
+ end
161
+
162
+ #
163
+ # find_files - The heart of the program. Search for files using $:
164
+ #
165
+
166
+ def find_files(source)
167
+ # loadable - This file or some variant can be found in one of the
168
+ # directories in $:
169
+ loadable = false
170
+
171
+ files = [] # Save a list of load/require files.
172
+ found = [] # Save a list of files found (.rb only for now)
173
+
174
+ # Open the file, strip embedded docs, and look for load/require statements.
175
+
176
+ begin
177
+ File.open(source).doc_skip {|line| files << scan(line)}
178
+ rescue => err
179
+ puts "Problem processing file #{source}: #{err}"
180
+ caller.each {|x| puts " #{x}"}
181
+ exit 3
182
+ end
183
+
184
+ # If no dependencies, don't bother searching!
185
+ if ! @has_dep
186
+ puts "No dependencies found."
187
+ exit 0
188
+ end
189
+
190
+ files.compact!
191
+ catch(:skip) do
192
+ for file in files
193
+
194
+ if file == "" # Warning
195
+ @warnfiles << source
196
+ next
197
+ end
198
+
199
+ throw :skip if (@inpath.include? file) || (@cantfind.include? file)
200
+
201
+ if file =~ /\.rb$/ then # Don't add suffix to *.rb
202
+ suffixes = [""] # Hmm... .rbw?? Probably not needed.
203
+ else
204
+ suffixes = @suffixes # Use any suffix (extension)
205
+ end
206
+
207
+ # Look through search path (@search_path)
208
+
209
+ for dir in @search_path
210
+
211
+ for suf in suffixes
212
+ filename = dir + file + suf
213
+ loadable = test ?e, filename
214
+ break if loadable
215
+ end
216
+
217
+ if loadable
218
+ @inpath << filename # Files we found in RUBYLIB
219
+ # Add to 'found' if it's a source file (so we can recurse)
220
+ found << filename if filename =~ /\.rb$/
221
+ break
222
+ end
223
+
224
+ end
225
+
226
+ @cantfind << file if !loadable
227
+ end
228
+ end
229
+
230
+ found.uniq!
231
+ found.compact!
232
+ list = found
233
+ found.each {|x| list += find_files(x)}
234
+
235
+ list
236
+ end
237
+
238
+ #
239
+ # print_list - Print a header message followed by a list of files
240
+ # or directories.
241
+ #
242
+
243
+ def print_list(header, list)
244
+ return if list.empty?
245
+ puts header + "\n\n" # Extra newlines
246
+ list.each {|x| puts " #{x}"}
247
+ puts "\n" # Extra newline
248
+ end
249
+
250
+ SEP = File::Separator
251
+ DIRSEP = if SEP=="/" then ":" else ";" end
252
+
253
+ def execute
254
+ @has_dep = false
255
+ @warnfiles = []
256
+ @newdirs = []
257
+ @inpath = []
258
+ @cantfind = []
259
+ @suffixes = [""] + %w[ .rb .o .so .dll ]
260
+ @rdirs = []
261
+ @global_found = []
262
+
263
+ # No parameters? Usage message
264
+
265
+ if not ARGV[0]
266
+ puts "Usage: ruby rdep.rb sourcefile [searchroot]"
267
+ exit 0
268
+ end
269
+
270
+ # Does sourcefile exist?
271
+
272
+ if ! test ?e, ARGV[0]
273
+ puts "#{ARGV[0]} does not exist."
274
+ exit 1
275
+ end
276
+
277
+ # Is sourcefile a "real" file?
278
+
279
+ if ! test ?f, ARGV[0]
280
+ puts "#{ARGV[0]} is not a regular file."
281
+ exit 2
282
+ end
283
+
284
+ # Be sure to search under the dir where the
285
+ # program lives...
286
+
287
+ @proghome = File.dirname(File.expand_path(ARGV[0]))
288
+ if @proghome != File.expand_path(".")
289
+ $: << @proghome
290
+ end
291
+
292
+ # Get list of dirs in $:
293
+
294
+ @search_path = $:
295
+ @search_path.collect! {|x| x[-1] == SEP ? x : x + SEP }
296
+
297
+ # All real work happens here -- big recursive find
298
+
299
+ find_files(ARGV[0])
300
+
301
+ @warnfiles.uniq!
302
+ @cantfind.uniq!
303
+ @newdirs.uniq!
304
+ @inpath.map! {|x| File.expand_path(x)}
305
+ @inpath.uniq!
306
+
307
+ #
308
+ # Now, what are all the results? Report to user.
309
+ #
310
+
311
+ if @inpath[0]
312
+ print_list("Found in search path:", @inpath)
313
+ if ! @cantfind.empty? && @warnfiles.empty?
314
+ puts "This will probably be sufficient.\n"
315
+ end
316
+ end
317
+
318
+ # Did we use any dirs under the "home"?
319
+
320
+ homedirs = @inpath.find_all {|x| x =~ Regexp.new("^"+@proghome)}
321
+ if homedirs[0] # not empty
322
+ homedirs.map! {|x| File.dirname(x) }.uniq!
323
+ puts "Consider adding these directories to RUBYPATH:\n\n"
324
+ homedirs.each {|x| puts " #{x}" }
325
+ puts
326
+ if @warnfiles[0] and homedirs == [] # There are unparseable statements.
327
+ puts "This will probably NOT be sufficient. See below.\n\n"
328
+ end
329
+ end
330
+
331
+ # What's our opinion?
332
+
333
+ if @cantfind[0] # There are unknown files.
334
+ puts "This will probably NOT be sufficient. See below.\n\n"
335
+ elsif @warnfiles[0] and homedirs == [] # There are unparseable statements.
336
+ puts "Files may still be missing. See below.\n\n"
337
+ else # We think everything is OK.
338
+ puts "This will probably be sufficient."
339
+ end
340
+
341
+ # Report unknown files
342
+ print_list("Not located anywhere:", @cantfind)
343
+
344
+ # Print warning about load/require strings we couldn't understand
345
+ print_list("Warning: Unparseable usages of 'load' or 'require' in:",
346
+ @warnfiles)
347
+ end
348
+
349
+ end
350
+
351
+ Dependency.new.execute
352
+
353
+ exit 0
354
+
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.6
3
3
  specification_version: 1
4
4
  name: rwdaddresses
5
5
  version: !ruby/object:Gem::Version
6
- version: "0.98"
7
- date: 2005-03-01
6
+ version: "0.99"
7
+ date: 2005-03-07
8
8
  summary: rwdaddresses is contact book application using rwdtinker and RubyWebDialogs.
9
9
  require_paths:
10
10
  - "."
@@ -85,14 +85,11 @@ files:
85
85
  - code/superant.com.rwdaddresses/rwdaddressesbackwindow.rb
86
86
  - code/superant.com.rwdaddresses/returntomain.rb
87
87
  - code/superant.com.rwdaddresses/runrwdaddressesmenu1.rb
88
- - configuration/language.cnf
89
- - configuration/rwdapplicationidentity.cnf
90
- - configuration/rwdtinker.cnf
91
- - configuration/rwdtinkerversion.cnf
92
- - configuration/tinkerwin2variables.cnf
93
- - configuration/tinkerwin2version.cnf
94
- - configuration/rwdaddresses.cnf
95
- - configuration/rwdaddressesversion.cnf
88
+ - configuration/tinkerwin2variables.dist
89
+ - configuration/rwdtinker.dist
90
+ - configuration/language.dist
91
+ - configuration/rwdapplicationidentity.dist
92
+ - configuration/rwdaddresses.dist
96
93
  - extras/zip
97
94
  - extras/cmdline_parse
98
95
  - extras/config_file
@@ -102,6 +99,7 @@ files:
102
99
  - extras/playlist
103
100
  - extras/plugins
104
101
  - extras/showHelp
102
+ - extras/rconftool.rb
105
103
  - names/Angelina Jolie.nam
106
104
  - names/Steven Gibson.nam
107
105
  - names/Angelina Jolie.jpg
@@ -217,8 +215,13 @@ files:
217
215
  - rwd_files/HowTo_Addresses.txt
218
216
  - rwd_files/contacttmp.jpg
219
217
  - zips/rwdahelloworld-0.5.zip
220
- - Readme.txt
218
+ - tests/cleancnf.sh
219
+ - tests/rdep.rb
220
+ - tests/checkdepends.sh
221
+ - tests/makedist.rb
221
222
  - init.rb
223
+ - rwdconfig.dist
224
+ - Readme.txt
222
225
  test_files: []
223
226
  rdoc_options:
224
227
  - "--main"
@@ -1,5 +0,0 @@
1
-
2
- #$lang = "jp"
3
- $lang= "en"
4
- #$lang= "nl"
5
- #$lang= "es"
@@ -1,9 +0,0 @@
1
-
2
- $photodelay = 1
3
- $addressfiles_directory="names"
4
- $tmpphoto_directory = "/tmp"
5
- $rwdaddresses_ftpsite = "ftp.mysite.com"
6
- $rwdaddresses_ftplogin = "mylogin"
7
- $rwdaddresses_ftppassword = "mypassword"
8
- $rwdaddresses_ftpdirectory = "/incoming/rwdnames/"
9
- $rwdaddresses_updatedirectory = "updates"
@@ -1,2 +0,0 @@
1
-
2
- RwdAddressesVersion = "0.98"
@@ -1,3 +0,0 @@
1
-
2
- $rwdapplicationidentity = "rwdaddresses - contact book"
3
-
@@ -1,2 +0,0 @@
1
-
2
- RwdTinkerVersion = "1.56"
@@ -1,3 +0,0 @@
1
-
2
- RwdTinkerWin2Version = "0.8"
3
-