olelo 0.9.3 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. data/.travis.yml +4 -0
  2. data/Rakefile +6 -12
  3. data/bin/olelo +13 -8
  4. data/config.ru +21 -15
  5. data/config/aspects.rb +45 -32
  6. data/config/config.yml.default +1 -0
  7. data/config/initializers/00-mime_types.rb +22 -17
  8. data/config/initializers/01-slim.rb +2 -2
  9. data/lib/olelo.rb +1 -8
  10. data/lib/olelo/application.rb +33 -34
  11. data/lib/olelo/attributes.rb +4 -4
  12. data/lib/olelo/extensions.rb +0 -7
  13. data/lib/olelo/helper.rb +13 -25
  14. data/lib/olelo/html_safe.rb +0 -4
  15. data/lib/olelo/locale.yml +6 -3
  16. data/lib/olelo/menu.rb +1 -1
  17. data/lib/olelo/page.rb +21 -18
  18. data/lib/olelo/version.rb +1 -1
  19. data/olelo.gemspec +5 -3
  20. data/plugins/aspects/changelog.rb +5 -5
  21. data/plugins/aspects/documentbrowser.rb +5 -5
  22. data/plugins/{gallery → aspects/gallery}/gallery.css +0 -0
  23. data/plugins/{gallery → aspects/gallery}/gallery.scss +0 -0
  24. data/plugins/{gallery → aspects/gallery}/main.rb +3 -3
  25. data/plugins/aspects/highlight.rb +1 -1
  26. data/plugins/aspects/image.rb +1 -1
  27. data/plugins/aspects/imageinfo.rb +3 -3
  28. data/plugins/aspects/main.rb +21 -21
  29. data/plugins/aspects/pageinfo.rb +2 -2
  30. data/plugins/aspects/source.rb +1 -1
  31. data/plugins/aspects/subpages.rb +7 -7
  32. data/plugins/aspects/text.rb +1 -1
  33. data/plugins/authentication/portal.rb +2 -2
  34. data/plugins/authentication/yamlfile.rb +1 -1
  35. data/plugins/blog/main.rb +10 -10
  36. data/plugins/editor/preview.rb +3 -3
  37. data/plugins/filters/creole.rb +1 -1
  38. data/plugins/filters/editsection.rb +2 -2
  39. data/plugins/filters/html2xml.rb +6 -0
  40. data/plugins/filters/main.rb +1 -1
  41. data/plugins/filters/remind/main.rb +15 -0
  42. data/plugins/filters/remind/rem2html +562 -0
  43. data/plugins/filters/s5/main.rb +1 -1
  44. data/plugins/login/persistent.rb +1 -1
  45. data/plugins/misc/system.rb +4 -0
  46. data/plugins/misc/variables.rb +1 -1
  47. data/plugins/misc/webdav.rb +10 -10
  48. data/plugins/repositories/git_grep.rb +2 -2
  49. data/plugins/repositories/gitrb_repository.rb +10 -10
  50. data/plugins/repositories/rugged_repository.rb +7 -7
  51. data/plugins/tags/code.rb +1 -1
  52. data/plugins/tags/footnotes.rb +4 -3
  53. data/plugins/tags/gist.rb +2 -2
  54. data/plugins/tags/html.rb +11 -11
  55. data/plugins/tags/include.rb +6 -6
  56. data/plugins/tags/main.rb +10 -10
  57. data/plugins/tags/math.rb +2 -2
  58. data/plugins/tags/redirect.rb +3 -3
  59. data/plugins/tags/scripting.rb +12 -12
  60. data/plugins/tags/sort.rb +1 -1
  61. data/plugins/tags/tabs.rb +1 -1
  62. data/plugins/treeview/main.rb +3 -3
  63. data/plugins/treeview/script.js +5 -5
  64. data/plugins/treeview/script/00-jquery.treeview.js +6 -6
  65. data/plugins/treeview/script/init.js +1 -1
  66. data/plugins/utils/assets.rb +4 -4
  67. data/plugins/utils/cache.rb +10 -6
  68. data/plugins/utils/store.rb +4 -4
  69. data/static/script.js +124 -126
  70. data/static/script/{02-jquery.js → 01-jquery.js} +0 -0
  71. data/static/script/02-olelo.storage.js +54 -0
  72. data/static/script/10-olelo.historytable.js +2 -2
  73. data/static/script/13-olelo.tabwidget.js +2 -2
  74. data/test/helper.rb +5 -4
  75. data/test/page_test.rb +1 -1
  76. data/test/request_test.rb +42 -38
  77. data/test/string_extensions_test.rb +0 -6
  78. data/test/templates_test.rb +1 -1
  79. data/test/util_test.rb +1 -1
  80. data/views/changes.slim +2 -2
  81. data/views/compare.slim +4 -4
  82. data/views/delete.slim +2 -2
  83. data/views/deleted.slim +1 -1
  84. data/views/edit.slim +31 -26
  85. data/views/history.slim +5 -5
  86. data/views/layout.slim +1 -1
  87. data/views/login.slim +30 -32
  88. data/views/move.slim +3 -3
  89. data/views/profile.slim +2 -2
  90. data/views/show.slim +1 -1
  91. metadata +43 -104
  92. data/static/script/01-jstorage.js +0 -217
