rwdshell 0.97 → 0.98

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.
Files changed (37) hide show
  1. data/Readme.txt +6 -0
  2. data/code/01rwdcore/01rwdcore.rb +4 -2
  3. data/code/01rwdcore/test_cases.rb +126 -0
  4. data/code/01rwdcore/test_harness.rb +15 -0
  5. data/code/01rwdcore/uploadreturns.rb +62 -0
  6. data/code/superant.com.rwdtinkerbackwindow/diagnostictab.rb +14 -10
  7. data/configuration/language.dist +1 -1
  8. data/configuration/rwdapplicationidentity.dist +2 -2
  9. data/configuration/rwdshell.dist +2 -2
  10. data/configuration/rwdtinker.dist +2 -2
  11. data/configuration/tinkerwin2variables.dist +1 -1
  12. data/extras/zip/ioextras.rb +114 -0
  13. data/extras/zip/stdrubyext.rb +111 -0
  14. data/extras/zip/tempfile_bugfixed.rb +195 -0
  15. data/extras/zip/zip.rb +1377 -0
  16. data/extras/zip/zipfilesystem.rb +558 -0
  17. data/extras/zip/ziprequire.rb +61 -0
  18. data/gui/helpaboutinstalled/superant.com.tinkerhelpabout/3copyright.rwd +1 -1
  19. data/gui/tinkerbackwindows/superant.com.rwdshellbackwindow/46editscriptrecord.rwd +5 -5
  20. data/gui/tinkerbackwindows/superant.com.tinkerbackwindow/70rwddiagnostics.rwd +12 -16
  21. data/init.rb +3 -0
  22. data/rwd_files/HowTo_Shell.txt +4 -0
  23. data/rwd_files/HowTo_Tinker.txt +14 -0
  24. data/rwdconfig.dist +6 -2
  25. data/tests/makedist.rb +16 -1
  26. metadata +12 -17
  27. data/extras/cmdline_parse +0 -47
  28. data/extras/config_file +0 -69
  29. data/extras/errorMsg +0 -19
  30. data/extras/makePlaylist +0 -34
  31. data/extras/mp3controld +0 -289
  32. data/extras/playlist +0 -186
  33. data/extras/showHelp +0 -18
  34. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/1appname.rwd +0 -4
  35. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/3copyright.rwd +0 -3
  36. data/gui/helpaboutinstalled/superant.com.rwdwin2helpabout/5version.rwd +0 -10
  37. data/installed/rwdtinkerwin2-0.5.inf +0 -8
