instiki 0.9.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. data/CHANGELOG +165 -0
  2. data/README +68 -172
  3. data/app/controllers/admin_controller.rb +94 -0
  4. data/app/controllers/application.rb +131 -0
  5. data/app/controllers/file_controller.rb +129 -0
  6. data/app/controllers/wiki_controller.rb +354 -0
  7. data/{libraries/view_helper.rb → app/helpers/application_helper.rb} +68 -33
  8. data/app/models/author.rb +3 -3
  9. data/app/models/chunks/category.rb +33 -31
  10. data/app/models/chunks/chunk.rb +86 -20
  11. data/app/models/chunks/engines.rb +54 -38
  12. data/app/models/chunks/include.rb +41 -29
  13. data/app/models/chunks/literal.rb +31 -19
  14. data/app/models/chunks/nowiki.rb +28 -31
  15. data/app/models/chunks/test.rb +18 -18
  16. data/app/models/chunks/uri.rb +182 -97
  17. data/app/models/chunks/wiki.rb +141 -82
  18. data/app/models/file_yard.rb +58 -0
  19. data/app/models/page.rb +112 -86
  20. data/app/models/page_lock.rb +22 -23
  21. data/app/models/page_set.rb +89 -64
  22. data/app/models/revision.rb +123 -90
  23. data/app/models/web.rb +176 -89
  24. data/app/models/wiki_content.rb +207 -105
  25. data/app/models/wiki_service.rb +233 -83
  26. data/app/models/wiki_words.rb +23 -25
  27. data/app/views/{wiki/new_system.rhtml → admin/create_system.rhtml} +83 -78
  28. data/app/views/{wiki/new_web.rhtml → admin/create_web.rhtml} +69 -64
  29. data/app/views/admin/edit_web.rhtml +136 -0
  30. data/app/views/file/file.rhtml +19 -0
  31. data/app/views/file/import.rhtml +23 -0
  32. data/app/views/layouts/default.rhtml +85 -0
  33. data/app/views/markdown_help.rhtml +12 -16
  34. data/app/views/mixed_help.rhtml +7 -0
  35. data/app/views/navigation.rhtml +30 -19
  36. data/app/views/rdoc_help.rhtml +12 -16
  37. data/app/views/textile_help.rhtml +24 -28
  38. data/app/views/wiki/authors.rhtml +11 -13
  39. data/app/views/wiki/edit.rhtml +39 -31
  40. data/app/views/wiki/export.rhtml +12 -14
  41. data/app/views/wiki/feeds.rhtml +14 -10
  42. data/app/views/wiki/list.rhtml +64 -57
  43. data/app/views/wiki/locked.rhtml +23 -14
  44. data/app/views/wiki/login.rhtml +14 -11
  45. data/app/views/wiki/new.rhtml +31 -27
  46. data/app/views/wiki/page.rhtml +115 -81
  47. data/app/views/wiki/print.rhtml +14 -16
  48. data/app/views/wiki/published.rhtml +9 -10
  49. data/app/views/wiki/recently_revised.rhtml +27 -30
  50. data/app/views/wiki/revision.rhtml +103 -81
  51. data/app/views/wiki/rollback.rhtml +14 -9
  52. data/app/views/wiki/rss_feed.rhtml +22 -22
  53. data/app/views/wiki/search.rhtml +38 -15
  54. data/app/views/wiki/tex.rhtml +22 -22
  55. data/app/views/wiki/tex_web.rhtml +34 -34
  56. data/app/views/wiki/web_list.rhtml +18 -13
  57. data/app/views/wiki_words_help.rhtml +9 -8
  58. data/config/environment.rb +82 -0
  59. data/config/environments/development.rb +5 -0
  60. data/config/environments/production.rb +4 -0
  61. data/config/environments/test.rb +17 -0
  62. data/config/routes.rb +18 -0
  63. data/instiki +6 -67
  64. data/instiki.rb +3 -0
  65. data/lib/active_record_stub.rb +31 -0
  66. data/{libraries/diff → lib}/diff.rb +444 -475
  67. data/lib/instiki_errors.rb +15 -0
  68. data/{libraries → lib}/rdocsupport.rb +151 -155
  69. data/lib/redcloth_for_tex.rb +736 -0
  70. data/natives/osx/desktop_launcher/AppDelegate.h +18 -0
  71. data/natives/osx/desktop_launcher/AppDelegate.mm +109 -0
  72. data/natives/osx/desktop_launcher/Credits.html +16 -0
  73. data/natives/osx/desktop_launcher/English.lproj/InfoPlist.strings +0 -0
  74. data/natives/osx/desktop_launcher/English.lproj/MainMenu.nib/classes.nib +13 -0
  75. data/natives/osx/desktop_launcher/English.lproj/MainMenu.nib/info.nib +24 -0
  76. data/natives/osx/desktop_launcher/English.lproj/MainMenu.nib/objects.nib +0 -0
  77. data/natives/osx/desktop_launcher/Info.plist +13 -0
  78. data/natives/osx/desktop_launcher/Instiki.xcode/project.pbxproj +592 -0
  79. data/natives/osx/desktop_launcher/Instiki_Prefix.pch +7 -0
  80. data/natives/osx/desktop_launcher/MakeDMG.sh +9 -0
  81. data/natives/osx/desktop_launcher/main.mm +14 -0
  82. data/natives/osx/desktop_launcher/version.plist +16 -0
  83. data/public/404.html +6 -0
  84. data/public/500.html +6 -0
  85. data/public/dispatch.rb +10 -0
  86. data/public/favicon.ico +0 -0
  87. data/public/javascripts/edit_web.js +52 -0
  88. data/public/javascripts/prototype.js +336 -0
  89. data/{app/views/static_style_sheet.rhtml → public/stylesheets/instiki.css} +221 -198
  90. data/script/breakpointer +4 -0
  91. data/script/server +93 -0
  92. metadata +59 -32
  93. data/app/controllers/wiki.rb +0 -389
  94. data/app/models/chunks/match.rb +0 -19
  95. data/app/views/bottom.rhtml +0 -4
  96. data/app/views/top.rhtml +0 -49
  97. data/app/views/wiki/edit_web.rhtml +0 -138
  98. data/libraries/action_controller_servlet.rb +0 -177
  99. data/libraries/erb.rb +0 -490
  100. data/libraries/madeleine_service.rb +0 -68
  101. data/libraries/redcloth_for_tex.rb +0 -869
  102. data/libraries/web_controller_server.rb +0 -81