@@ -0,0 +1,4 @@
1
+ rvm:
2
+ - 1.9.3
3
+ - ruby-head
4
+ - rbx-19mode
data/Rakefile CHANGED
@@ -1,4 +1,4 @@
1
- task :default => %w(test:spec)
1
+ task default: %w(test:spec)
2
2
 
3
3
  def shrink_js(t)
4
4
  #sh "cat #{t.prerequisites.sort.join(' ')} > #{t.name}"
@@ -36,10 +36,10 @@ file('plugins/editor/markup/script.js' => Dir.glob('plugins/editor/markup/script
36
36
 
37
37
  namespace :gen do
38
38
  desc('Shrink JS files')
39
- task :js => %w(static/script.js plugins/treeview/script.js plugins/misc/fancybox/script.js plugins/editor/markup/script.js)
39
+ task js: %w(static/script.js plugins/treeview/script.js plugins/misc/fancybox/script.js plugins/editor/markup/script.js)
40
40
 
41
41
  desc('Compile CSS files')
42
- task :css => %w(static/themes/atlantis/style.css
42
+ task css: %w(static/themes/atlantis/style.css
43
43
  plugins/treeview/treeview.css
44
44
  plugins/utils/pygments.css
45
45
  plugins/gallery/gallery.css
@@ -49,12 +49,12 @@ end
49
49
 
50
50
  namespace :test do
51
51
  desc 'Run tests with bacon'
52
- task :spec => FileList['test/*_test.rb'] do |t|
52
+ task spec: FileList['test/*_test.rb'] do |t|
53
53
  sh "bacon -q -Ilib:test #{t.prerequisites.join(' ')}"
54
54
  end
55
55
 
56
56
  desc 'Generate test coverage report'
57
- task :rcov => FileList['test/*_test.rb'] do |t|
57
+ task rcov: FileList['test/*_test.rb'] do |t|
58
58
  sh "rcov -Ilib:test #{t.prerequisites.join(' ')}"
59
59
  end
60
60
  end
@@ -64,15 +64,9 @@ task :clean do |t|
64
64
  FileUtils.rm_rf 'doc/api'
65
65
  FileUtils.rm_rf 'coverage'
66
66
  FileUtils.rm_rf '.wiki/cache'
67
- FileUtils.rm_rf '.wiki/blahtex'
68
67
  FileUtils.rm_rf '.wiki/log'
69
68
  end
70
69
 
71
- desc 'Remove wiki folder'
72
- task 'clean:all' => :clean do |t|
73
- FileUtils.rm_rf '.wiki'
74
- end
75
-
76
70
  desc 'Generate documentation'
77
71
  namespace :doc do
78
72
  task :gen do; system("yard doc -o doc/api 'lib/**/*.rb' 'plugins/**/*.rb'"); end
@@ -89,4 +83,4 @@ namespace :notes do
89
83
  end
90
84
 
91
85
  desc 'Show annotations'
92
- task :notes => %w(notes:todo notes:fixme notes:hack notes:warning notes:important)
86
+ task notes: %w(notes:todo notes:fixme notes:hack notes:warning notes:important)
data/bin/olelo CHANGED
@@ -11,8 +11,8 @@ Options:
11
11
  }
12
12
 
13
13
  options = {
14
- :port => 8080,
15
- :host => '0.0.0.0'
14
+ port: 8080,
15
+ host: '0.0.0.0'
16
16
  }
17
17
 
18
18
  app_path = File.expand_path(File.join(__FILE__, '..', '..'))
@@ -20,15 +20,19 @@ app_path = File.expand_path(File.join(__FILE__, '..', '..'))
20
20
  opts = OptionParser.new do |opts|
21
21
  opts.banner = help
22
22
 
23
- opts.on('-p', '--port [PORT]', 'Bind port (default 8080).') do |port|
23
+ opts.on('-p', '--port PORT', 'Bind port (default 8080).') do |port|
24
24
  options[:port] = port.to_i
25
25
  end
26
26
 
27
- opts.on('-o', '--host [HOST]', 'Hostname or IP address to listen on (default 0.0.0.0).') do |host|
27
+ opts.on('-o', '--host HOST', 'Hostname or IP address to listen on (default 0.0.0.0).') do |host|
28
28
  options[:host] = host
29
29
  end
30
30
 
31
- opts.on('-c', '--config [CONFIG]', 'Path to the Olelo configuration, sets the $OLELO_CONFIG environment variable.') do |config|
31
+ opts.on('-s', '--server SERVER', 'serve using SERVER (webrick/mongrel)') do |server|
32
+ options[:server] = server
33
+ end
34
+
35
+ opts.on('-c', '--config CONFIG', 'Path to the Olelo configuration, sets the $OLELO_CONFIG environment variable.') do |config|
32
36
  ENV['OLELO_CONFIG'] = File.expand_path(config)
33
37
  end
34
38
 
@@ -53,6 +57,7 @@ elsif ARGV.size > 1
53
57
  exit
54
58
  end
55
59
 
56
- Rack::Server.start(:Port => options[:port],
57
- :Host => options[:host],
58
- :config => File.join(app_path, 'config.ru'))
60
+ Rack::Server.start(Port: options[:port],
61
+ Host: options[:host],
62
+ server: options[:server],
63
+ config: File.join(app_path, 'config.ru'))
data/config.ru CHANGED
@@ -24,28 +24,34 @@ Olelo::Config.instance['themes_path'] = ::File.join(app_path, 'static', 'themes'
24
24
  Olelo::Config.instance['rack.session_secret'] = SecureRandom.hex
25
25
  Olelo::Config.instance.load!(::File.join(app_path, 'config', 'config.yml.default'))
26
26
 
27
+ config_file = ENV['OLELO_CONFIG'] || ENV['WIKI_CONFIG']
28
+ unless config_file
29
+ path = ::File.join(app_path, 'config', 'config.yml')
30
+ config_file = path if File.exists?(path)
31
+ end
32
+
27
33
  if Dir.pwd == app_path
28
34
  puts "Serving from Olelo application directory #{app_path}"
29
35
  data_path = File.join(app_path, '.wiki')
30
- Olelo::Config.instance['repository.git'] = { :path => ::File.join(data_path, 'repository'), :bare => false }
31
- Olelo::Config.instance['cache_store'] = { :type => 'file', 'file.root' => ::File.join(data_path, 'cache') }
36
+ Olelo::Config.instance['repository.git'] = { path: ::File.join(data_path, 'repository'), bare: false }
37
+ Olelo::Config.instance['cache_store'] = { type: 'file', 'file.root' => ::File.join(data_path, 'cache') }
32
38
  Olelo::Config.instance['authentication.yamlfile.store'] = ::File.join(data_path, 'users.yml')
33
39
  Olelo::Config.instance['log.file'] = ::File.join(data_path, 'log')
34
40
  elsif File.directory?(::File.join(Dir.pwd, '.git'))
35
41
  puts "Serving out of repository #{Dir.pwd}"
36
42
  data_path = File.join(Dir.pwd, '.wiki')
37
- Olelo::Config.instance['repository.git'] = { :path => Dir.pwd, :bare => false }
38
- Olelo::Config.instance['cache_store'] = { :type => 'file', 'file.root' => ::File.join(data_path, 'cache') }
43
+ Olelo::Config.instance['repository.git'] = { path: Dir.pwd, bare: false }
44
+ Olelo::Config.instance['cache_store'] = { type: 'file', 'file.root' => ::File.join(data_path, 'cache') }
39
45
  Olelo::Config.instance['authentication.yamlfile.store'] = ::File.join(data_path, 'users.yml')
40
46
  Olelo::Config.instance['log.file'] = ::File.join(data_path, 'log')
41
- else
42
- puts 'No default data storage location defined, please create your own configuration!'
47
+ elsif !config_file
48
+ puts 'No git repository found, please create your own configuration file!'
49
+ exit 1
43
50
  end
44
51
 
45
- if config = ENV['OLELO_CONFIG'] || ENV['WIKI_CONFIG']
46
- Olelo::Config.instance.load!(config)
47
- else
48
- Olelo::Config.instance.load(::File.join(app_path, 'config', 'config.yml'))
52
+ if config_file
53
+ puts "Loading configuration from #{config_file}"
54
+ Olelo::Config.instance.load!(config_file)
49
55
  end
50
56
 
51
57
  Olelo::Config.instance.freeze
@@ -54,6 +60,8 @@ FileUtils.mkpath ::File.dirname(Olelo::Config['log.file'])
54
60
  logger = ::Logger.new(Olelo::Config['log.file'], :monthly, 10240000)
55
61
  logger.level = ::Logger.const_get(Olelo::Config['log.level'])
56
62
 
63
+ Olelo::Initializer.initialize(logger)
64
+
57
65
  # Doesn't work currently, rack issue #241
58
66
  # if !Olelo::Config['production']
59
67
  # # Rack::Lint injector
@@ -77,8 +85,8 @@ if Olelo::Config['rack.deflater']
77
85
  use Rack::Deflater
78
86
  end
79
87
 
80
- use Rack::StaticCache, :urls => ['/static'], :root => app_path
81
- use Rack::Session::Cookie, :key => 'olelo.session', :secret => Olelo::Config['rack.session_secret']
88
+ use Rack::StaticCache, urls: ['/static'], root: app_path
89
+ use Rack::Session::Cookie, key: 'olelo.session', secret: Olelo::Config['rack.session_secret']
82
90
  use Olelo::Middleware::DegradeMimeType
83
91
 
84
92
  class LoggerOutput
@@ -89,10 +97,8 @@ end
89
97
  use Rack::MethodOverride
90
98
  use Rack::CommonLogger, LoggerOutput.new(logger)
91
99
  use Olelo::Middleware::ForceEncoding
92
- use Olelo::Middleware::Flash, :set_accessors => %w(error warn info)
100
+ use Olelo::Middleware::Flash, set_accessors: %w(error warn info)
93
101
  use Rack::RelativeRedirect
94
-
95
- Olelo::Initializer.initialize(logger)
96
102
  run Olelo::Application.new
97
103
 
98
104
  logger.info "Olelo started in #{Olelo::Config['production'] ? 'production' : 'development'} mode"
@@ -47,9 +47,9 @@ regexp :mediawiki_nowiki, /<nowiki>.*?<\/nowiki>/m, '<notags>\0</notags>'
47
47
  # end
48
48
  #
49
49
  # tag filter options:
50
- # tag(:enable => 'html:*') Enable only html tags
51
- # tag(:disable => %w(html:* scripting:include)) Disable html tags and scripting:include
52
- # tag(:disable => 'html:*') Disable only html tags
50
+ # tag(enable: 'html:*') Enable only html tags
51
+ # tag(disable: %w(html:* scripting:include)) Disable html tags and scripting:include
52
+ # tag(disable: 'html:*') Disable only html tags
53
53
  #
54
54
  ################################################################################
55
55
 
@@ -67,7 +67,7 @@ aspect :page do
67
67
  remove_comments.tag_shortcuts
68
68
  creole_nowiki.tag { creole!.rubypants }
69
69
  end
70
- toc.interwiki(:map => interwiki_map).link_classifier
70
+ toc.interwiki(map: interwiki_map).link_classifier
71
71
  end
72
72
  end
73
73
 
@@ -78,7 +78,7 @@ aspect :s5 do
78
78
  filter do
79
79
  remove_comments.tag_shortcuts
80
80
  creole_nowiki.tag { creole!.rubypants }
81
- toc.interwiki(:map => interwiki_map).link_classifier
81
+ toc.interwiki(map: interwiki_map).link_classifier
82
82
  html_wrapper!.s5!
83
83
  end
84
84
  end
@@ -89,9 +89,9 @@ aspect :latex do
89
89
  mime 'text/plain; charset=utf-8'
90
90
  filter do
91
91
  remove_comments.tag_shortcuts.creole_nowiki
92
- tag(:static => true) { creole!.rubypants }
93
- toc.interwiki(:map => interwiki_map)
94
- html_wrapper!.xslt!(:stylesheet => 'xhtml2latex.xsl')
92
+ tag(static: true) { creole!.rubypants }
93
+ toc.interwiki(map: interwiki_map)
94
+ html_wrapper!.xslt!(stylesheet: 'xhtml2latex.xsl')
95
95
  end
96
96
  end
97
97
 
@@ -107,7 +107,7 @@ aspect :page do
107
107
  remove_comments.tag_shortcuts
108
108
  mediawiki_nowiki.tag { mediawiki!.rubypants }
109
109
  end
110
- toc.interwiki(:map => interwiki_map).link_classifier
110
+ toc.interwiki(map: interwiki_map).link_classifier
111
111
  end
112
112
  end
113
113
 
@@ -118,7 +118,7 @@ aspect :s5 do
118
118
  filter do
119
119
  remove_comments.tag_shortcuts
120
120
  mediawiki_nowiki.tag { mediawiki!.rubypants }
121
- toc.interwiki(:map => interwiki_map).link_classifier
121
+ toc.interwiki(map: interwiki_map).link_classifier
122
122
  html_wrapper!.s5!
123
123
  end
124
124
  end
@@ -129,9 +129,9 @@ aspect :latex do
129
129
  mime 'text/plain; charset=utf-8'
130
130
  filter do
131
131
  remove_comments.tag_shortcuts.mediawiki_nowiki
132
- tag(:static => true) { mediawiki!.rubypants }
133
- toc.interwiki(:map => interwiki_map)
134
- html_wrapper!.xslt!(:stylesheet => 'xhtml2latex.xsl')
132
+ tag(static: true) { mediawiki!.rubypants }
133
+ toc.interwiki(map: interwiki_map)
134
+ html_wrapper!.xslt!(stylesheet: 'xhtml2latex.xsl')
135
135
  end
136
136
  end
137
137
 
@@ -144,9 +144,9 @@ aspect :page do
144
144
  accepts 'text/x-textile'
145
145
  filter do
146
146
  remove_comments.tag_shortcuts.textile_nowiki
147
- tag(:disable => 'html:*') { textile!.rubypants }
147
+ tag(disable: 'html:*') { textile!.rubypants }
148
148
  fix_img_tag.toc
149
- interwiki(:map => interwiki_map).link_classifier
149
+ interwiki(map: interwiki_map).link_classifier
150
150
  end
151
151
  end
152
152
 
@@ -156,9 +156,9 @@ aspect :s5 do
156
156
  mime 'application/xhtml+xml; charset=utf-8'
157
157
  filter do
158
158
  remove_comments.tag_shortcuts.textile_nowiki
159
- tag(:disable => 'html:*') { textile!.rubypants }
159
+ tag(disable: 'html:*') { textile!.rubypants }
160
160
  fix_img_tag.toc
161
- interwiki(:map => interwiki_map).link_classifier
161
+ interwiki(map: interwiki_map).link_classifier
162
162
  html_wrapper!.s5!
163
163
  end
164
164
  end
@@ -169,9 +169,9 @@ aspect :latex do
169
169
  mime 'text/plain; charset=utf-8'
170
170
  filter do
171
171
  remove_comments.tag_shortcuts.textile_nowiki
172
- tag(:static => true, :disable => 'html:*') { textile!.rubypants }
173
- toc.interwiki(:map => interwiki_map)
174
- html_wrapper!.xslt!(:stylesheet => 'xhtml2latex.xsl')
172
+ tag(static: true, disable: 'html:*') { textile!.rubypants }
173
+ toc.interwiki(map: interwiki_map)
174
+ html_wrapper!.xslt!(stylesheet: 'xhtml2latex.xsl')
175
175
  end
176
176
  end
177
177
 
@@ -185,10 +185,10 @@ aspect :page do
185
185
  filter do
186
186
  editsection do
187
187
  remove_comments.tag_shortcuts.markdown_nowiki
188
- tag(:disable => 'html:*') { markdown! }
188
+ tag(disable: 'html:*') { markdown! }
189
189
  end
190
190
  fix_img_tag.toc
191
- interwiki(:map => interwiki_map).link_classifier
191
+ interwiki(map: interwiki_map).link_classifier
192
192
  end
193
193
  end
194
194
 
@@ -198,9 +198,9 @@ aspect :s5 do
198
198
  mime 'application/xhtml+xml; charset=utf-8'
199
199
  filter do
200
200
  remove_comments.tag_shortcuts.markdown_nowiki
201
- tag(:disable => 'html:*') { markdown! }
201
+ tag(disable: 'html:*') { markdown! }
202
202
  fix_img_tag.toc
203
- interwiki(:map => interwiki_map).link_classifier
203
+ interwiki(map: interwiki_map).link_classifier
204
204
  html_wrapper!.s5!
205
205
  end
206
206
  end
@@ -211,9 +211,9 @@ aspect :latex do
211
211
  mime 'text/plain; charset=utf-8'
212
212
  filter do
213
213
  remove_comments.tag_shortcuts.markdown_nowiki
214
- tag(:static => true, :disable => 'html:*') { markdown! }
215
- toc.interwiki(:map => interwiki_map)
216
- html_wrapper!.xslt!(:stylesheet => 'xhtml2latex.xsl')
214
+ tag(static: true, disable: 'html:*') { markdown! }
215
+ toc.interwiki(map: interwiki_map)
216
+ html_wrapper!.xslt!(stylesheet: 'xhtml2latex.xsl')
217
217
  end
218
218
  end
219
219
 
@@ -228,7 +228,7 @@ aspect :page do
228
228
  remove_comments.tag_shortcuts
229
229
  tag { orgmode!.rubypants }
230
230
  fix_img_tag.toc
231
- interwiki(:map => interwiki_map).link_classifier
231
+ interwiki(map: interwiki_map).link_classifier
232
232
  end
233
233
  end
234
234
 
@@ -240,7 +240,7 @@ aspect :s5 do
240
240
  remove_comments.tag_shortcuts
241
241
  tag { orgmode!.rubypants }
242
242
  fix_img_tag.toc
243
- interwiki(:map => interwiki_map).link_classifier
243
+ interwiki(map: interwiki_map).link_classifier
244
244
  html_wrapper!.s5!
245
245
  end
246
246
  end
@@ -251,8 +251,21 @@ aspect :latex do
251
251
  mime 'text/plain; charset=utf-8'
252
252
  filter do
253
253
  remove_comments.tag_shortcuts
254
- tag(:static => true) { orgmode!.rubypants }
255
- toc.interwiki(:map => interwiki_map)
256
- html_wrapper!.xslt!(:stylesheet => 'xhtml2latex.xsl')
254
+ tag(static: true) { orgmode!.rubypants }
255
+ toc.interwiki(map: interwiki_map)
256
+ html_wrapper!.xslt!(stylesheet: 'xhtml2latex.xsl')
257
+ end
258
+ end
259
+
260
+ ################################################################################
261
+ # Remind aspects configuration
262
+ ################################################################################
263
+
264
+ aspect :calendar do
265
+ is_cacheable.needs_layout.has_priority(1)
266
+ accepts 'text/x-remind'
267
+ mime 'application/xhtml+xml; charset=utf-8'
268
+ filter do
269
+ remind!.html2xml!
257
270
  end
258
271
  end
@@ -114,6 +114,7 @@ disabled_plugins:
114
114
  - security/private_wiki
115
115
  - editor/recaptcha
116
116
  - editor/ace
117
+ - filters/remind
117
118
 
118
119
  ##################################################
119
120
  # Rack middleware configurations
@@ -1,29 +1,34 @@
1
1
  # Register some mime types
2
2
 
3
- MimeMagic.add('application/x-empty', :comment => 'Empty file')
4
- MimeMagic.add('inode/directory', :comment => 'Directory')
3
+ MimeMagic.add('application/x-empty', comment: 'Empty file')
4
+ MimeMagic.add('inode/directory', comment: 'Directory')
5
5
 
6
6
  MimeMagic.add('text/x-creole',
7
- :extensions => %w(creole text),
8
- :parents => 'text/plain',
9
- :comment => 'Creole Wiki Text File')
7
+ extensions: %w(creole text),
8
+ parents: 'text/plain',
9
+ comment: 'Creole Wiki Text File')
10
10
 
11
11
  MimeMagic.add('text/x-mediawiki',
12
- :extensions => %w(mediawiki mw),
13
- :parents => 'text/plain',
14
- :comment => 'MediaWiki Text File')
12
+ extensions: %w(mediawiki mw),
13
+ parents: 'text/plain',
14
+ comment: 'MediaWiki Text File')
15
15
 
16
16
  MimeMagic.add('text/x-markdown',
17
- :extensions => %w(markdown md mdown mkdn mdown),
18
- :parents => 'text/plain',
19
- :comment => 'Markdown Text File')
17
+ extensions: %w(markdown md mdown mkdn mdown),
18
+ parents: 'text/plain',
19
+ comment: 'Markdown Text File')
20
20
 
21
21
  MimeMagic.add('text/x-textile',
22
- :extensions => 'textile',
23
- :parents => 'text/plain',
24
- :comment => 'Textile Text File')
22
+ extensions: 'textile',
23
+ parents: 'text/plain',
24
+ comment: 'Textile Text File')
25
25
 