data/extras/playlist DELETED
@@ -1,186 +0,0 @@
1
- #!ruby
2
-
3
- # --- Playlist class ---
4
- #
5
- # Author: Magnus Engstr�m
6
- # Email: magnus@gisab.se
7
- # File: playlist
8
- #
9
- # Description
10
- # -----------
11
- # The Playlist class handles everything a playlist should be able to manage.
12
- # Shuffle it, unshuffle it, wrap it if desired, add new songs, find songs and
13
- # so on. Cool huh? :)
14
- # ----------------------
15
-
16
- class Playlist
17
- # create_from_file() creates a playlist from a file and returns either a Playlist instance or -1 in case of error
18
- # This function should be used instead of the ::new, because this one
19
- # returns -1 on file read errors, which the ::new doesn't.
20
- def Playlist::create_from_file(filename)
21
- # Check that the file is readable
22
- if(FileTest::readable_real?(filename))
23
- new(filename) # Return the Playlist class instance
24
- else
25
- -1 # Return -1 on error
26
- end
27
- end
28
-
29
- # initialize reads the playlist from a file and returns the Playlist instance
30
- def initialize(filename)
31
-
32
- @filename = filename # Store the filename for later use
33
- @playlist = Array::new() # This hash contains the whole playlist
34
- @index = 0 # Playlist's current position
35
- @wrap = false # Don't repeat the list as default
36
-
37
- # Parse these fields, separated with double pipes (||) (songname, artist, album, year, comment, tracknum, genre_id, genre)
38
- File::foreach(filename) { |line| # Iterate through every line in the file
39
- foo = line.split(/\|\|/)
40
- @playlist << { "filename" => foo[0], "songname" => foo[1], "artist" => foo[2], "album" => foo[3], "year" => foo[4], "comment" => foo[5], "tracknum" => foo[6], "genre_id" => foo[7], "genre" => foo[8] } # Add a hash to the @playlist array with all values found in the playlist file
41
- }
42
-
43
- end
44
-
45
- def insert(song, placement = 0)
46
- # Check song information
47
- return -1 if(song.type != Hash)
48
- song = { "filename" => song["filename"], "songname" => song["songname"], "artist" => song["artist"], "album" => song["album"], "year" => song["year"], "comment" => song["comment"], "tracknum" => song["tracknum"], "genre_id" => song["genre_id"], "genre" => song["genre"] }
49
-
50
- # Check minimum and maximum values
51
- placement = 0 if(placement < 0)
52
- placement = @playlist.length() if(placement > @playlist.length() )
53
-
54
- # Retrieve the two parts of the split playlist
55
- first = @playlist[0...placement]
56
- second = @playlist[placement...@playlist.length()]
57
-
58
- # Put it together again
59
- @playlist = Array::new()
60
- @playlist = first
61
- @playlist << song
62
- @playlist.concat(second)
63
-
64
- end
65
-
66
- def remove(placement = 0)
67
- # Check boundaries
68
- placement = 0 if(placement < 0)
69
- placement = @playlist.length()-1 if( placement >= @playlist.length() )
70
-
71
- # Delete the item
72
- @playlist.delete_at(placement)
73
- end
74
-
75
- def find(search_string, case_insensitive = false, fields = ["songname", "filename"])
76
- case_insensitive = nil if(case_insensitive == false)
77
-
78
- results = Array::new()
79
- regex = Regexp::new(search_string, case_insensitive) # The regex that will be matched
80
-
81
- # Iterate through the playlist to find one or more matching songs
82
- @playlist.length().times { |index|
83
- # Iterate through the user supplied list of fields to be searched
84
- fields.each { |field|
85
- # Make sure this is a hash, so we don't go and crash, or make someone's dog sick :)
86
- if(@playlist[index].type == Hash)
87
- results << index if( regex.match(@playlist[index][field]) && !(results.include?(index)) ) # If it matches, and if it doesn't already is in the results. We don't want duplicates :)
88
- end
89
- }
90
- }
91
-
92
- results # Return the results
93
-
94
- end
95
-
96
- def shuffle()
97
- # Iterate through the playlist
98
- ( 0...@playlist.length() ).each { |i|
99
- j = rand @playlist.length() # Grab a random value between 0 and @playlist.length()
100
-
101
- # Maintain index
102
- if(@index == j)
103
- @index = i
104
- elsif(@index == i)
105
- @index = j
106
- end
107
-
108
- @playlist[i], @playlist[j] = @playlist[j], @playlist[i]
109
- }
110
- end
111
-
112
- def re_read()
113
- # Maintain index
114
- current_filename = @playlist[@index]["filename"]
115
-
116
- # Create a new playlist array
117
- @playlist = Array::new()
118
- @index = 0
119
- foo_index = 0 # Just to keep the count while adding all songs to the @playlist
120
-
121
- # Parse these fields, separated with double pipes (||) (songname, artist, album, year, comment, tracknum, genre_id, genre)
122
- # Iterate through every line in the file
123
- File::foreach(@filename) { |line|
124
- foo = line.split(/\|\|/) # Separate the fields with double pipes (||)
125
- @playlist << { "filename" => foo[0], "songname" => foo[1], "artist" => foo[2], "album" => foo[3], "year" => foo[4], "comment" => foo[5], "tracknum" => foo[6], "genre_id" => foo[7], "genre" => foo[8] } # Add a hash to the @playlist array with all values found in the playlist file
126
-
127
- # Maintain index
128
- @index = foo_index if(foo[0] == current_filename)
129
- foo_index += 1
130
- }
131
-
132
- end
133
-
134
- def next()
135
- # Increase the counter and return -1 if the playlist went to far, and wrap isn't true
136
- @index += 1
137
- if( @index >= @playlist.length() )
138
- if(@wrap)
139
- @index = 0
140
- else
141
- @index -= 1
142
- -1 # Return an error
143
- end
144
- else
145
- @index
146
- end
147
- end
148
-
149
- def prev()
150
- # Decrease the counter and return -1 if the playlist went to far, and wrap isn't true
151
- @index -= 1
152
- if( @index < 0 )
153
- if(@wrap)
154
- @index = @playlist.length() -1
155
- else
156
- @index += 1
157
- -1 # Return an error
158
- end
159
- else
160
- @index
161
- end
162
- end
163
-
164
- def song_info(index = @index)
165
- @playlist[index]
166
- end
167
-
168
- def goto(index = 0)
169
- if( index >= 0 && index < @playlist.length() )
170
- @index = index
171
- else
172
- return -1
173
- end
174
- end
175
-
176
- def length()
177
- @playlist.length()
178
- end
179
-
180
- def each()
181
- @playlist.each { |song| yield(song) }
182
- end
183
-
184
- attr_reader :wrap, :index, :filename
185
- attr_writer :wrap
186
- end
data/extras/showHelp DELETED
@@ -1,18 +0,0 @@
1
- #!/usr/bin/ruby
2
-
3
- # --- showHelp ----
4
- #
5
- # Author: Magnus Engstr�m
6
- # Email: magnus@gisab.se
7
- # File: showHelp
8
- #
9
- # Description
10
- # -----------
11
- # This function
12
- # print the help
13
- # message on STDOUT
14
- # -----------------
15
-
16
- def showHelp()
17
- STDOUT.puts("MaGnuX Mp3 Management server - Ruby Edition v0.2a\n-------------------------------------------------\n\n--help\t\t\tShow this message\n--debug on\t\tShow some debug data\n--configfile file\tSelect configuration file\n--daemon, -D (yes*|no)\tGo to background on startup\n\n")
18
- end
@@ -1,4 +0,0 @@
1
- $rwdguivar=
2
- "
3
- <panel>
4
- <row> <p align=\"center\">#{Message[:rwdtinker_window_2]}</p></row>"
@@ -1,3 +0,0 @@
1
- $rwdguivar=
2
- "
3
- <row> <p align=\"center\">copyright s. gibson 2004</p></row>"
@@ -1,10 +0,0 @@
1
- $rwdguivar=
2
- "
3
- <horizontal>
4
- <button caption=#{Message[:clickfor_version]} action=\"runrwdtinkerwin2version\"/>
5
- </horizontal>
6
- <p>%rwdtinkerwin2versiondisplay%</p>
7
-
8
- </panel>"
9
-
10
-
@@ -1,8 +0,0 @@
1
- # rwdwin2 - rwd applet in second window - core for Tinker: Applet adding/removing and Diagnostic tab
2
- configuration/ab1tinkerwin2.cnf
3
- code/xb1rwdtinkerbackwindow
4
- gui/ll5rwdtinkerwin2selectiontab
5
- gui/xb1rwdtinkerbackwindow
6
- gui/uu6rwdtinkerwin2documents
7
- gui/yg6rwdwin2helpabout
8
- rwd_files/HowTo_TinkerWin2.txt