@@ -1,81 +0,0 @@
1
- require 'webrick'
2
- include WEBrick
3
-
4
- # Terminology:
5
- # * Static controller: Is a controller that has all it's show_* and do_* methods mounted by the server
6
- # at server start, so the server will handle request rejection of invalid requests
7
- # * Dynamic controller: Is a controller that's mounted with a responsibility to handle all the request mapping
8
- # itself. Hence, the server will never reject a request that's below the controller in the path.
9
- class WebControllerServer
10
- STATIC_MOUNTING = 1
11
- DYNAMIC_MOUNTING = 2
12
-
13
- MOUNT_TYPE = DYNAMIC_MOUNTING
14
-
15
- SERVER_TYPE = (RUBY_PLATFORM =~ /mswin/ ? SimpleServer : Daemon)
16
-
17
- def initialize(port, server_type, controller_path)
18
- @server = WEBrick::HTTPServer::new(:Port => port, :ServerType => server_type || SERVER_TYPE)
19
- @server.logger.info "Your WEBrick server is now running on http://localhost:#{port}"
20
- @controller_path = controller_path
21
- mount_controllers
22
- start_server
23
- end
24
-
25
- private
26
- # Mounts all the controllers in the controller_path according to the mount type
27
- def mount_controllers
28
- require_controller_files
29
-
30
- case MOUNT_TYPE
31
- when STATIC_MOUNTING then controller_names.each { |name| mount_static_controller(name) }
32
- when DYNAMIC_MOUNTING then controller_names.each { |name| mount_dynamic_controller(name) }
33
- end
34
- end
35
-
36
- # Mounts the controller specified by <tt>controller_name</tt> to accept all requests below it's path.
37
- # If more than one controller is mounted by this WebControllerServer, the controller is mounted by name,
38
- # such that fx WikiController would get the requests of "/wiki/something" and "/wiki/some/thing/else".
39
- # If only one controller is mounted, all requests to this WebControllerServer is handled by that controller
40
- def mount_dynamic_controller(controller_name)
41
- mount_path = mounting_multiple_controllers? ? "/#{controller_name}" : "/"
42
- @server.mount(mount_path, controller_class(controller_name))
43
- end
44
-
45
- # Mount all public show_* and do_* methods as actions tied to the controller specified by <tt>controller_name</tt>.
46
- # If more than one controller is mounted by this WebControllerServer, the actions are mounted below the controller
47
- # in the path, such as "/wiki/page" or "/wiki/list". If only one controller is mounted, they're mounted directly on
48
- # the root, such as "/page" or "/list"
49
- def mount_static_controller(controller_name)
50
- controller_class(controller_name).public_instance_methods(false).each { |method|
51
- mount_path = (mounting_multiple_controllers? ? "/#{controller_name}" : "") + "/#{method}"
52
- @server.mount(mount_path, controller_class(controller_name))
53
- }
54
- end
55
-
56
- # Requires all the controller files that are present in the controller_path
57
- def require_controller_files
58
- controller_names.each { |controller| require @controller_path + controller }
59
- end
60
-
61
- # Returns true if more than one controller exists in the controller_path
62
- def mounting_multiple_controllers?
63
- controller_names.length > 1
64
- end
65
-
66
- # Returns a list of controller names in lower-case from the controller path
67
- def controller_names
68
- Dir.entries(@controller_path).delete_if { |file| file !~ /rb$/ }.collect{ |c| c[0..-4] }
69
- end
70
-
71
- # Returns the class of the controller specified by the <tt>controller_name</tt>
72
- def controller_class(controller_name)
73
- eval(controller_name.capitalize + "Controller")
74
- end
75
-
76
- # Start accepting requests to the defined mount points
77
- def start_server
78
- trap("INT") { @server.shutdown }
79
- @server.start
80
- end
81
- end