ruwiki 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. data/Readme.rubygems +86 -0
  2. data/Readme.tarfile +65 -0
  3. data/bin/ruwiki +58 -0
  4. data/bin/ruwiki.cgi +87 -0
  5. data/bin/ruwiki_convert +56 -0
  6. data/bin/ruwiki_service.rb +82 -0
  7. data/bin/ruwiki_servlet +53 -0
  8. data/contrib/enscript-token.rb +55 -0
  9. data/contrib/rublog_integrator.rb +68 -0
  10. data/data/Default/ProjectIndex.ruwiki +49 -0
  11. data/data/Ruwiki/Antispam.ruwiki +65 -0
  12. data/data/Ruwiki/BugTracking.ruwiki +33 -0
  13. data/data/Ruwiki/ChangeLog.ruwiki +102 -0
  14. data/data/Ruwiki/Configuring_Ruwiki.ruwiki +151 -0
  15. data/data/Ruwiki/Extending_Ruwiki.ruwiki +317 -0
  16. data/data/Ruwiki/LicenseAndAuthorInfo.ruwiki +30 -0
  17. data/data/Ruwiki/ProjectIndex.ruwiki +84 -0
  18. data/data/Ruwiki/Roadmap.ruwiki +225 -0
  19. data/data/Ruwiki/RuwikiTemplatingLibrary.ruwiki +156 -0
  20. data/data/Ruwiki/RuwikiUtilities.ruwiki +157 -0
  21. data/data/Ruwiki/SandBox.ruwiki +9 -0
  22. data/data/Ruwiki/To_Do.ruwiki +51 -0
  23. data/data/Ruwiki/TroubleShooting.ruwiki +33 -0
  24. data/data/Ruwiki/WikiFeatures.ruwiki +17 -0
  25. data/data/Ruwiki/WikiMarkup.ruwiki +261 -0
  26. data/data/Tutorial/AddingPages.ruwiki +16 -0
  27. data/data/Tutorial/AddingProjects.ruwiki +16 -0
  28. data/data/Tutorial/ProjectIndex.ruwiki +11 -0
  29. data/data/Tutorial/SandBox.ruwiki +9 -0
  30. data/data/agents.banned +60 -0
  31. data/data/agents.readonly +321 -0
  32. data/data/hostip.banned +30 -0
  33. data/data/hostip.readonly +28 -0
  34. data/lib/ruwiki.rb +622 -0
  35. data/lib/ruwiki/auth.rb +56 -0
  36. data/lib/ruwiki/auth/gforge.rb +73 -0
  37. data/lib/ruwiki/backend.rb +318 -0
  38. data/lib/ruwiki/backend/flatfiles.rb +217 -0
  39. data/lib/ruwiki/config.rb +244 -0
  40. data/lib/ruwiki/exportable.rb +192 -0
  41. data/lib/ruwiki/handler.rb +342 -0
  42. data/lib/ruwiki/lang/de.rb +339 -0
  43. data/lib/ruwiki/lang/en.rb +334 -0
  44. data/lib/ruwiki/lang/es.rb +339 -0
  45. data/lib/ruwiki/page.rb +262 -0
  46. data/lib/ruwiki/servlet.rb +38 -0
  47. data/lib/ruwiki/template.rb +553 -0
  48. data/lib/ruwiki/utils.rb +24 -0
  49. data/lib/ruwiki/utils/command.rb +102 -0
  50. data/lib/ruwiki/utils/converter.rb +297 -0
  51. data/lib/ruwiki/utils/manager.rb +639 -0
  52. data/lib/ruwiki/utils/servletrunner.rb +295 -0
  53. data/lib/ruwiki/wiki.rb +147 -0
  54. data/lib/ruwiki/wiki/tokens.rb +136 -0
  55. data/lib/ruwiki/wiki/tokens/00default.rb +211 -0
  56. data/lib/ruwiki/wiki/tokens/01wikilinks.rb +166 -0
  57. data/lib/ruwiki/wiki/tokens/02actions.rb +63 -0
  58. data/lib/ruwiki/wiki/tokens/abbreviations.rb +40 -0
  59. data/lib/ruwiki/wiki/tokens/calendar.rb +147 -0
  60. data/lib/ruwiki/wiki/tokens/headings.rb +43 -0
  61. data/lib/ruwiki/wiki/tokens/lists.rb +112 -0
  62. data/lib/ruwiki/wiki/tokens/rubylists.rb +48 -0
  63. data/ruwiki.conf +22 -0
  64. data/ruwiki.pkg +0 -0
  65. data/templates/default/body.tmpl +19 -0
  66. data/templates/default/content.tmpl +7 -0
  67. data/templates/default/controls.tmpl +23 -0
  68. data/templates/default/edit.tmpl +27 -0
  69. data/templates/default/error.tmpl +14 -0
  70. data/templates/default/footer.tmpl +23 -0
  71. data/templates/default/ruwiki.css +297 -0
  72. data/templates/default/save.tmpl +8 -0
  73. data/templates/sidebar/body.tmpl +19 -0
  74. data/templates/sidebar/content.tmpl +8 -0
  75. data/templates/sidebar/controls.tmpl +8 -0
  76. data/templates/sidebar/edit.tmpl +27 -0
  77. data/templates/sidebar/error.tmpl +13 -0
  78. data/templates/sidebar/footer.tmpl +22 -0
  79. data/templates/sidebar/ruwiki.css +347 -0
  80. data/templates/sidebar/save.tmpl +10 -0
  81. data/templates/simple/body.tmpl +13 -0
  82. data/templates/simple/content.tmpl +7 -0
  83. data/templates/simple/controls.tmpl +8 -0
  84. data/templates/simple/edit.tmpl +25 -0
  85. data/templates/simple/error.tmpl +10 -0
  86. data/templates/simple/footer.tmpl +10 -0
  87. data/templates/simple/ruwiki.css +192 -0
  88. data/templates/simple/save.tmpl +8 -0
  89. data/tests/harness.rb +52 -0
  90. data/tests/tc_backend_flatfile.rb +103 -0
  91. data/tests/tc_bugs.rb +74 -0
  92. data/tests/tc_exportable.rb +64 -0
  93. data/tests/tc_template.rb +145 -0
  94. data/tests/tc_tokens.rb +335 -0
  95. data/tests/testall.rb +20 -0
  96. metadata +182 -0