26
26
  MimeMagic.add('text/x-orgmode',
27
- :extensions => 'org',
28
- :parents => 'text/plain',
29
- :comment => 'Emacs Orgmode File')
27
+ extensions: 'org',
28
+ parents: 'text/plain',
29
+ comment: 'Emacs Orgmode File')
30
+
31
+ MimeMagic.add('text/x-remind',
32
+ extensions: 'rem',
33
+ parents: 'text/plain',
34
+ comment: 'Remind Calendar File')
@@ -1,2 +1,2 @@
1
- Slim::Engine.set_default_options :format => :xhtml,
2
- :shortcut => {'&' => 'input type', '#' => 'id', '.' => 'class'}
1
+ Slim::Engine.set_default_options format: :xhtml,
2
+ shortcut: {'&' => 'input type', '#' => 'id', '.' => 'class'}
@@ -1,5 +1,3 @@
1
- raise "Your Ruby version is too old (1.9.2 is required)" if RUBY_VERSION < '1.9.2'
2
-
3
1
  require 'logger'
4
2
  require 'cgi'
5
3
  require 'digest/md5'
@@ -9,12 +7,7 @@ require 'set'
9
7
  require 'yaml'
10
8
  require 'mimemagic'
11
9
  require 'socket'
12
-
13
- begin
14
- require 'yajl/json_gem'
15
- rescue LoadError
16
- require 'json'
17
- end
10
+ require 'multi_json'
18
11
 
19
12
  require 'olelo/html_safe'
20
13
  require 'slim'