rocket_cms 0.16.1 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +69 -58
- data/app/controllers/concerns/rs_errors.rb +8 -2
- data/lib/rocket_cms/version.rb +1 -1
- data/rocket_cms.gemspec +1 -1
- data/template.rb +60 -23
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d937c7f2a458dd89a09bfa8663fd7b835d649cf9
|
4
|
+
data.tar.gz: e823e1a647d966fc94f528408ea536f6d1037c96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 726066e6df80efc7da76c83a5f4043fd4ed8874dd8e0af5d46ad07edc99f24c8ee8489bcda7a2d771ba3d32cee826169567e221e2744dee58f9d0a98fed5f273
|
7
|
+
data.tar.gz: 46c6961ca2a4dbd677a8094058a311e6ace96d86afc25591824d4952b98b4335dfa9144e2b015d10a2577c684a865cc61e70307cbfb8b32aeaf41e0f7ef1e1af
|
data/Gemfile.lock
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rocket_cms (0.
|
4
|
+
rocket_cms (0.17.0)
|
5
5
|
addressable
|
6
6
|
coffee-rails
|
7
7
|
jquery-rails
|
8
8
|
kaminari
|
9
|
-
rails (>= 4.1.0, <
|
9
|
+
rails (>= 4.1.0, < 6.0)
|
10
10
|
smart_excerpt
|
11
11
|
stringex
|
12
12
|
thor
|
@@ -16,67 +16,77 @@ PATH
|
|
16
16
|
GEM
|
17
17
|
remote: https://rubygems.org/
|
18
18
|
specs:
|
19
|
-
actioncable (5.0.
|
20
|
-
actionpack (= 5.0.
|
21
|
-
nio4r (
|
19
|
+
actioncable (5.0.2)
|
20
|
+
actionpack (= 5.0.2)
|
21
|
+
nio4r (>= 1.2, < 3.0)
|
22
22
|
websocket-driver (~> 0.6.1)
|
23
|
-
actionmailer (5.0.
|
24
|
-
actionpack (= 5.0.
|
25
|
-
actionview (= 5.0.
|
26
|
-
activejob (= 5.0.
|
23
|
+
actionmailer (5.0.2)
|
24
|
+
actionpack (= 5.0.2)
|
25
|
+
actionview (= 5.0.2)
|
26
|
+
activejob (= 5.0.2)
|
27
27
|
mail (~> 2.5, >= 2.5.4)
|
28
28
|
rails-dom-testing (~> 2.0)
|
29
|
-
actionpack (5.0.
|
30
|
-
actionview (= 5.0.
|
31
|
-
activesupport (= 5.0.
|
29
|
+
actionpack (5.0.2)
|
30
|
+
actionview (= 5.0.2)
|
31
|
+
activesupport (= 5.0.2)
|
32
32
|
rack (~> 2.0)
|
33
33
|
rack-test (~> 0.6.3)
|
34
34
|
rails-dom-testing (~> 2.0)
|
35
35
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
36
|
-
actionview (5.0.
|
37
|
-
activesupport (= 5.0.
|
36
|
+
actionview (5.0.2)
|
37
|
+
activesupport (= 5.0.2)
|
38
38
|
builder (~> 3.1)
|
39
39
|
erubis (~> 2.7.0)
|
40
40
|
rails-dom-testing (~> 2.0)
|
41
|
-
rails-html-sanitizer (~> 1.0, >= 1.0.
|
42
|
-
activejob (5.0.
|
43
|
-
activesupport (= 5.0.
|
41
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
42
|
+
activejob (5.0.2)
|
43
|
+
activesupport (= 5.0.2)
|
44
44
|
globalid (>= 0.3.6)
|
45
|
-
activemodel (5.0.
|
46
|
-
activesupport (= 5.0.
|
47
|
-
activerecord (5.0.
|
48
|
-
activemodel (= 5.0.
|
49
|
-
activesupport (= 5.0.
|
45
|
+
activemodel (5.0.2)
|
46
|
+
activesupport (= 5.0.2)
|
47
|
+
activerecord (5.0.2)
|
48
|
+
activemodel (= 5.0.2)
|
49
|
+
activesupport (= 5.0.2)
|
50
50
|
arel (~> 7.0)
|
51
|
-
activesupport (5.0.
|
51
|
+
activesupport (5.0.2)
|
52
52
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
53
53
|
i18n (~> 0.7)
|
54
54
|
minitest (~> 5.1)
|
55
55
|
tzinfo (~> 1.1)
|
56
|
-
addressable (2.
|
57
|
-
|
58
|
-
|
56
|
+
addressable (2.5.0)
|
57
|
+
public_suffix (~> 2.0, >= 2.0.2)
|
58
|
+
arel (7.1.4)
|
59
|
+
builder (3.2.3)
|
59
60
|
coffee-rails (4.2.1)
|
60
61
|
coffee-script (>= 2.2.0)
|
61
62
|
railties (>= 4.0.0, < 5.2.x)
|
62
63
|
coffee-script (2.4.1)
|
63
64
|
coffee-script-source
|
64
65
|
execjs
|
65
|
-
coffee-script-source (1.
|
66
|
-
concurrent-ruby (1.0.
|
66
|
+
coffee-script-source (1.12.2)
|
67
|
+
concurrent-ruby (1.0.5)
|
67
68
|
erubis (2.7.0)
|
68
69
|
execjs (2.7.0)
|
69
70
|
globalid (0.3.7)
|
70
71
|
activesupport (>= 4.1.0)
|
71
72
|
htmlentities (4.3.4)
|
72
|
-
i18n (0.
|
73
|
-
jquery-rails (4.2.
|
73
|
+
i18n (0.8.1)
|
74
|
+
jquery-rails (4.2.2)
|
74
75
|
rails-dom-testing (>= 1, < 3)
|
75
76
|
railties (>= 4.2.0)
|
76
77
|
thor (>= 0.14, < 2.0)
|
77
|
-
kaminari (0.
|
78
|
-
|
79
|
-
|
78
|
+
kaminari (1.0.1)
|
79
|
+
activesupport (>= 4.1.0)
|
80
|
+
kaminari-actionview (= 1.0.1)
|
81
|
+
kaminari-activerecord (= 1.0.1)
|
82
|
+
kaminari-core (= 1.0.1)
|
83
|
+
kaminari-actionview (1.0.1)
|
84
|
+
actionview
|
85
|
+
kaminari-core (= 1.0.1)
|
86
|
+
kaminari-activerecord (1.0.1)
|
87
|
+
activerecord
|
88
|
+
kaminari-core (= 1.0.1)
|
89
|
+
kaminari-core (1.0.1)
|
80
90
|
loofah (2.0.3)
|
81
91
|
nokogiri (>= 1.5.9)
|
82
92
|
mail (2.6.4)
|
@@ -86,50 +96,51 @@ GEM
|
|
86
96
|
mime-types-data (~> 3.2015)
|
87
97
|
mime-types-data (3.2016.0521)
|
88
98
|
mini_portile2 (2.1.0)
|
89
|
-
minitest (5.
|
90
|
-
nio4r (
|
91
|
-
nokogiri (1.
|
99
|
+
minitest (5.10.1)
|
100
|
+
nio4r (2.0.0)
|
101
|
+
nokogiri (1.7.1)
|
92
102
|
mini_portile2 (~> 2.1.0)
|
103
|
+
public_suffix (2.0.5)
|
93
104
|
rack (2.0.1)
|
94
105
|
rack-test (0.6.3)
|
95
106
|
rack (>= 1.0)
|
96
|
-
rails (5.0.
|
97
|
-
actioncable (= 5.0.
|
98
|
-
actionmailer (= 5.0.
|
99
|
-
actionpack (= 5.0.
|
100
|
-
actionview (= 5.0.
|
101
|
-
activejob (= 5.0.
|
102
|
-
activemodel (= 5.0.
|
103
|
-
activerecord (= 5.0.
|
104
|
-
activesupport (= 5.0.
|
107
|
+
rails (5.0.2)
|
108
|
+
actioncable (= 5.0.2)
|
109
|
+
actionmailer (= 5.0.2)
|
110
|
+
actionpack (= 5.0.2)
|
111
|
+
actionview (= 5.0.2)
|
112
|
+
activejob (= 5.0.2)
|
113
|
+
activemodel (= 5.0.2)
|
114
|
+
activerecord (= 5.0.2)
|
115
|
+
activesupport (= 5.0.2)
|
105
116
|
bundler (>= 1.3.0, < 2.0)
|
106
|
-
railties (= 5.0.
|
117
|
+
railties (= 5.0.2)
|
107
118
|
sprockets-rails (>= 2.0.0)
|
108
|
-
rails-dom-testing (2.0.
|
119
|
+
rails-dom-testing (2.0.2)
|
109
120
|
activesupport (>= 4.2.0, < 6.0)
|
110
|
-
nokogiri (~> 1.6
|
121
|
+
nokogiri (~> 1.6)
|
111
122
|
rails-html-sanitizer (1.0.3)
|
112
123
|
loofah (~> 2.0)
|
113
|
-
railties (5.0.
|
114
|
-
actionpack (= 5.0.
|
115
|
-
activesupport (= 5.0.
|
124
|
+
railties (5.0.2)
|
125
|
+
actionpack (= 5.0.2)
|
126
|
+
activesupport (= 5.0.2)
|
116
127
|
method_source
|
117
128
|
rake (>= 0.8.7)
|
118
129
|
thor (>= 0.18.1, < 2.0)
|
119
|
-
rake (
|
130
|
+
rake (12.0.0)
|
120
131
|
smart_excerpt (0.1.5)
|
121
132
|
activesupport
|
122
133
|
htmlentities
|
123
|
-
sprockets (3.7.
|
134
|
+
sprockets (3.7.1)
|
124
135
|
concurrent-ruby (~> 1.0)
|
125
136
|
rack (> 1, < 3)
|
126
137
|
sprockets-rails (3.2.0)
|
127
138
|
actionpack (>= 4.0)
|
128
139
|
activesupport (>= 4.0)
|
129
140
|
sprockets (>= 3.0.0)
|
130
|
-
stringex (2.
|
131
|
-
thor (0.19.
|
132
|
-
thread_safe (0.3.
|
141
|
+
stringex (2.7.1)
|
142
|
+
thor (0.19.4)
|
143
|
+
thread_safe (0.3.6)
|
133
144
|
turbolinks (5.0.1)
|
134
145
|
turbolinks-source (~> 5)
|
135
146
|
turbolinks-source (5.0.0)
|
@@ -137,7 +148,7 @@ GEM
|
|
137
148
|
thread_safe (~> 0.1)
|
138
149
|
validates_email_format_of (1.6.3)
|
139
150
|
i18n
|
140
|
-
websocket-driver (0.6.
|
151
|
+
websocket-driver (0.6.5)
|
141
152
|
websocket-extensions (>= 0.1.0)
|
142
153
|
websocket-extensions (0.1.2)
|
143
154
|
|
@@ -150,4 +161,4 @@ DEPENDENCIES
|
|
150
161
|
rocket_cms!
|
151
162
|
|
152
163
|
BUNDLED WITH
|
153
|
-
1.
|
164
|
+
1.14.6
|
@@ -46,7 +46,7 @@ module RsErrors
|
|
46
46
|
unless exception.nil?
|
47
47
|
Rails.logger.error exception.message
|
48
48
|
Rails.logger.error exception.backtrace.join("\n")
|
49
|
-
|
49
|
+
capture_error(exception)
|
50
50
|
end
|
51
51
|
render_error(404)
|
52
52
|
end
|
@@ -55,7 +55,7 @@ module RsErrors
|
|
55
55
|
Rails.logger.error "500: #{request.url}"
|
56
56
|
Rails.logger.error exception.message
|
57
57
|
Rails.logger.error exception.backtrace.join("\n")
|
58
|
-
|
58
|
+
capture_error(exception)
|
59
59
|
begin
|
60
60
|
if rails_admin?
|
61
61
|
render text: t('rs.errors.internal_error_full', klass: exception.class.name, message: SmartExcerpt.h.strip_tags(exception.message)), status: 500
|
@@ -70,6 +70,12 @@ module RsErrors
|
|
70
70
|
render_error(500)
|
71
71
|
end
|
72
72
|
|
73
|
+
def capture_error(exception)
|
74
|
+
return unless defined?(Raven)
|
75
|
+
# Raven's capture_exception helper method is not defined in rails_admin
|
76
|
+
Raven.capture_exception(exception)
|
77
|
+
end
|
78
|
+
|
73
79
|
def render_error(code = 500)
|
74
80
|
render template: "errors/error_#{code}", formats: [:html], handlers: [:haml, :slim], layout: RocketCMS.config.error_layout, status: code
|
75
81
|
end
|
data/lib/rocket_cms/version.rb
CHANGED
data/rocket_cms.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.add_development_dependency 'bundler'
|
21
21
|
spec.add_development_dependency 'rake'
|
22
22
|
|
23
|
-
spec.add_dependency 'rails', '>= 4.1.0', '<
|
23
|
+
spec.add_dependency 'rails', '>= 4.1.0', '< 6.0'
|
24
24
|
|
25
25
|
spec.add_dependency 'jquery-rails'
|
26
26
|
spec.add_dependency 'coffee-rails'
|
data/template.rb
CHANGED
@@ -14,8 +14,8 @@ remove_file 'Gemfile'
|
|
14
14
|
create_file 'Gemfile' do <<-TEXT
|
15
15
|
source 'https://rubygems.org'
|
16
16
|
|
17
|
-
gem 'rails', '
|
18
|
-
#{if mongoid then "gem 'mongoid', '~>
|
17
|
+
gem 'rails', '5.0.1'
|
18
|
+
#{if mongoid then "gem 'mongoid', '~> 6.1.0'" else "gem 'pg'" end}
|
19
19
|
|
20
20
|
gem 'sass'
|
21
21
|
|
@@ -25,11 +25,13 @@ gem 'sass-rails'
|
|
25
25
|
gem 'compass-rails'
|
26
26
|
|
27
27
|
gem 'slim-rails'
|
28
|
-
|
28
|
+
|
29
|
+
gem 'devise'
|
30
|
+
gem 'devise-i18n'
|
29
31
|
gem 'cancancan'
|
30
32
|
|
31
33
|
gem 'cloner'
|
32
|
-
gem '
|
34
|
+
gem 'puma'
|
33
35
|
gem 'x-real-ip'
|
34
36
|
gem 'sentry-raven'
|
35
37
|
|
@@ -37,11 +39,12 @@ group :development do
|
|
37
39
|
gem 'better_errors'
|
38
40
|
gem 'binding_of_caller'
|
39
41
|
gem 'pry-rails'
|
42
|
+
gem 'listen'
|
40
43
|
gem 'spring'
|
41
44
|
|
42
45
|
gem 'capistrano', require: false
|
43
|
-
gem 'glebtv-capistrano-unicorn', require: false
|
44
46
|
gem 'capistrano-bundler', require: false
|
47
|
+
gem 'capistrano3-puma', require: false
|
45
48
|
gem 'capistrano-rails', require: false
|
46
49
|
|
47
50
|
gem 'hipchat'
|
@@ -73,6 +76,8 @@ create_file '.gitignore' do <<-TEXT
|
|
73
76
|
/public/system
|
74
77
|
/public/ckeditor_assets
|
75
78
|
/public/assets
|
79
|
+
/node_modules
|
80
|
+
/public/webpack
|
76
81
|
#{if mongoid then '/config/mongoid.yml' else '/config/database.yml' end}
|
77
82
|
/config/secrets.yml
|
78
83
|
TEXT
|
@@ -80,18 +85,6 @@ end
|
|
80
85
|
|
81
86
|
create_file 'extra/.gitkeep', ''
|
82
87
|
|
83
|
-
if mongoid
|
84
|
-
remove_file 'config/initializers/cookies_serializer.rb'
|
85
|
-
create_file 'config/initializers/cookies_serializer.rb' do <<-TEXT
|
86
|
-
# Be sure to restart your server when you modify this file.
|
87
|
-
# json serializer breaks Devise + Mongoid. DO NOT ENABLE
|
88
|
-
# See https://github.com/plataformatec/devise/pull/2882
|
89
|
-
# Rails.application.config.action_dispatch.cookies_serializer = :json
|
90
|
-
Rails.application.config.action_dispatch.cookies_serializer = :marshal
|
91
|
-
TEXT
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
95
88
|
remove_file 'app/controllers/application_controller.rb'
|
96
89
|
create_file 'app/controllers/application_controller.rb' do <<-TEXT
|
97
90
|
class ApplicationController < ActionController::Base
|
@@ -109,7 +102,7 @@ end
|
|
109
102
|
remove_file 'README.md'
|
110
103
|
create_file 'README.md', "## #{app_name}\nProject generated by RocketCMS\n\nORM: #{if mongoid then 'Mongoid' else 'ActiveRecord' end}\n\n"
|
111
104
|
|
112
|
-
create_file '.ruby-version', "2.
|
105
|
+
create_file '.ruby-version', "2.4.0\n"
|
113
106
|
create_file '.ruby-gemset', "#{app_name}\n"
|
114
107
|
|
115
108
|
run 'bundle install --without production'
|
@@ -145,7 +138,7 @@ development:
|
|
145
138
|
TEXT
|
146
139
|
end
|
147
140
|
say "Please create a PostgreSQL user #{app_name.downcase} with password #{app_name.downcase} and a database #{app_name.downcase}_development owned by him for development NOW.", :red
|
148
|
-
ask("Press <enter> when done."
|
141
|
+
ask("Press <enter> when done.")
|
149
142
|
end
|
150
143
|
|
151
144
|
unless mongoid
|
@@ -325,13 +318,57 @@ end
|
|
325
318
|
|
326
319
|
port = rand(100..999) * 10
|
327
320
|
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
321
|
+
remove_file 'config/puma.rb'
|
322
|
+
create_file 'config/puma.rb' do <<-TEXT
|
323
|
+
# Min and Max threads per worker
|
324
|
+
threads 1, 3
|
325
|
+
|
326
|
+
current_dir = File.expand_path("../..", __FILE__)
|
327
|
+
base_dir = File.expand_path("../../..", __FILE__)
|
328
|
+
|
329
|
+
|
330
|
+
# rackup DefaultRackup
|
331
|
+
|
332
|
+
# Default to production
|
333
|
+
rails_env = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || "development"
|
334
|
+
environment rails_env
|
335
|
+
|
336
|
+
if rails_env == 'development'
|
337
|
+
workers 1
|
338
|
+
bind 'tcp://0.0.0.0:#{port}'
|
339
|
+
else
|
340
|
+
# https://github.com/seuros/capistrano-puma/blob/642d141ee502546bd5a43a76cd9f6766dc0fcc7a/lib/capistrano/templates/puma.rb.erb#L25
|
341
|
+
prune_bundler
|
342
|
+
preload_app!
|
343
|
+
# Change to match your CPU core count
|
344
|
+
workers 1
|
345
|
+
#{'shared_dir = "#{base_dir}/shared"'}
|
346
|
+
# Set up socket location
|
347
|
+
#bind 'tcp://0.0.0.0:4000'
|
348
|
+
#{'bind "unix://#{shared_dir}/tmp/puma/socket"'}
|
349
|
+
# Logging
|
350
|
+
#{'stdout_redirect "#{shared_dir}/log/puma.stdout.log", "#{shared_dir}/log/puma.stderr.log", true'}
|
351
|
+
# Set master PID and state locations
|
352
|
+
#{'pidfile "#{shared_dir}/tmp/puma/pid"'}
|
353
|
+
#{'state_path "#{shared_dir}/tmp/puma/state"'}
|
354
|
+
activate_control_app
|
332
355
|
TEXT
|
333
356
|
end
|
334
357
|
|
358
|
+
on_restart do
|
359
|
+
puts 'Refreshing Gemfile'
|
360
|
+
ENV["BUNDLE_GEMFILE"] = "#{current_dir}/Gemfile" unless rails_env == 'development'
|
361
|
+
end
|
362
|
+
|
363
|
+
# mongoid reconnects by itself
|
364
|
+
on_worker_boot do
|
365
|
+
require "active_record"
|
366
|
+
ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
|
367
|
+
ActiveRecord::Base.establish_connection(YAML.load_file("#{current_dir}/config/database.yml")[rails_env])
|
368
|
+
end
|
369
|
+
|
370
|
+
end
|
371
|
+
|
335
372
|
|
336
373
|
remove_file 'app/views/layouts/application.html.erb'
|
337
374
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocket_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
version: 4.1.0
|
48
48
|
- - "<"
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: '
|
50
|
+
version: '6.0'
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
version: 4.1.0
|
58
58
|
- - "<"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '6.0'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: jquery-rails
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -349,7 +349,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
349
349
|
version: '0'
|
350
350
|
requirements: []
|
351
351
|
rubyforge_project:
|
352
|
-
rubygems_version: 2.
|
352
|
+
rubygems_version: 2.6.10
|
353
353
|
signing_key:
|
354
354
|
specification_version: 4
|
355
355
|
summary: Please DO NOT use this gem directly, use rocket_cms_mongoid or rocket_cms_activerecord
|