@@ -0,0 +1,339 @@
1
+ #--
2
+ # Ruwiki
3
+ # Copyright � 2002 - 2004, Digikata and HaloStatue
4
+ # Alan Chen (alan@digikata.com)
5
+ # Austin Ziegler (austin@halostatue.ca)
6
+ # Mauricio Julio Fern�ndez Pradier (batsman.geo@yahoo.com)
7
+ #
8
+ # Licensed under the same terms as Ruby.
9
+ #
10
+ # $Id: es.rb,v 1.15 2004/11/28 23:28:16 austin Exp $
11
+ #++
12
+ module Ruwiki::Lang
13
+ # Ruwiki::Lang::ES is the English-language output module. It contains a
14
+ # hash, *Message*, that contains the messages that may be reported by
15
+ # any method in the Ruwiki library. The messages are identified by a
16
+ # Symbol.
17
+ module ES
18
+ Message = Hash.new { |hh, kk| hh[kk] = "ERROR: Identificador de mensaje desconocido: #{kk.inspect}."; hh[kk] }
19
+ message = {
20
+ # The encoding for the webpages. This should match the encoding used
21
+ # to create these messages.
22
+ :charset_encoding => "iso-8859-15",
23
+ # Backend-related messages.
24
+ :backend_unknown => "Backend %1$s desconocido.",
25
+ :cannot_create_project => "No pudo crearse el proyecto %1$s: %2$s",
26
+ :cannot_destroy_project => "No pudo borrarse el proyecto %1$s: %2$s",
27
+ :cannot_destroy_topic => "No pudo borrarse %1$s::%2$s: %3$s",
28
+ :cannot_obtain_lock => "No pudo obtenerse el cerrojo para %1$s::%2$s. Reint�ntelo de nuevo en breve.",
29
+ :cannot_release_lock => "No pudo liberarse el cerrojo para %1$s::%2$s. Reint�ntelo de nuevo en breve.",
30
+ :cannot_retrieve_topic => "No pudo obtenerse %1$s::%2$s: %3$s",
31
+ :cannot_store_topic => "No pudo almacenarse %1$s::%2$s: %3$s",
32
+ :cannot_list_topics => "No se pudo listar los temas del proyecto %1$s: %2$s",
33
+ :error_creating_lock => "Error al crear el cerrojo para %1$s::%2$s: %3$s",
34
+ :error_releasing_lock => "Error al liberar el cerrojo para %1s::%2$s: %3$s",
35
+ :flatfiles_no_data_directory => "El directorio de datos (%1$s) no existe.",
36
+ :no_access_list_projects => "Permiso denegado al listar los proyectos.",
37
+ :no_access_list_topics => "Permiso denegado al listar los temas del proyecto %1$s.",
38
+ :no_access_to_create_project => "Permiso denegado al crear el proyecto %1$s.",
39
+ :no_access_to_destroy_project => "Permiso denegado al borrar el proyecto %1$s::%2$s.",
40
+ :no_access_to_destroy_topic => "Permiso denegado al borrar el borrar el tema %1$s::%2$s.",
41
+ :no_access_to_read_topic => "Permiso denegado al acceder a %1$s::%2$s.",
42
+ :no_access_to_store_topic => "Permiso denegado al almacenar %1$s::%2$s.",
43
+ :page_not_in_backend_format => "%1$s::%2$s no est� en un formato soportado por el backend %3$s.",
44
+ :project_already_exists => "El proyecto %1$s ya existe.",
45
+ :project_does_not_exist => "El proyecto %1$s no existe.",
46
+ :search_project_fail => "Error al buscar la cadena %2$s en el proyecto %1$s.",
47
+ :yaml_requires_182_or_higher => "El soporte para archivos YAML s�lo est� disponible en Ruby versi�n 1.8.2 o superior.",
48
+ :not_editing_current_version => <<EOM ,
49
+ Ha enviado una versi�n antigua de %1$s::%2$s. Las diferencias entre su versi�n
50
+ y la actual han sido fusionadas. En caso de conflicto, las l�neas de ambas
51
+ versiones ser�n mostradas. Aseg�rese de editar la p�gina en su totalidad
52
+ antes de salvar de nuevo.
53
+ EOM
54
+ :no_empty_search_string => <<EOM ,
55
+ El campo de b�squeda no puede estar vac�o. Por favor introduzca el texto
56
+ a buscar antes de pulsar sobre el bot�n de b�squeda.
57
+ EOM
58
+ :page_is_locked => "La pagina no puede ser editada al estar bloqueada en este momento. Por favor espere unos minutos y vuelva a intentar.",
59
+
60
+ # Config-related messages.
61
+ :config_not_ruwiki_config => "La configuraci�n debe ser de clase Ruwiki::Config.",
62
+ :invalid_template_dir => "El path para plantillas (%1$s) no existe o no es un directorio.",
63
+ :no_template_found => "No pudo encontrarse la plantilla para %1$s en el conjunto %2$s.",
64
+ :no_template_set => "No pudo encontrarse el conjunto de plantillas '%1$s' en el path.",
65
+ :no_webmaster_defined => "Error de configuraci�n: Webmaster no est� definido.",
66
+ # Miscellaneous messages.
67
+ :complete_utter_failure => "Error catastr�fico",
68
+ :editing => "Edici�n",
69
+ :error => "Error",
70
+ :invalid_path_info_value => "Algo huele a podrido en su entorno Web. PATH_INFO = %1$s",
71
+ :render_arguments => "Ruwiki#render debe ser llamado con cero o dos argumentos.",
72
+ :unknown_feature => "Caracter�stica desconocida: %1$s.",
73
+ :topics_for_project => "Temas del Proyecto ::%1$s",
74
+ :project_topics_link => "(temas)",
75
+ :wiki_projects => "Proyectos en %1$s",
76
+ :no_projects => "Ning�n proyecto.",
77
+ :no_topics => "El proyecto %1$s no tiene nig�n tema.",
78
+ :search_results_for => "= Resultados de la b�squeda de: %1$s",
79
+ :number_of_hits => "%1$d Resultados",
80
+
81
+ # Labels
82
+ :label_search_project => "Buscar en projecto",
83
+ :label_search_all => "Todo",
84
+ :label_search => "Buscar: ",
85
+ :label_project => "Proyecto: ",
86
+ :label_topic => "Tema: ",
87
+ :label_edit => "Editar",
88
+ :label_recent_changes => "Cambios recientes",
89
+ :label_topics => "Temas",
90
+ :label_projects => "Proyectos",
91
+ :label_editing => "Edici�n",
92
+ :label_text => "Texto:",
93
+ :label_text_accelerator => "T",
94
+ :label_edit_comment => "Editar Comentario: ",
95
+ :label_comment_accelerator => "O",
96
+ :label_save => "Salvar",
97
+ :label_save_accelerator => "S",
98
+ :label_cancel => "Cancelar",
99
+ :label_cancel_accelerator => "C",
100
+ :label_preview => "Previsualizar",
101
+ :label_preview_accelerator => "P",
102
+ :label_original_text => "Text Original",
103
+ :label_raw => "Crudo",
104
+ :label_formatted => "Formateado",
105
+ :label_send_report_by => "Enviar notificaci�n al administrador del Wiki por email.",
106
+ :label_send_report => "Enviar notificaci�n.",
107
+ :label_saved_page => "P�gina salvada: ",
108
+
109
+ # Messages from Ruwiki::Utils::Converter
110
+ # Note to translators: certain words should be left alone. These
111
+ # will be marked in comments. Description lines are restricted to 40
112
+ # characters and should be an array. Use this as a ruler.
113
+ # => [ "----------------------------------------" ]
114
+ :converter_usage => "Modo de empleo: %1$s [opciones] <dir.>",
115
+ :converter_format_desc => [ "Convertir los ficheros encontrados",
116
+ "(independientemente de su formato), al",
117
+ "formato especificado; por defecto ",
118
+ "archivos planos. Formatos permitidos:",
119
+ " yaml marshal flatfiles" ],
120
+ :converter_backup_desc => [ "Crear copias de seguridad de ficheros ",
121
+ "actualizados. La opci�n por defecto es ",
122
+ "--backup." ],
123
+ :converter_backupext_desc => [ 'Especificar la extensi�n para las copias',
124
+ 'de seguridad (por defecto "~") que se',
125
+ 'a�ade al nombre del fichero de datos' ],
126
+ :converter_backupext_error => [ "La extensi�n para copias de seguridad",
127
+ "no debe estar vac�a." ],
128
+ :converter_extension_desc => [ "Especifica la extensi�n de los ficheros",
129
+ "de datos de Ruwiki (por defecto .ruwiki)" ],
130
+ :converter_extension_error => "La extensi�n no debe estar vac�a.",
131
+ :converter_noextension_desc => [ "Indica que los ficheros de datos de",
132
+ "Ruwiki no tienen ninguna extensi�n." ],
133
+ :converter_quiet_desc => [ "Ejecuci�n silenciosa. Por defecto se ",
134
+ "ejecuta con mensajes normales." ],
135
+ :converter_language_desc => [ "Especifica el idioma a emplear con LANG.",
136
+ "Por defecto 'en' (ingl�s).",
137
+ "Idiomas disponibles: en es de" ],
138
+ :converter_verbose_desc => [ "Informaci�n detallada de ejecuci�n.",
139
+ "Por defecto se ejecuta con un nivel de ",
140
+ "detalle inferior." ],
141
+ :converter_help_desc => [ "Mostrar este texto." ],
142
+ :converter_num_arguments => "Error: n�mero de argumentos insuficiente.",
143
+ :converter_directory => "directorio",
144
+ :converter_converting_from => "convertiendo de %1$s a %2$s ... ",
145
+ :converter_done => "hecho.",
146
+ :converter_not_ruwiki => "no es un fichero de Ruwiki; ignorando.",
147
+ :converter_nosave_modified => "no pudo salvarse %1$s.",
148
+ :converter_page_format_error => "Error: No pudo detectarse el formato de la p�gina.",
149
+
150
+ # Messages from Ruwiki::Utils::Manager
151
+ :manager_unknown_command => "Comando desconocido: %1$s",
152
+ :manager_help_commands => <<EOH ,
153
+ Los comandos reconocidos por 'ruwiki' son:
154
+
155
+ ruwiki install Instala el entorno por defecto.
156
+ ruwiki package Empaqueta una instalaci�n de Ruwiki.
157
+ ruwiki unpackage Desempaqueta una instalaci�n de Ruwiki.
158
+ ruwiki service Gestiona un Win32::Service para Ruwiki.
159
+
160
+ EOH
161
+ :manager_help_help => <<-EOH ,
162
+ Este es un mensaje de ayuda b�sico con referencias a informaci�n suplementaria
163
+ relativa a esta herramienta de la l�nea de comandos. Intente:
164
+
165
+ ruwiki help commands mostrar todos los comandos de ruwiki
166
+ ruwiki help <COMANDO> mostrar ayuda sobre <COMANDO>
167
+ (p.ej., 'ruwiki help install')
168
+
169
+ EOH
170
+ :manager_missing_parameter => "Falta par�metro para la opci�n: %1$s",
171
+ :manager_dest_not_directory => "El destino (%1$s) no es un directorio.",
172
+ :manager_service_broken => "No pudo crearse un servicio de Win32 al no estar instalado Win32::Service.",
173
+ :manager_install_help => <<-EOH ,
174
+ ruwiki install [OPCIONES] [--to DEST]
175
+
176
+ Crea una instancia de Ruwiki. Por defecto, se instala los ficheros de datos,
177
+ plantillas y la configuraci�n por defecto en el directorio actual. El destino
178
+ puede ser cambiado con la opci�n --to, y los elementos a instalar con la lista
179
+ de OPCIONES, que puede ser delimitada por espacios, comas o puntos y comas.
180
+ As� pues,
181
+
182
+ ruwiki install data;servlet
183
+ ruwiki install data,servlet
184
+ ruwiki install data servlet
185
+
186
+ son equivalentes. Las opciones pueden especificarse en may�sculas/min�sculas.
187
+ Las opciones de instalaci�n son:
188
+
189
+ servlet # Instala el stub para el servlet Ruwiki
190
+ service # Instala el stub para el Win32::Service Ruwiki
191
+ CGI # Instala el script CGI Ruwiki
192
+ data # Instala los datos, plantillas y configuraci�n de Ruwiki
193
+
194
+ Las opciones pueden deshabilitarse precedi�ndolas de un gui�n o 'no':
195
+
196
+ ruwiki install cgi -data
197
+ ruwiki install cgi nodata
198
+
199
+ instalar�n el script CGI pero no los datos.
200
+ EOH
201
+ :manager_package_help => <<-EOH ,
202
+ ruwiki package [FUENTE] [--output PAQUETE] [--replace]
203
+ ruwiki package [FUENTE] [-o PAQUETE] [--replace]
204
+
205
+ Empaqueta los ficheros de Ruwiki (datos, plantillas y ejecutables) de la
206
+ FUENTE especificada o el directorio actual en el archivo de salida
207
+ especificado (o "../%1$s"). Si la FUENTE es un fichero de configuraci�n
208
+ de rukiwi (p.ej. "%2$s"), ser� empleado para determinar la localizaci�n
209
+ y el nombre de los directorios de datos y plantillas.
210
+
211
+ NOTA: El proceso de empaquetado normaliza los nombres de los
212
+ ficheros de datos y plantillas para que sean relativos al
213
+ directorio de desempaquetado. NUNCA ser�n paths absolutos.
214
+
215
+ EOH
216
+ :manager_unpackage_help => <<-EOH ,
217
+ ruwiki unpackage [FUENTE] [--output DIRECTORIO]
218
+ ruwiki unpackage [FUENTE] [-o DIRECTORIO]
219
+
220
+ Desempaqueta el paquete de Ruwiki provisto (por defecto "./%1$s")
221
+ en el directorio indicado (por defecto ".").
222
+ EOH
223
+ :manager_service_lo_argcount => "Argumentos insuficientes: %1$s",
224
+ :manager_service_hi_argcount => "Demasiados argumentos: %1$s",
225
+ :manager_service_help => <<-EOH ,
226
+ ruwiki service install NOMBRE [DESCRIPCION] [opciones]
227
+ ruwiki service start NOMBRE
228
+ ruwiki service stop NOMBRE
229
+ ruwiki service delete NOMBRE
230
+
231
+ Gestiona el servlet Ruwiki para WEBrick como un servicio de Windows, bajo el
232
+ NOMBRE indicado. install soporta adem�s las opciones siguientes:
233
+
234
+ --rubybin RUBYPATH Path del ejecutable Ruby.
235
+ --exec SERVICEPATH Path del ejecutable del servicio.
236
+ --home PATHTOHOME Path del directorio home.
237
+ EOH
238
+ :manager_package_exists => "El paquete %1$s ya existe.",
239
+ :manager_service_installed => "Servicio %1$s instalado.",
240
+ :manager_one_moment => "Un momento, %1$s ...",
241
+ :manager_service_started => "Servicio %1$s iniciado.",
242
+ :manager_service_stopped => "Servicio %1$s parado.",
243
+ :manager_service_deleted => "Servicio %1$s borrado.",
244
+
245
+ # Messages from Ruwiki::Utils::Converter
246
+ # Note to translators: certain words should be left alone. These
247
+ # will be marked in comments. Description lines are restricted to 40
248
+ # characters and should be an array. Use this as a ruler.
249
+ # => [ "----------------------------------------" ]
250
+ :runner_usage => "Modo de empleo: %1$s [opciones]",
251
+ :runner_general_options => "Opciones generales:",
252
+ :runner_saveconfig_desc => [ "Salvar la configuraci�n en FILENAME y",
253
+ "salir. Si no se emplea FILENAME, la",
254
+ "configuraci�n por defecto ser� usada.",
255
+ "Todas las opciones ser�n le�das del",
256
+ "fichero existente y de la l�nea de",
257
+ "comandos y salvadas. El servlet no se",
258
+ "arrancar�. El nombre por defecto es:" ],
259
+ :runner_config_desc => [ "Leer la configuraci�n por defecto de",
260
+ "FILENAME en vez del fichero por defecto",
261
+ "Las opciones especificadas anteriormente",
262
+ "ser�n sobrescritas" ],
263
+ :runner_webrick_options => "Opciones de WEBrick:",
264
+ :runner_port_desc => [ "Ejecutar el servlet Ruwiki en el puerto",
265
+ "especificado; por defecto 8808." ],
266
+ :runner_address_desc => [ "Aceptar �nicamente conexiones desde las",
267
+ "direcciones especificadas (separadas por",
268
+ "comas). Puede usarse repetidamente. Por",
269
+ "defecto todas las direcciones ser�n",
270
+ "aceptadas" ],
271
+ :runner_local_desc => [ "Aceptar �nicamente conexiones locales",
272
+ "(127.0.0.1). Anula las direcciones",
273
+ "indicadas previamente en -A" ],
274
+ :runner_mountpoint_desc => [ "URI relativo en el que Ruwiki estar�",
275
+ 'accesible. Por defecto "/".' ],
276
+ :runner_log_desc => [ "Realizar log de la actividad de WEBrick.",
277
+ "Por defecto se usa --log." ],
278
+ :runner_logfile_desc => [ "Fichero en el que escribir los logs de",
279
+ "WEBrick. Por defecto, el standard error." ],
280
+ :runner_threads_desc => [ "Asigna al threadcount de WEBrick." ],
281
+ :runner_ruwiki_options => "Opciones de Ruwiki:",
282
+ :runner_language_desc => [ 'Idioma de la inferfaz de Ruwiki.',
283
+ 'Por defecto "en". Puede ser "en", ',
284
+ '"de", o "es".' ],
285
+ :runner_webmaster_desc => [ 'Email del webmaster de Ruwiki.',
286
+ 'Por defecto "webmaster@domain.tld".' ],
287
+ :runner_debug_desc => [ 'Activa debugging de Ruwiki. Por defecto',
288
+ 'inhabilitado.' ],
289
+ :runner_title_desc => 'T�tulo del Ruwiki. Por defecto "Ruwiki".',
290
+ :runner_defaultpage_desc => [ 'P�gina por defecto alternativa; por',
291
+ 'defecto "ProjectIndex".' ],
292
+ :runner_defaultproject_desc => [ 'Proyecto por defecto. Por defecto',
293
+ '"Default".' ],
294
+ :runner_templatepath_desc => [ 'Localizaci�n de las plantillas.',
295
+ 'Por defecto "./templates".' ],
296
+ :runner_templatename_desc => [ 'Nombre de las plantillas. Por defecto',
297
+ '"default".' ],
298
+ :runner_cssname_desc => [ 'Nombre del fichero CSS en el directorio',
299
+ 'de plantillas. Por defecto "ruwiki.css".' ],
300
+ :runner_storage_desc => [ 'Tipo de almacenamiento:' ],
301
+ :runner_datapath_desc => [ 'Path donde salvar los ficheros de datos.',
302
+ 'Por defecto; "./data".' ],
303
+ :runner_extension_desc => [ 'Extensi�n para ficheros de datos.',
304
+ 'Por defecto "ruwiki".' ],
305
+ :runner_central_desc => [ 'Ejecuta Ruwiki con los datos del',
306
+ 'directorio RubyGem.' ],
307
+ :runner_general_info => "Informaci�n general:",
308
+ :runner_help_desc => [ "Muestra este texto." ],
309
+ :runner_version_desc => [ "Muestra la versi�n de Ruwiki." ],
310
+ :runner_rejected_address => "Direcci�n remota %1$s rechazada. S�lo se admiten conexiones desde %2$s.",
311
+ :runner_banner => <<-BANNER ,
312
+ %1$s
313
+
314
+ Opciones de WEBrick:
315
+ Puerto %2$d
316
+ Direcciones admitidas %3$s
317
+ Punto de montaje %4$s
318
+ Logging? %5$s
319
+ Destino del log %6$s
320
+ Hebras %7$s
321
+
322
+ Opciones de Ruwiki:
323
+ Webmaster %8$s
324
+ Debugging? %9$s
325
+ T�tulo %10$s
326
+ Proyecto por defecto %11$s
327
+ P�gina por defecto %12$s
328
+ Path para plantillas %13$s
329
+ Conjunto de plantillas %14$s
330
+ Fuente CSS %15$s
331
+
332
+ Tipo de almacenamiento %16$s
333
+ Path de datos %17$s
334
+ Extensi�n %18$s
335
+ BANNER
336
+ }
337
+ message.each { |kk, vv| Message[kk] = vv }
338
+ end
339
+ end
@@ -0,0 +1,262 @@
1
+ #--
2
+ # Ruwiki
3
+ # Copyright � 2002 - 2004, Digikata and HaloStatue
4
+ # Alan Chen (alan@digikata.com)
5
+ # Austin Ziegler (ruwiki@halostatue.ca)
6
+ #
7
+ # Licensed under the same terms as Ruby.
8
+ #
9
+ # $Id: page.rb,v 1.13 2004/09/27 04:48:27 austin Exp $
10
+ #++
11
+ require 'ruwiki/exportable'
12
+
13
+ # The page class for Ruwiki. The page defines the data and meta-data for a
14
+ # page.
15
+ class Ruwiki::Page
16
+ include Ruwiki::Exportable
17
+
18
+ exportable_group 'ruwiki'
19
+ # Returns the content version of the page. If the page has a greater
20
+ # content version than this version of Ruwiki does, we should probably
21
+ # throw an exception, because attempting to save such a page will cause
22
+ # a loss of data. Immutable.
23
+ #
24
+ # Class:: +ruwiki+
25
+ # ID:: +content-version+
26
+ attr_reader :content_version
27
+ exportable :content_version
28
+ # Returns the version of Ruwiki from which this page was generated.
29
+ # Informational only. Immutable.
30
+ #
31
+ # Class:: +ruwiki+
32
+ # ID:: +version+
33
+ attr_reader :ruwiki_version
34
+ exportable :ruwiki_version, :name => 'version'
35
+
36
+ exportable_group 'properties'
37
+ # Returns or sets the displayed title of the page, which may differ from
38
+ # the topic of the page. As of Ruwiki 0.8.0, this is not currently used
39
+ # and it may disappear.
40
+ #
41
+ # Class:: +properties+
42
+ # ID:: +title+
43
+ attr_accessor :title
44
+ exportable :title
45
+ # Returns or sets the topic of the page, which may differ from the
46
+ # title. This is used to set the topic on a page being saved.
47
+ #
48
+ # Class:: +properties+
49
+ # ID:: +topic+
50
+ attr_accessor :topic
51
+ exportable :topic
52
+ # Returns or sets the project of the page, which may differ from the
53
+ # title. This is used to set the project on a page being saved.
54
+ #
55
+ # Class:: +properties+
56
+ # ID:: +project+
57
+ attr_accessor :project
58
+ exportable :project
59
+ # Returns or sets the creator of the page. Unless we know the user
60
+ # (through the authentication mechanism, only partially implemented for
61
+ # Ruwiki 0.9.0), this will be +nil+.
62
+ #
63
+ # Class:: +properties+
64
+ # ID:: +creator+
65
+ attr_accessor :creator
66
+ exportable :creator
67
+ # Returns or sets the creator's IP address. This should always be set.
68
+ # It will have a value of "UNKNOWN" on the off-chance that something
69
+ # prevents this from working.
70
+ #
71
+ # Class:: +properties+
72
+ # ID:: +creator-ip+
73
+ attr_accessor :creator_ip
74
+ exportable :creator_ip
75
+ # Returns or sets the date of creation.
76
+ #
77
+ # Class:: +properties+
78
+ # ID:: +create-date+
79
+ attr_accessor :create_date
80
+ exportable :create_date
81
+ # Returns or sets the last editor of the page. Unless we know the user
82
+ # (through the authentication mechanism, only partially implemented for
83
+ # Ruwiki 0.9.0), this will be +nil+.
84
+ #
85
+ # Class:: +properties+
86
+ # ID:: +editor+
87
+ attr_accessor :editor
88
+ exportable :editor
89
+ # Returns or sets the last editor's IP address. This should always be
90
+ # set. It will have a value of "UNKNOWN" on the off-chance that
91
+ # something prevents this from working.
92
+ #
93
+ # Class:: +properties+
94
+ # ID:: +editor-ip+
95
+ attr_accessor :editor_ip
96
+ exportable :editor_ip
97
+ # Returns or sets the date of the last edit.
98
+ #
99
+ # Class:: +properties+
100
+ # ID:: +edit-date+
101
+ attr_accessor :edit_date
102
+ exportable :edit_date
103
+ # Indicates whether the page is editable. Non-editable pages are
104
+ # effectively static pages.
105
+ #
106
+ # Class:: +properties+
107
+ # ID:: +editable+
108
+ attr_accessor :editable
109
+ exportable :editable
110
+ # Indicates whether the page is indexable. Non-indexable pages are
111
+ # invisible to compliant web robots, and their links may not be
112
+ # followed.
113
+ #
114
+ # Class:: +properties+
115
+ # ID:: +indexable+
116
+ attr_accessor :indexable
117
+ exportable :indexable
118
+ # The current version of the page. The old version is always (#version
119
+ # - 1).
120
+ #
121
+ # Class:: +properties+
122
+ # ID:: +version+
123
+ attr_accessor :version
124
+ exportable :version
125
+ # An array of complete tags that will appear in the HTML <HEAD> section.
126
+ # Can be used to specify additional CSS, <META> tags, or even JavaScript
127
+ # on a per-page basis. Currently unused.
128
+ #
129
+ # Class:: +properties+
130
+ # ID:: +html-headers+
131
+ attr_accessor :html_headers
132
+ exportable :html_headers
133
+ # The entropy of the page. This is a ratio of the number of lines
134
+ # changed in the file vs. the total number of lines in the file. This
135
+ # value is currently unused. (And, sad to say, I don't remember why
136
+ # I included it. However, it's an interesting value that may be useful
137
+ # in spam fighting techniques. It is currently stored in the meta-data,
138
+ # but that may change moving forward.)
139
+ #
140
+ # Class:: +properties+
141
+ # ID:: +entropy+
142
+ attr_reader :entropy
143
+ exportable :entropy
144
+ # The edit comment for the current revision of the page.
145
+ #
146
+ # Class:: +properties+
147
+ # ID:: +edit-comment+
148
+ attr_accessor :edit_comment
149
+ exportable :edit_comment
150
+
151
+ exportable_group 'page'
152
+ # The header content of the page. This is static content (in either Wiki
153
+ # or HTML formats) that appears before the editable contents of the
154
+ # page. If both this and Wiki-level header content are specified, this
155
+ # will appear *after* the Wiki-level header content.
156
+ #
157
+ # Class:: +page+
158
+ # ID:: +header+
159
+ attr_accessor :header
160
+ exportable :header
161
+ # The footer content of the page. This is static content (in either Wiki
162
+ # or HTML formats) that appears before the editable contents of the
163
+ # page. If both this and Wiki-level footer content are specified, this
164
+ # will appear *before* the Wiki-level footer content.
165
+ #
166
+ # Class:: +page+
167
+ # ID:: +footer+
168
+ attr_accessor :footer
169
+ exportable :footer
170
+ # The editable unformatted Wiki content of the page.
171
+ #
172
+ # Class:: +page+
173
+ # ID:: +content+
174
+ attr_accessor :content
175
+ exportable :content
176
+
177
+ # Creates a Ruwiki page. This must be created from the canonical export
178
+ # hash.
179
+ def initialize(exported = {})
180
+ ruwiki = exported['ruwiki']
181
+ @content_version = (ruwiki['content-version'] || Ruwiki::CONTENT_VERSION).to_i
182
+ @ruwiki_version = ruwiki['version'] || Ruwiki::VERSION
183
+
184
+ props = exported['properties']
185
+ @title = props['title']
186
+ @topic = props['topic'] || "NewTopic"
187
+ @project = props['project'] || "Default"
188
+ @creator = props['creator'] || ""
189
+ @creator_ip = props['creator-ip'] || "UNKNOWN"
190
+ @create_date = Time.at((props['create-date'] || Time.now).to_i)
191
+ @editor = props['editor'] || ""
192
+ @editor_ip = props['editor-ip'] || "UNKNOWN"
193
+ @edit_date = Time.at((props['edit-date'] || Time.now).to_i)
194
+ @edit_comment = props['edit-comment'] || ""
195
+ case props['editable']
196
+ when "false"
197
+ @editable = false
198
+ else
199
+ @editable = true
200
+ end
201
+ case props['indexable']
202
+ when "false"
203
+ @indexable = false
204
+ else
205
+ @indexable = true
206
+ end
207
+ @entropy = (props['entropy'] || 0).to_f
208
+ @html_headers = props['html-headers'] || []
209
+ @version = (props['version'] || 0).to_i
210
+
211
+ page = exported['page']
212
+ @header = page['header'] || ""
213
+ @content = page['content'] || ""
214
+ @footer = page['footer'] || ""
215
+
216
+ # Fix the possibility that the content might be an array of chunks.
217
+ @content = @content.join("") if @content.kind_of?(Array)
218
+
219
+ @content.gsub!(/\r/, "")
220
+ end
221
+
222
+ # Outputs the HTML version of the page.
223
+ def to_html(markup)
224
+ # Normalise the content, first
225
+ @content.gsub!(/\r/, "")
226
+ markup.parse(@content, @project)
227
+ end
228
+
229
+ # Provides the canonical export hash.
230
+ def export
231
+ sym = super
232
+
233
+ sym.each_key do |sect|
234
+ if sect == 'ruwiki'
235
+ sym[sect]['content-version'] = Ruwiki::CONTENT_VERSION
236
+ sym[sect]['version'] = Ruwiki::VERSION
237
+ else
238
+ sym[sect].each_key do |item|
239
+ case [sect, item]
240
+ when ['properties', 'create-date'], ['properties', 'edit-date']
241
+ sym[sect][item] = sym[sect][item].to_i
242
+ when ['properties', 'editable'], ['properties', 'indexable']
243
+ sym[sect][item] = (sym[sect][item] ? 'true' : 'false')
244
+ else
245
+ sym[sect][item] = sym[sect][item].to_s
246
+ end
247
+ end
248
+ end
249
+ end
250
+
251
+ sym
252
+ end
253
+
254
+ NULL_PAGE = {
255
+ 'ruwiki' => {
256
+ 'content-version' => Ruwiki::CONTENT_VERSION,
257
+ 'version' => Ruwiki::VERSION
258
+ },
259
+ 'properties' => { },
260
+ 'page' => { },
261
+ }
262
+ end