cartoonist 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/admin/cache_controller.rb +0 -5
- data/app/controllers/cartoonist_controller.rb +5 -5
- data/app/helpers/cartoonist_helper.rb +0 -8
- data/app/models/page_cache.rb +2 -17
- data/app/views/admin/cache/index.html.erb +0 -14
- data/app/views/layouts/cartoonist.html.erb +4 -1
- data/config/locales/en.yml +0 -3
- data/lib/cartoonist/engine.rb +0 -1
- data/lib/cartoonist/version.rb +1 -1
- metadata +14 -14
@@ -12,12 +12,12 @@ class CartoonistController < ActionController::Base
|
|
12
12
|
@mobile = (request.subdomain == "m") || params[:mobile]
|
13
13
|
end
|
14
14
|
|
15
|
+
def mobile?
|
16
|
+
@mobile
|
17
|
+
end
|
18
|
+
|
15
19
|
def cache_type
|
16
|
-
|
17
|
-
"m"
|
18
|
-
else
|
19
|
-
"www"
|
20
|
-
end
|
20
|
+
"www"
|
21
21
|
end
|
22
22
|
|
23
23
|
def cache_page_as(path)
|
data/app/models/page_cache.rb
CHANGED
@@ -33,19 +33,9 @@ class PageCache
|
|
33
33
|
@www_tmp_exists = File.exists? File.join(CACHE_PATH, "#{name}.www.tmp.html")
|
34
34
|
end
|
35
35
|
|
36
|
-
def m?
|
37
|
-
return @m_exists unless @m_exists.nil?
|
38
|
-
@m_exists = File.exists? File.join(CACHE_PATH, "#{name}.m.html")
|
39
|
-
end
|
40
|
-
|
41
|
-
def m_tmp?
|
42
|
-
return @m_tmp_exists unless @m_tmp_exists.nil?
|
43
|
-
@m_tmp_exists = File.exists? File.join(CACHE_PATH, "#{name}.m.tmp.html")
|
44
|
-
end
|
45
|
-
|
46
36
|
def expire!
|
47
37
|
PageCache.cache_files(:with_gz => true).select do |file|
|
48
|
-
extracted_name = file.sub /\.(?:www
|
38
|
+
extracted_name = file.sub /\.(?:www)(?:\.tmp)?\.html(?:.gz)?$/, ""
|
49
39
|
extracted_name == name
|
50
40
|
end.each do |file|
|
51
41
|
File.delete File.join(CACHE_PATH, file)
|
@@ -77,7 +67,7 @@ class PageCache
|
|
77
67
|
|
78
68
|
def cache_names
|
79
69
|
cache_files.map do |file|
|
80
|
-
file.sub /\.(?:www
|
70
|
+
file.sub /\.(?:www)(?:\.tmp)?\.html$/, ""
|
81
71
|
end.sort.uniq
|
82
72
|
end
|
83
73
|
|
@@ -86,11 +76,6 @@ class PageCache
|
|
86
76
|
File.delete *Dir.glob(File.join(CACHE_PATH, "**/*.www.tmp.html*"), File::FNM_DOTMATCH)
|
87
77
|
end
|
88
78
|
|
89
|
-
def expire_m!
|
90
|
-
File.delete *Dir.glob(File.join(CACHE_PATH, "**/*.m.html*"), File::FNM_DOTMATCH)
|
91
|
-
File.delete *Dir.glob(File.join(CACHE_PATH, "**/*.m.tmp.html*"), File::FNM_DOTMATCH)
|
92
|
-
end
|
93
|
-
|
94
79
|
def expire_tmp!
|
95
80
|
File.delete *Dir.glob(File.join(CACHE_PATH, "**/*.tmp.html*"), File::FNM_DOTMATCH)
|
96
81
|
end
|
@@ -3,10 +3,6 @@
|
|
3
3
|
<input type="submit" value="<%= t "cache.index.expire_www" %>" />
|
4
4
|
<% end %>
|
5
5
|
|
6
|
-
<%= form_tag "/admin/cache/expire_m", :method => :post, :class => "inline" do %>
|
7
|
-
<input type="submit" value="<%= t "cache.index.expire_m" %>" />
|
8
|
-
<% end %>
|
9
|
-
|
10
6
|
<%= form_tag "/admin/cache/expire_tmp", :method => :post, :class => "inline" do %>
|
11
7
|
<input type="submit" value="<%= t "cache.index.expire_tmp" %>" />
|
12
8
|
<% end %>
|
@@ -22,9 +18,7 @@
|
|
22
18
|
<tr>
|
23
19
|
<th><%= t "cache.index.page" %></th>
|
24
20
|
<th><%= t "cache.index.www" %></th>
|
25
|
-
<th><%= t "cache.index.m" %></th>
|
26
21
|
<th><%= t "cache.index.www_tmp" %></th>
|
27
|
-
<th><%= t "cache.index.m_tmp" %></th>
|
28
22
|
<th></th>
|
29
23
|
</tr>
|
30
24
|
</thead>
|
@@ -37,18 +31,10 @@
|
|
37
31
|
<%= td_cache_text cache.www? %>
|
38
32
|
</td>
|
39
33
|
|
40
|
-
<td class="<%= td_cache_class cache.m? %>">
|
41
|
-
<%= td_cache_text cache.m? %>
|
42
|
-
</td>
|
43
|
-
|
44
34
|
<td class="<%= td_cache_class cache.www_tmp? %>">
|
45
35
|
<%= td_cache_text cache.www_tmp? %>
|
46
36
|
</td>
|
47
37
|
|
48
|
-
<td class="<%= td_cache_class cache.m_tmp? %>">
|
49
|
-
<%= td_cache_text cache.m_tmp? %>
|
50
|
-
</td>
|
51
|
-
|
52
38
|
<td>
|
53
39
|
<%= form_tag "/admin/cache/#{u cache.delete_name}", :method => :delete do %>
|
54
40
|
<input type="submit" value="<%= t "cache.index.expire" %>" />
|
@@ -1,8 +1,11 @@
|
|
1
1
|
<!DOCTYPE html>
|
2
|
-
<html
|
2
|
+
<html>
|
3
3
|
<head>
|
4
4
|
<title><%= yield(:title) || Setting[:site_name] %></title>
|
5
5
|
<%= stylesheet_link_tag Cartoonist::Theme.css %>
|
6
|
+
<meta charset="utf-8">
|
7
|
+
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
|
8
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5">
|
6
9
|
<% if @output_csrf_meta_tags %>
|
7
10
|
<%= csrf_meta_tags %>
|
8
11
|
<% end %>
|
data/config/locales/en.yml
CHANGED
data/lib/cartoonist/engine.rb
CHANGED
data/lib/cartoonist/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cartoonist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: devise
|
16
|
-
requirement: &
|
16
|
+
requirement: &11937760 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.1.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *11937760
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: jquery-rails
|
27
|
-
requirement: &
|
27
|
+
requirement: &11937280 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 2.1.3
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *11937280
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: railties
|
38
|
-
requirement: &
|
38
|
+
requirement: &11936820 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 3.2.8
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *11936820
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: redcarpet
|
49
|
-
requirement: &
|
49
|
+
requirement: &11936360 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 2.2.2
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *11936360
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rubyzip
|
60
|
-
requirement: &
|
60
|
+
requirement: &11935900 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 0.9.9
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *11935900
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: minitar
|
71
|
-
requirement: &
|
71
|
+
requirement: &11935440 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ~>
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: 0.5.3
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *11935440
|
80
80
|
description: This provides the main functionality and plugin api for Cartoonist.
|
81
81
|
email: reasonnumber@gmail.com
|
82
82
|
executables: []
|