cartoonist 0.0.16 → 0.0.17
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.
- data/app/assets/javascripts/admin/search.js.coffee +3 -0
- data/app/controllers/admin/accounts_controller.rb +3 -0
- data/app/controllers/cartoonist_controller.rb +0 -9
- data/app/helpers/cartoonist_helper.rb +15 -4
- data/app/models/expirable.rb +40 -0
- data/app/models/lockable.rb +33 -0
- data/app/models/page_cache.rb +25 -11
- data/app/models/postable.rb +17 -0
- data/app/models/setting.rb +5 -1
- data/app/views/admin/settings/show.html.erb +4 -1
- data/app/views/layouts/admin.html.erb +1 -0
- data/app/views/shared/_date_time_entry.html.erb +28 -0
- data/app/views/shared/_expire_date_time.html.erb +23 -0
- data/app/views/shared/_post_date_time.html.erb +7 -0
- data/lib/cartoonist/engine.rb +2 -1
- data/lib/cartoonist/nginxtra.rb +100 -0
- data/lib/cartoonist/version.rb +1 -1
- metadata +102 -68
@@ -1,21 +1,12 @@
|
|
1
1
|
class CartoonistController < ActionController::Base
|
2
2
|
helper :cartoonist
|
3
3
|
protect_from_forgery
|
4
|
-
before_filter :check_mobile
|
5
4
|
|
6
5
|
private
|
7
6
|
def handle_unverified_request
|
8
7
|
raise ActionController::InvalidAuthenticityToken.new
|
9
8
|
end
|
10
9
|
|
11
|
-
def check_mobile
|
12
|
-
@mobile = (request.subdomain == "m") || params[:mobile]
|
13
|
-
end
|
14
|
-
|
15
|
-
def mobile?
|
16
|
-
@mobile
|
17
|
-
end
|
18
|
-
|
19
10
|
def cache_type
|
20
11
|
"www"
|
21
12
|
end
|
@@ -1,4 +1,13 @@
|
|
1
1
|
module CartoonistHelper
|
2
|
+
def partial(name, locals = {}, &block)
|
3
|
+
if block
|
4
|
+
raise "Cannot have a 'body' local when a block is given!" if locals.include?(:body)
|
5
|
+
locals[:body] = capture &block
|
6
|
+
end
|
7
|
+
|
8
|
+
render :partial => name, :locals => locals
|
9
|
+
end
|
10
|
+
|
2
11
|
def selected(a, b = true)
|
3
12
|
if a == b
|
4
13
|
'selected="selected"'.html_safe
|
@@ -11,6 +20,12 @@ module CartoonistHelper
|
|
11
20
|
end
|
12
21
|
end
|
13
22
|
|
23
|
+
def format_time(time, fmt)
|
24
|
+
if time
|
25
|
+
time.localtime.strftime fmt
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
14
29
|
def markdown(text)
|
15
30
|
Markdown.render text
|
16
31
|
end
|
@@ -40,10 +55,6 @@ module CartoonistHelper
|
|
40
55
|
@rss_title
|
41
56
|
end
|
42
57
|
|
43
|
-
def mobile?
|
44
|
-
@mobile
|
45
|
-
end
|
46
|
-
|
47
58
|
def enable_disqus!(options)
|
48
59
|
@disqus_enabled = true
|
49
60
|
@disqus_options = options
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Expirable
|
2
|
+
def expired?
|
3
|
+
expired_at && (expired_at < DateTime.now)
|
4
|
+
end
|
5
|
+
|
6
|
+
def expire_from(params)
|
7
|
+
if params[:expire_now].present? && !expired?
|
8
|
+
self.expired_at = Time.now
|
9
|
+
elsif params[:expire_in_hour].present? && !expired?
|
10
|
+
self.expired_at = 1.hour.from_now
|
11
|
+
elsif params[:expire_day_after].present? && !expired?
|
12
|
+
self.expired_at = posted_at + 1.day
|
13
|
+
elsif params[:expire_3_days_after].present? && !expired?
|
14
|
+
self.expired_at = posted_at + 3.days
|
15
|
+
elsif params[:expired].present? && params[:expired_at_date].present?
|
16
|
+
time = "#{params[:expired_at_date]} #{params[:expired_at_hour]}:#{params[:expired_at_minute]} #{params[:expired_at_meridiem]}"
|
17
|
+
time = DateTime.parse time
|
18
|
+
time = Time.local time.year, time.month, time.day, time.hour, time.min
|
19
|
+
self.expired_at = time
|
20
|
+
elsif params[:expired].present?
|
21
|
+
self.expired_at = 1.hour.from_now
|
22
|
+
else
|
23
|
+
self.expired_at = nil
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.included(base)
|
28
|
+
base.extend ClassMethods
|
29
|
+
end
|
30
|
+
|
31
|
+
module ClassMethods
|
32
|
+
def expired
|
33
|
+
where "#{quoted_table_name}.expired_at IS NOT NULL AND #{quoted_table_name}.expired_at < ?", DateTime.now
|
34
|
+
end
|
35
|
+
|
36
|
+
def unexpired
|
37
|
+
where "#{quoted_table_name}.expired_at IS NULL OR #{quoted_table_name}.expired_at >= ?", DateTime.now
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Lockable
|
2
|
+
def locked?
|
3
|
+
locked
|
4
|
+
end
|
5
|
+
|
6
|
+
def toggle_lock_target
|
7
|
+
if locked?
|
8
|
+
"unlock"
|
9
|
+
else
|
10
|
+
"lock"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def lock_disabled_html
|
15
|
+
if locked?
|
16
|
+
'disabled="disabled"'.html_safe
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def lock!
|
21
|
+
self.locked = true
|
22
|
+
save!
|
23
|
+
end
|
24
|
+
|
25
|
+
def unlock!
|
26
|
+
self.locked = false
|
27
|
+
save!
|
28
|
+
end
|
29
|
+
|
30
|
+
def ensure_unlocked!
|
31
|
+
raise "Cannot update this when it is locked!" if locked?
|
32
|
+
end
|
33
|
+
end
|
data/app/models/page_cache.rb
CHANGED
@@ -2,6 +2,7 @@ class PageCache
|
|
2
2
|
attr_reader :name
|
3
3
|
|
4
4
|
CACHE_PATH = File.join Rails.root, "public/cache"
|
5
|
+
EXTENSIONS = ["html", "json", "rss"]
|
5
6
|
|
6
7
|
def initialize(name)
|
7
8
|
@name = name
|
@@ -25,17 +26,21 @@ class PageCache
|
|
25
26
|
|
26
27
|
def www?
|
27
28
|
return @www_exists unless @www_exists.nil?
|
28
|
-
@www_exists =
|
29
|
+
@www_exists = EXTENSIONS.any? do |extension|
|
30
|
+
File.exists? File.join(CACHE_PATH, "#{name}.www.#{extension}")
|
31
|
+
end
|
29
32
|
end
|
30
33
|
|
31
34
|
def www_tmp?
|
32
35
|
return @www_tmp_exists unless @www_tmp_exists.nil?
|
33
|
-
@www_tmp_exists =
|
36
|
+
@www_tmp_exists = EXTENSIONS.any? do |extension|
|
37
|
+
File.exists? File.join(CACHE_PATH, "#{name}.www.tmp.#{extension}")
|
38
|
+
end
|
34
39
|
end
|
35
40
|
|
36
41
|
def expire!
|
37
42
|
PageCache.cache_files(:with_gz => true).select do |file|
|
38
|
-
extracted_name = file.sub /\.(?:www)(?:\.tmp)?\.
|
43
|
+
extracted_name = file.sub /\.(?:www)(?:\.tmp)?\.(?:#{EXTENSIONS.join "|"})(?:.gz)?$/, ""
|
39
44
|
extracted_name == name
|
40
45
|
end.each do |file|
|
41
46
|
File.delete File.join(CACHE_PATH, file)
|
@@ -57,31 +62,40 @@ class PageCache
|
|
57
62
|
end
|
58
63
|
|
59
64
|
def cache_files(options = {})
|
60
|
-
|
61
|
-
|
65
|
+
globs = EXTENSIONS.map do |extension|
|
66
|
+
globber = "**/*.#{extension}"
|
67
|
+
globber += "*" if options[:with_gz]
|
68
|
+
File.join CACHE_PATH, globber
|
69
|
+
end
|
62
70
|
|
63
|
-
Dir.glob(
|
71
|
+
Dir.glob(globs, File::FNM_DOTMATCH).map do |file|
|
64
72
|
file.sub "#{CACHE_PATH}/", ""
|
65
73
|
end
|
66
74
|
end
|
67
75
|
|
68
76
|
def cache_names
|
69
77
|
cache_files.map do |file|
|
70
|
-
file.sub /\.(?:www)(?:\.tmp)?\.
|
78
|
+
file.sub /\.(?:www)(?:\.tmp)?\.(?:#{EXTENSIONS.join "|"})$/, ""
|
71
79
|
end.sort.uniq
|
72
80
|
end
|
73
81
|
|
74
82
|
def expire_www!
|
75
|
-
|
76
|
-
|
83
|
+
EXTENSIONS.each do |extension|
|
84
|
+
File.delete *Dir.glob(File.join(CACHE_PATH, "**/*.www.#{extension}*"), File::FNM_DOTMATCH)
|
85
|
+
File.delete *Dir.glob(File.join(CACHE_PATH, "**/*.www.tmp.#{extension}*"), File::FNM_DOTMATCH)
|
86
|
+
end
|
77
87
|
end
|
78
88
|
|
79
89
|
def expire_tmp!
|
80
|
-
|
90
|
+
EXTENSIONS.each do |extension|
|
91
|
+
File.delete *Dir.glob(File.join(CACHE_PATH, "**/*.tmp.#{extension}*"), File::FNM_DOTMATCH)
|
92
|
+
end
|
81
93
|
end
|
82
94
|
|
83
95
|
def expire_all!
|
84
|
-
|
96
|
+
EXTENSIONS.each do |extension|
|
97
|
+
File.delete *Dir.glob(File.join(CACHE_PATH, "**/*.#{extension}*"), File::FNM_DOTMATCH)
|
98
|
+
end
|
85
99
|
end
|
86
100
|
end
|
87
101
|
end
|
data/app/models/postable.rb
CHANGED
@@ -23,6 +23,23 @@ module Postable
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
def post_from(params)
|
27
|
+
if params[:post_now].present? && !posted?
|
28
|
+
self.posted_at = Time.now
|
29
|
+
elsif params[:post_in_hour].present? && !posted?
|
30
|
+
self.posted_at = 1.hour.from_now
|
31
|
+
elsif params[:posted].present? && params[:posted_at_date].present?
|
32
|
+
time = "#{params[:posted_at_date]} #{params[:posted_at_hour]}:#{params[:posted_at_minute]} #{params[:posted_at_meridiem]}"
|
33
|
+
time = DateTime.parse time
|
34
|
+
time = Time.local time.year, time.month, time.day, time.hour, time.min
|
35
|
+
self.posted_at = time
|
36
|
+
elsif params[:posted].present?
|
37
|
+
self.posted_at = 1.hour.from_now
|
38
|
+
else
|
39
|
+
self.posted_at = nil
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
26
43
|
def self.included(base)
|
27
44
|
base.extend ClassMethods
|
28
45
|
end
|
data/app/models/setting.rb
CHANGED
@@ -65,7 +65,7 @@ class Setting < ActiveRecord::Base
|
|
65
65
|
@onchange = options[:onchange]
|
66
66
|
@validation = options[:validation]
|
67
67
|
@select_from = options[:select_from]
|
68
|
-
raise "Invalid setting type #{@type}" unless [:string, :symbol, :boolean, :int, :float, :array, :hash].include? @type
|
68
|
+
raise "Invalid setting type #{@type}" unless [:text, :string, :symbol, :boolean, :int, :float, :array, :hash].include? @type
|
69
69
|
|
70
70
|
# Auto create general tab and section if it isn't created
|
71
71
|
if @tab == :general && !Setting::Tab[@tab]
|
@@ -80,6 +80,8 @@ class Setting < ActiveRecord::Base
|
|
80
80
|
@default = options[:default]
|
81
81
|
elsif @type == :string
|
82
82
|
@default = ""
|
83
|
+
elsif @type == :text
|
84
|
+
@default = ""
|
83
85
|
elsif @type == :symbol
|
84
86
|
@default = :""
|
85
87
|
elsif @type == :boolean
|
@@ -118,6 +120,8 @@ class Setting < ActiveRecord::Base
|
|
118
120
|
case type
|
119
121
|
when :string
|
120
122
|
value
|
123
|
+
when :text
|
124
|
+
value
|
121
125
|
when :symbol
|
122
126
|
value.to_sym
|
123
127
|
when :boolean
|
@@ -19,7 +19,7 @@
|
|
19
19
|
|
20
20
|
<% @tab[section].settings.each do |setting| %>
|
21
21
|
<%# Other setting types to come later %>
|
22
|
-
<% next unless Setting::Meta[setting].select_from || [:string, :boolean, :int].include?(Setting::Meta[setting].type) %>
|
22
|
+
<% next unless Setting::Meta[setting].select_from || [:text, :string, :boolean, :int].include?(Setting::Meta[setting].type) %>
|
23
23
|
<p class="setting">
|
24
24
|
<input type="hidden" name="included_settings[]" value="<%= setting %>" />
|
25
25
|
<label>
|
@@ -30,6 +30,9 @@
|
|
30
30
|
<option value="<%= setting_select_value option %>" <%= selected setting_select_value(option), Setting[setting] %>><%= setting_select_label option %></option>
|
31
31
|
<% end %>
|
32
32
|
<select name="<%= setting %>" value="<%= Setting[setting] %>">
|
33
|
+
<% elsif Setting::Meta[setting].type == :text %>
|
34
|
+
<br />
|
35
|
+
<textarea name="<%= setting %>" cols="75" rows="15"><%= Setting[setting] %></textarea>
|
33
36
|
<% elsif Setting::Meta[setting].type == :string %>
|
34
37
|
<input type="text" name="<%= setting %>" value="<%= Setting[setting] %>" size="60" />
|
35
38
|
<% elsif [:int, :float].include?(Setting::Meta[setting].type) %>
|
@@ -9,6 +9,7 @@
|
|
9
9
|
<link rel="shortcut icon" href="http://<%= Setting[:domain] %><%= asset_path Cartoonist::Theme.favicon %>" type="image/x-icon" />
|
10
10
|
<%= javascript_include_tag controller_path if Rails.application.assets.find_asset("#{controller_path}.js").present? %>
|
11
11
|
</head>
|
12
|
+
|
12
13
|
<body>
|
13
14
|
<%= form_tag "/users/sign_out", :method => :delete do %>
|
14
15
|
<p class="tabs">
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<% body = "" if body.nil? %>
|
2
|
+
<% name_prefix = name.downcase %>
|
3
|
+
<% disabled_attr = 'disabled="disabled"'.html_safe if disabled %>
|
4
|
+
|
5
|
+
<label>
|
6
|
+
<input type="checkbox" name="<%= name_prefix %>" value="true" <%= checked !!time %> <%= disabled_attr %> /><%= name.capitalize %> at
|
7
|
+
</label>
|
8
|
+
|
9
|
+
<input type="text" name="<%= name_prefix %>_at_date" value="<%= format_time time, "%Y-%m-%d" %>" <%= disabled_attr %> />
|
10
|
+
|
11
|
+
<select name="<%= name_prefix %>_at_hour" <%= disabled_attr %>>
|
12
|
+
<% 1.upto 12 do |h| %>
|
13
|
+
<option value="<%= h %>" <%= selected h, format_time(time, "%-l").to_i %>><%= h %></option>
|
14
|
+
<% end %>
|
15
|
+
</select>
|
16
|
+
|
17
|
+
<select name="<%= name_prefix %>_at_minute" <%= disabled_attr %>>
|
18
|
+
<% 0.upto 60 do |m| %>
|
19
|
+
<option value="<%= m %>" <%= selected m, format_time(time, "%-M").to_i %>><%= m %></option>
|
20
|
+
<% end %>
|
21
|
+
</select>
|
22
|
+
|
23
|
+
<select name="<%= name_prefix %>_at_meridiem" <%= disabled_attr %>>
|
24
|
+
<option value="am" <%= selected "am", format_time(time, "%P") %>>am</option>
|
25
|
+
<option value="pm" <%= selected "pm", format_time(time, "%P") %>>pm</option>
|
26
|
+
</select>
|
27
|
+
|
28
|
+
<%= body %>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%
|
2
|
+
|
3
|
+
if expirable && expirable.kind_of?(Postable)
|
4
|
+
posted = expirable.posted?
|
5
|
+
else
|
6
|
+
posted = true
|
7
|
+
end
|
8
|
+
|
9
|
+
submit_disabled_attr = 'disabled="disabled"'.html_safe if expirable && (expirable.locked? || expirable.expired? || !posted)
|
10
|
+
|
11
|
+
%>
|
12
|
+
<%= partial "shared/date_time_entry", :time => (expirable.expired_at if expirable),
|
13
|
+
:disabled => (expirable && expirable.locked?),
|
14
|
+
:name => "expired" do %>
|
15
|
+
<input type="submit" name="expire_now" value="Expire Now" <%= submit_disabled_attr %> />
|
16
|
+
|
17
|
+
<% if expirable && expirable.kind_of?(Postable) %>
|
18
|
+
<input type="submit" name="expire_day_after" value="Expire Day After" <%= submit_disabled_attr %> />
|
19
|
+
<input type="submit" name="expire_3_days_after" value="Expire 3 Days After" <%= submit_disabled_attr %> />
|
20
|
+
<% else %>
|
21
|
+
<input type="submit" name="expire_in_hour" value="Expire in an Hour" <%= submit_disabled_attr %> />
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
@@ -0,0 +1,7 @@
|
|
1
|
+
<% submit_disabled_attr = 'disabled="disabled"'.html_safe if postable && (postable.locked? || postable.posted?) %>
|
2
|
+
<%= partial "shared/date_time_entry", :time => (postable.posted_at if postable),
|
3
|
+
:disabled => (postable && postable.locked?),
|
4
|
+
:name => "posted" do %>
|
5
|
+
<input type="submit" name="post_now" value="Post Now" <%= submit_disabled_attr %> />
|
6
|
+
<input type="submit" name="post_in_hour" value="Post in an Hour" <%= submit_disabled_attr %> />
|
7
|
+
<% end %>
|
data/lib/cartoonist/engine.rb
CHANGED
@@ -293,6 +293,7 @@ module Cartoonist
|
|
293
293
|
Mime::Type.register "image/x-icon", :ico
|
294
294
|
Mime::Type.register "application/octet-stream", :tgz
|
295
295
|
Cartoonist::Admin::Tab.add :general, :url => "/admin", :order => 3
|
296
|
+
Cartoonist::Asset.add "admin/search.js"
|
296
297
|
Cartoonist::Migration.add_for self
|
297
298
|
|
298
299
|
Cartoonist::Backup.for :files do
|
@@ -336,7 +337,7 @@ module Cartoonist
|
|
336
337
|
devise_for :users, :controllers => { :omniauth_callbacks => "admin/omniauth_callbacks" }
|
337
338
|
|
338
339
|
namespace :admin do
|
339
|
-
resources :accounts
|
340
|
+
resources :accounts
|
340
341
|
|
341
342
|
resources :cache, :constraints => { :id => /.*/ }, :only => [:destroy, :index] do
|
342
343
|
collection do
|
@@ -0,0 +1,100 @@
|
|
1
|
+
Nginxtra::Config::Extension.partial "nginx.conf", "cartoonist_rails" do |args, block|
|
2
|
+
rails_server = args[:server] || :passenger
|
3
|
+
ssl_details = args[:ssl]
|
4
|
+
|
5
|
+
if ssl_details
|
6
|
+
default_port = 443
|
7
|
+
else
|
8
|
+
default_port = 80
|
9
|
+
end
|
10
|
+
|
11
|
+
if rails_server == :passenger && !@passenger_requirements_done
|
12
|
+
@config.require_passenger!
|
13
|
+
passenger_root!
|
14
|
+
passenger_ruby!
|
15
|
+
@passenger_requirements_done = true
|
16
|
+
end
|
17
|
+
|
18
|
+
server do
|
19
|
+
listen(args[:port] || default_port)
|
20
|
+
server_name(args[:server_name] || "localhost")
|
21
|
+
root File.join(File.absolute_path(File.expand_path(args[:root] || ".")), "public")
|
22
|
+
gzip_static "on"
|
23
|
+
passenger_on! if rails_server == :passenger
|
24
|
+
rails_env(args[:environment] || "production")
|
25
|
+
|
26
|
+
if ssl_details
|
27
|
+
ssl "on"
|
28
|
+
ssl_certificate ssl_details[:ssl_cert]
|
29
|
+
ssl_certificate_key ssl_details[:ssl_key]
|
30
|
+
@config.compile_option "--with-http_ssl_module"
|
31
|
+
end
|
32
|
+
|
33
|
+
block.call
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
Nginxtra::Config::Extension.partial "nginx.conf", "cartoonist" do |args, block|
|
38
|
+
if !@passenger_requirements_done
|
39
|
+
@config.require_passenger!
|
40
|
+
passenger_root!
|
41
|
+
passenger_ruby!
|
42
|
+
@passenger_requirements_done = true
|
43
|
+
end
|
44
|
+
|
45
|
+
cartoonist_type = args[:type] || "www"
|
46
|
+
server_name = args[:server_name]
|
47
|
+
root_path = args[:root]
|
48
|
+
ssl_details = args[:ssl]
|
49
|
+
ssl_details = { :ssl => ssl_details } if ssl_details
|
50
|
+
short_expiration = args[:short_expiration] || "2h"
|
51
|
+
long_expiration = args[:long_expiration] || "7d"
|
52
|
+
|
53
|
+
[{}, ssl_details].compact.each do |additional_options|
|
54
|
+
options = { :server => :custom, :server_name => server_name, :root => root_path }.merge additional_options
|
55
|
+
|
56
|
+
cartoonist_rails options do
|
57
|
+
location "~*", "^/_long_expiration_/#{cartoonist_type}(/.*?)(?:\\.html)?$" do
|
58
|
+
expires long_expiration
|
59
|
+
add_header "Cache-Control", "public"
|
60
|
+
try_files "$1", "$1.html", "/cache/static$1", "@passenger"
|
61
|
+
end
|
62
|
+
|
63
|
+
["/cache/static$uri", "$uri", "$uri.html"].each do |condition|
|
64
|
+
_if "-f #{root_path}/public#{condition}" do
|
65
|
+
rewrite "^(.*)$", "/_long_expiration_/#{cartoonist_type}$1", "last"
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
["html", "json", "rss"].each do |extension|
|
70
|
+
location "~*", "^/_short_#{extension}_expiration_/#{cartoonist_type}(/.*?)(?:\\.#{extension})?$" do
|
71
|
+
expires short_expiration
|
72
|
+
add_header "Cache-Control", "public"
|
73
|
+
try_files "/cache$1.#{cartoonist_type}.tmp.#{extension}", "@passenger"
|
74
|
+
end
|
75
|
+
|
76
|
+
location "~*", "^/_long_#{extension}_expiration_/#{cartoonist_type}(/.*?)(?:\\.#{extension})?$" do
|
77
|
+
expires long_expiration
|
78
|
+
add_header "Cache-Control", "public"
|
79
|
+
try_files "/cache$1.#{cartoonist_type}.#{extension}", "@passenger"
|
80
|
+
end
|
81
|
+
|
82
|
+
_if "-f #{root_path}/public/cache$uri.#{cartoonist_type}.tmp.#{extension}" do
|
83
|
+
rewrite "^(.*)$", "/_short_#{extension}_expiration_/#{cartoonist_type}$1", "last"
|
84
|
+
end
|
85
|
+
|
86
|
+
_if "-f #{root_path}/public/cache$uri.#{cartoonist_type}.#{extension}" do
|
87
|
+
rewrite "^(.*)$", "/_long_#{extension}_expiration_/#{cartoonist_type}$1", "last"
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
location "/" do
|
92
|
+
try_files "/_jump_to_passenger_", "@passenger"
|
93
|
+
end
|
94
|
+
|
95
|
+
location "@passenger" do
|
96
|
+
passenger_on!
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
data/lib/cartoonist/version.rb
CHANGED
metadata
CHANGED
@@ -1,103 +1,135 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: cartoonist
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.17
|
4
5
|
prerelease:
|
5
|
-
version: 0.0.16
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Mike Virata-Stone
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-02-13 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: devise
|
17
|
-
|
18
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
19
17
|
none: false
|
20
|
-
requirements:
|
18
|
+
requirements:
|
21
19
|
- - ~>
|
22
|
-
- !ruby/object:Gem::Version
|
20
|
+
- !ruby/object:Gem::Version
|
23
21
|
version: 2.1.2
|
24
22
|
type: :runtime
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: jquery-rails
|
28
23
|
prerelease: false
|
29
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
25
|
none: false
|
31
|
-
requirements:
|
26
|
+
requirements:
|
32
27
|
- - ~>
|
33
|
-
- !ruby/object:Gem::Version
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 2.1.2
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: jquery-rails
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
34
37
|
version: 2.1.4
|
35
38
|
type: :runtime
|
36
|
-
version_requirements: *id002
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: omniauth-openid
|
39
39
|
prerelease: false
|
40
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.1.4
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: omniauth-openid
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
41
49
|
none: false
|
42
|
-
requirements:
|
50
|
+
requirements:
|
43
51
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
52
|
+
- !ruby/object:Gem::Version
|
45
53
|
version: 1.0.1
|
46
54
|
type: :runtime
|
47
|
-
version_requirements: *id003
|
48
|
-
- !ruby/object:Gem::Dependency
|
49
|
-
name: railties
|
50
55
|
prerelease: false
|
51
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
57
|
none: false
|
53
|
-
requirements:
|
58
|
+
requirements:
|
54
59
|
- - ~>
|
55
|
-
- !ruby/object:Gem::Version
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.0.1
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: railties
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
56
69
|
version: 3.2.9
|
57
70
|
type: :runtime
|
58
|
-
version_requirements: *id004
|
59
|
-
- !ruby/object:Gem::Dependency
|
60
|
-
name: redcarpet
|
61
71
|
prerelease: false
|
62
|
-
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
73
|
none: false
|
64
|
-
requirements:
|
74
|
+
requirements:
|
65
75
|
- - ~>
|
66
|
-
- !ruby/object:Gem::Version
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 3.2.9
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: redcarpet
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ~>
|
84
|
+
- !ruby/object:Gem::Version
|
67
85
|
version: 2.2.2
|
68
86
|
type: :runtime
|
69
|
-
version_requirements: *id005
|
70
|
-
- !ruby/object:Gem::Dependency
|
71
|
-
name: rubyzip
|
72
87
|
prerelease: false
|
73
|
-
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
89
|
none: false
|
75
|
-
requirements:
|
90
|
+
requirements:
|
76
91
|
- - ~>
|
77
|
-
- !ruby/object:Gem::Version
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 2.2.2
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: rubyzip
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ~>
|
100
|
+
- !ruby/object:Gem::Version
|
78
101
|
version: 0.9.9
|
79
102
|
type: :runtime
|
80
|
-
version_requirements: *id006
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
name: minitar
|
83
103
|
prerelease: false
|
84
|
-
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
105
|
none: false
|
86
|
-
requirements:
|
106
|
+
requirements:
|
87
107
|
- - ~>
|
88
|
-
- !ruby/object:Gem::Version
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: 0.9.9
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: minitar
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ~>
|
116
|
+
- !ruby/object:Gem::Version
|
89
117
|
version: 0.5.4
|
90
118
|
type: :runtime
|
91
|
-
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ~>
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: 0.5.4
|
92
126
|
description: This provides the main functionality and plugin api for Cartoonist.
|
93
127
|
email: reasonnumber@gmail.com
|
94
128
|
executables: []
|
95
|
-
|
96
129
|
extensions: []
|
97
|
-
|
98
130
|
extra_rdoc_files: []
|
99
|
-
|
100
|
-
|
131
|
+
files:
|
132
|
+
- app/assets/javascripts/admin/search.js.coffee
|
101
133
|
- app/assets/javascripts/cartoonist.js.erb
|
102
134
|
- app/assets/stylesheets/admin.css.scss
|
103
135
|
- app/controllers/admin/accounts_controller.rb
|
@@ -117,6 +149,8 @@ files:
|
|
117
149
|
- app/models/belongs_to_entity.rb
|
118
150
|
- app/models/database_file.rb
|
119
151
|
- app/models/entity.rb
|
152
|
+
- app/models/expirable.rb
|
153
|
+
- app/models/lockable.rb
|
120
154
|
- app/models/markdown.rb
|
121
155
|
- app/models/page_cache.rb
|
122
156
|
- app/models/postable.rb
|
@@ -144,6 +178,9 @@ files:
|
|
144
178
|
- app/views/layouts/cartoonist.xml.erb
|
145
179
|
- app/views/layouts/general_admin.html.erb
|
146
180
|
- app/views/layouts/users.html.erb
|
181
|
+
- app/views/shared/_date_time_entry.html.erb
|
182
|
+
- app/views/shared/_expire_date_time.html.erb
|
183
|
+
- app/views/shared/_post_date_time.html.erb
|
147
184
|
- app/views/site/robots.text.erb
|
148
185
|
- app/views/site/sitemap.xml.erb
|
149
186
|
- cartoonist.gemspec
|
@@ -156,36 +193,33 @@ files:
|
|
156
193
|
- db/migrate/20121205091909_add_omniautable_to_users.rb
|
157
194
|
- lib/cartoonist.rb
|
158
195
|
- lib/cartoonist/engine.rb
|
196
|
+
- lib/cartoonist/nginxtra.rb
|
159
197
|
- lib/cartoonist/version.rb
|
160
198
|
- public/errors/404.html
|
161
199
|
- public/errors/422.html
|
162
200
|
- public/errors/500.html
|
163
201
|
homepage: http://reasonnumber.com/cartoonist
|
164
202
|
licenses: []
|
165
|
-
|
166
203
|
post_install_message:
|
167
204
|
rdoc_options: []
|
168
|
-
|
169
|
-
require_paths:
|
205
|
+
require_paths:
|
170
206
|
- lib
|
171
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
207
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
172
208
|
none: false
|
173
|
-
requirements:
|
174
|
-
- -
|
175
|
-
- !ruby/object:Gem::Version
|
176
|
-
version:
|
177
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
209
|
+
requirements:
|
210
|
+
- - ! '>='
|
211
|
+
- !ruby/object:Gem::Version
|
212
|
+
version: '0'
|
213
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
214
|
none: false
|
179
|
-
requirements:
|
180
|
-
- -
|
181
|
-
- !ruby/object:Gem::Version
|
182
|
-
version:
|
215
|
+
requirements:
|
216
|
+
- - ! '>='
|
217
|
+
- !ruby/object:Gem::Version
|
218
|
+
version: '0'
|
183
219
|
requirements: []
|
184
|
-
|
185
220
|
rubyforge_project:
|
186
221
|
rubygems_version: 1.8.24
|
187
222
|
signing_key:
|
188
223
|
specification_version: 3
|
189
224
|
summary: Cartoonist Core
|
190
225
|
test_files: []
|
191
|
-
|