clwiki 2.0.1 → 2.1.6

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 6ca0f95c1cee67ba052c408772649205091c3685
4
+ data.tar.gz: 7dcb32bc57a5d415a8aa3f3f78d82f4fc7a134b1
5
+ SHA512:
6
+ metadata.gz: 94f2f07e9a334f66d4e46a688ed0fa7f1a702870a7c53c702f23024c858365ddff1838f8cf4df253b43a21933f0c366d997c7f0b6be0d16989cf3107619b007e
7
+ data.tar.gz: 3e3bc9c1796918b8b521085d64c4cd55487b0141786e9fa5eabe518c65663c39c82e5491820ca8e3cb0168e46a52e3fe4629957c981acc03e6da761f900f4177
@@ -1,8 +1,8 @@
1
1
  <%= form_tag(page_show_path(:page_name => @page.full_name)) do %>
2
2
  <%= hidden_field_tag 'client_mod_time', @page.mtime.to_i.to_s %>
3
3
 
4
- <%= text_area_tag 'page_content', CGI.escapeHTML(@page.raw_content), rows: $wiki_conf.edit_rows, cols: $wiki_conf.edit_cols %>
4
+ <%= text_area_tag 'page_content', @page.raw_content, rows: $wiki_conf.edit_rows, cols: $wiki_conf.edit_cols %>
5
5
  <br/>
6
6
  <%= submit_tag 'Save', name: 'save' %>
7
7
  <%= submit_tag 'Save and Continue Editing', name: 'save_and_edit' %>
8
- <% end %>
8
+ <% end %>
@@ -1,4 +1,6 @@
1
1
  <% @pages.each do |page| %>
2
- <%= @formatter.convertToLink(page.name).html_safe %>
2
+ <div class='wikiHeader'>
3
+ <span class='pageName'><%= @formatter.convertToLink(page.name).html_safe %></span>
4
+ </div>
3
5
  <%= page.content.html_safe %>
4
6
  <% end %>
@@ -1,5 +1,9 @@
1
1
  module ClWiki
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace ClWiki
4
+
5
+ initializer 'cl_wiki.assets.precompile' do |app|
6
+ app.config.assets.precompile += %w(application.css application.js)
7
+ end
4
8
  end
5
- end
9
+ end
data/lib/cl_wiki/file.rb CHANGED
@@ -1,6 +1,8 @@
1
1
  require 'fileutils'
2
2
  require 'time'
3
3
 
4
+ require_relative 'page'
5
+
4
6
  $wikiPageExt = '.txt'
5
7
 
6
8
  module ClWiki
@@ -148,8 +150,22 @@ module ClWiki
148
150
  current_mtime = ::File.open(file_name) do |f|
149
151
  f.mtime
150
152
  end
151
- if mtime_to_compare != current_mtime
152
- raise FileModifiedSinceRead, "File has been modified since it was last read."
153
+ compare_read_times!(mtime_to_compare, current_mtime)
154
+ end
155
+
156
+ def self.compare_read_times!(a, b)
157
+ # ignore usec
158
+ a = Time.new(a.year, a.month, a.day, a.hour, a.min, a.sec)
159
+ b = Time.new(b.year, b.month, b.day, b.hour, b.min, b.sec)
160
+ if a != b
161
+ raise FileModifiedSinceRead, "File has been modified since it was last read. #{dump_time(a)} != #{dump_time(b)}"
162
+ end
163
+ end
164
+
165
+ def self.dump_time(time)
166
+ ''.tap do |s|
167
+ s << "#{time}"
168
+ s << ".#{time.usec}" if time.respond_to?(:usec)
153
169
  end
154
170
  end
155
171
 
@@ -1,3 +1,3 @@
1
1
  module ClWiki
2
- VERSION = '2.0.1'
3
- end
2
+ VERSION = '2.1.6'
3
+ end
@@ -20,7 +20,7 @@ Dummy::Application.configure do
20
20
  # config.action_dispatch.rack_cache = true
21
21
 
22
22
  # Disable Rails's static asset server (Apache or nginx will already do this).
23
- config.serve_static_assets = false
23
+ config.serve_static_files = false
24
24
 
25
25
  # Compress JavaScripts and CSS.
26
26
  config.assets.js_compressor = :uglifier
@@ -13,7 +13,7 @@ Dummy::Application.configure do
13
13
  config.eager_load = false
14
14
 
15
15
  # Configure static asset server for tests with Cache-Control for performance.
16
- config.serve_static_assets = true
16
+ config.serve_static_files = true
17
17
  config.static_cache_control = "public, max-age=3600"
18
18
 
19
19
  # Show full error reports and disable caching.
@@ -1,3 +1,3 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Dummy::Application.config.session_store :encrypted_cookie_store, key: '_dummy_session'
3
+ #Dummy::Application.config.session_store :encrypted_cookie_store, key: '_dummy_session'