cartoonist 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,11 +15,6 @@ class Admin::CacheController < AdminCartoonistController
15
15
  redirect_to "/admin/cache"
16
16
  end
17
17
 
18
- def expire_m
19
- PageCache.expire_m!
20
- redirect_to "/admin/cache"
21
- end
22
-
23
18
  def expire_tmp
24
19
  PageCache.expire_tmp!
25
20
  redirect_to "/admin/cache"
@@ -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
- if @mobile
17
- "m"
18
- else
19
- "www"
20
- end
20
+ "www"
21
21
  end
22
22
 
23
23
  def cache_page_as(path)
@@ -44,14 +44,6 @@ module CartoonistHelper
44
44
  @mobile
45
45
  end
46
46
 
47
- def html_class
48
- if mobile?
49
- "m"
50
- else
51
- "www"
52
- end
53
- end
54
-
55
47
  def enable_disqus!(options)
56
48
  @disqus_enabled = true
57
49
  @disqus_options = options
@@ -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|m)(?:\.tmp)?\.html(?:.gz)?$/, ""
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|m)(?:\.tmp)?\.html$/, ""
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 class="<%= html_class %>">
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 %>
@@ -64,11 +64,8 @@ en:
64
64
  cached: cached
65
65
  expire: Expire
66
66
  expire_all: Expire all
67
- expire_m: Expire m
68
67
  expire_tmp: Expire tmp
69
68
  expire_www: Expire www
70
- m: m
71
- m_tmp: m tmp
72
69
  not_cached: not cached
73
70
  page: Page
74
71
  www: www
@@ -336,7 +336,6 @@ module Cartoonist
336
336
  resources :cache, :constraints => { :id => /.*/ }, :only => [:destroy, :index] do
337
337
  collection do
338
338
  post "expire_www"
339
- post "expire_m"
340
339
  post "expire_tmp"
341
340
  post "expire_all"
342
341
  end
@@ -2,7 +2,7 @@ module Cartoonist
2
2
  class Version
3
3
  class << self
4
4
  def to_s
5
- "0.0.13"
5
+ "0.0.14"
6
6
  end
7
7
  end
8
8
  end
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.13
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-10 00:00:00.000000000 Z
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: &14316380 !ruby/object:Gem::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: *14316380
24
+ version_requirements: *11937760
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: jquery-rails
27
- requirement: &14315100 !ruby/object:Gem::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: *14315100
35
+ version_requirements: *11937280
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: railties
38
- requirement: &14313640 !ruby/object:Gem::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: *14313640
46
+ version_requirements: *11936820
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: redcarpet
49
- requirement: &14311140 !ruby/object:Gem::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: *14311140
57
+ version_requirements: *11936360
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rubyzip
60
- requirement: &14310300 !ruby/object:Gem::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: *14310300
68
+ version_requirements: *11935900
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitar
71
- requirement: &14309620 !ruby/object:Gem::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: *14309620
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: []