rocket_cms 0.31.1 → 0.35.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 +96 -93
- data/app/views/shared/_og.slim +2 -2
- data/lib/generators/rocket_cms/templates/webpack.config.js +1 -1
- data/lib/generators/rocket_cms/templates/webpack/flash/index.es6 +12 -8
- data/lib/rocket_cms/version.rb +1 -1
- data/rocket_cms.gemspec +1 -1
- data/template.rb +115 -30
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a90552d8b2be28d032feff8ff02ee3b6f3d77caa692ae015cf9395b711a4876
|
4
|
+
data.tar.gz: 901754951a02fcce2aa66905101a51f6a34d97a77844bf6f07f9a7a959f23de8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dab7f7ab31b57f0b371f8d8e6c60df3186b6f4738d68c0e55d2b64325cca99b763172d66d5183006a9e714353fb8c6e3e68f35ff283138a052b0e0cb2439cb7
|
7
|
+
data.tar.gz: 2546fff6283204b2af1d29effe641c9f787159ede53f1638dabb427378693bb0a2cfabb49a7b541a60bc38e9ba06900018a66cb5bfe9a0327ae8fd6da3f3feb8
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rocket_cms (0.
|
4
|
+
rocket_cms (0.35.0)
|
5
5
|
addressable
|
6
6
|
coffee-rails
|
7
7
|
jquery-rails
|
8
8
|
kaminari
|
9
9
|
manual_slug
|
10
|
-
rails (>= 5.1, < 6.
|
10
|
+
rails (>= 5.1, < 6.2)
|
11
11
|
smart_excerpt
|
12
12
|
stringex
|
13
13
|
thor
|
@@ -16,64 +16,68 @@ PATH
|
|
16
16
|
GEM
|
17
17
|
remote: https://rubygems.org/
|
18
18
|
specs:
|
19
|
-
actioncable (6.0
|
20
|
-
actionpack (= 6.0
|
19
|
+
actioncable (6.1.0)
|
20
|
+
actionpack (= 6.1.0)
|
21
|
+
activesupport (= 6.1.0)
|
21
22
|
nio4r (~> 2.0)
|
22
23
|
websocket-driver (>= 0.6.1)
|
23
|
-
actionmailbox (6.0
|
24
|
-
actionpack (= 6.0
|
25
|
-
activejob (= 6.0
|
26
|
-
activerecord (= 6.0
|
27
|
-
activestorage (= 6.0
|
28
|
-
activesupport (= 6.0
|
24
|
+
actionmailbox (6.1.0)
|
25
|
+
actionpack (= 6.1.0)
|
26
|
+
activejob (= 6.1.0)
|
27
|
+
activerecord (= 6.1.0)
|
28
|
+
activestorage (= 6.1.0)
|
29
|
+
activesupport (= 6.1.0)
|
29
30
|
mail (>= 2.7.1)
|
30
|
-
actionmailer (6.0
|
31
|
-
actionpack (= 6.0
|
32
|
-
actionview (= 6.0
|
33
|
-
activejob (= 6.0
|
31
|
+
actionmailer (6.1.0)
|
32
|
+
actionpack (= 6.1.0)
|
33
|
+
actionview (= 6.1.0)
|
34
|
+
activejob (= 6.1.0)
|
35
|
+
activesupport (= 6.1.0)
|
34
36
|
mail (~> 2.5, >= 2.5.4)
|
35
37
|
rails-dom-testing (~> 2.0)
|
36
|
-
actionpack (6.0
|
37
|
-
actionview (= 6.0
|
38
|
-
activesupport (= 6.0
|
39
|
-
rack (~> 2.0)
|
38
|
+
actionpack (6.1.0)
|
39
|
+
actionview (= 6.1.0)
|
40
|
+
activesupport (= 6.1.0)
|
41
|
+
rack (~> 2.0, >= 2.0.9)
|
40
42
|
rack-test (>= 0.6.3)
|
41
43
|
rails-dom-testing (~> 2.0)
|
42
44
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
43
|
-
actiontext (6.0
|
44
|
-
actionpack (= 6.0
|
45
|
-
activerecord (= 6.0
|
46
|
-
activestorage (= 6.0
|
47
|
-
activesupport (= 6.0
|
45
|
+
actiontext (6.1.0)
|
46
|
+
actionpack (= 6.1.0)
|
47
|
+
activerecord (= 6.1.0)
|
48
|
+
activestorage (= 6.1.0)
|
49
|
+
activesupport (= 6.1.0)
|
48
50
|
nokogiri (>= 1.8.5)
|
49
|
-
actionview (6.0
|
50
|
-
activesupport (= 6.0
|
51
|
+
actionview (6.1.0)
|
52
|
+
activesupport (= 6.1.0)
|
51
53
|
builder (~> 3.1)
|
52
54
|
erubi (~> 1.4)
|
53
55
|
rails-dom-testing (~> 2.0)
|
54
56
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
55
|
-
activejob (6.0
|
56
|
-
activesupport (= 6.0
|
57
|
+
activejob (6.1.0)
|
58
|
+
activesupport (= 6.1.0)
|
57
59
|
globalid (>= 0.3.6)
|
58
|
-
activemodel (6.0
|
59
|
-
activesupport (= 6.0
|
60
|
-
activerecord (6.0
|
61
|
-
activemodel (= 6.0
|
62
|
-
activesupport (= 6.0
|
63
|
-
activestorage (6.0
|
64
|
-
actionpack (= 6.0
|
65
|
-
activejob (= 6.0
|
66
|
-
activerecord (= 6.0
|
60
|
+
activemodel (6.1.0)
|
61
|
+
activesupport (= 6.1.0)
|
62
|
+
activerecord (6.1.0)
|
63
|
+
activemodel (= 6.1.0)
|
64
|
+
activesupport (= 6.1.0)
|
65
|
+
activestorage (6.1.0)
|
66
|
+
actionpack (= 6.1.0)
|
67
|
+
activejob (= 6.1.0)
|
68
|
+
activerecord (= 6.1.0)
|
69
|
+
activesupport (= 6.1.0)
|
67
70
|
marcel (~> 0.3.1)
|
68
|
-
|
71
|
+
mimemagic (~> 0.3.2)
|
72
|
+
activesupport (6.1.0)
|
69
73
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
70
|
-
i18n (>=
|
71
|
-
minitest (
|
72
|
-
tzinfo (~>
|
73
|
-
zeitwerk (~> 2.
|
74
|
+
i18n (>= 1.6, < 2)
|
75
|
+
minitest (>= 5.1)
|
76
|
+
tzinfo (~> 2.0)
|
77
|
+
zeitwerk (~> 2.3)
|
74
78
|
addressable (2.7.0)
|
75
79
|
public_suffix (>= 2.0.2, < 5.0)
|
76
|
-
builder (3.2.
|
80
|
+
builder (3.2.4)
|
77
81
|
coffee-rails (5.0.0)
|
78
82
|
coffee-script (>= 2.2.0)
|
79
83
|
railties (>= 5.2.0)
|
@@ -81,32 +85,32 @@ GEM
|
|
81
85
|
coffee-script-source
|
82
86
|
execjs
|
83
87
|
coffee-script-source (1.12.2)
|
84
|
-
concurrent-ruby (1.1.
|
85
|
-
crass (1.0.
|
86
|
-
erubi (1.
|
88
|
+
concurrent-ruby (1.1.7)
|
89
|
+
crass (1.0.6)
|
90
|
+
erubi (1.10.0)
|
87
91
|
execjs (2.7.0)
|
88
92
|
globalid (0.4.2)
|
89
93
|
activesupport (>= 4.2.0)
|
90
94
|
htmlentities (4.3.4)
|
91
|
-
i18n (1.
|
95
|
+
i18n (1.8.5)
|
92
96
|
concurrent-ruby (~> 1.0)
|
93
|
-
jquery-rails (4.
|
97
|
+
jquery-rails (4.4.0)
|
94
98
|
rails-dom-testing (>= 1, < 3)
|
95
99
|
railties (>= 4.2.0)
|
96
100
|
thor (>= 0.14, < 2.0)
|
97
|
-
kaminari (1.
|
101
|
+
kaminari (1.2.1)
|
98
102
|
activesupport (>= 4.1.0)
|
99
|
-
kaminari-actionview (= 1.
|
100
|
-
kaminari-activerecord (= 1.
|
101
|
-
kaminari-core (= 1.
|
102
|
-
kaminari-actionview (1.
|
103
|
+
kaminari-actionview (= 1.2.1)
|
104
|
+
kaminari-activerecord (= 1.2.1)
|
105
|
+
kaminari-core (= 1.2.1)
|
106
|
+
kaminari-actionview (1.2.1)
|
103
107
|
actionview
|
104
|
-
kaminari-core (= 1.
|
105
|
-
kaminari-activerecord (1.
|
108
|
+
kaminari-core (= 1.2.1)
|
109
|
+
kaminari-activerecord (1.2.1)
|
106
110
|
activerecord
|
107
|
-
kaminari-core (= 1.
|
108
|
-
kaminari-core (1.
|
109
|
-
loofah (2.
|
111
|
+
kaminari-core (= 1.2.1)
|
112
|
+
kaminari-core (1.2.1)
|
113
|
+
loofah (2.8.0)
|
110
114
|
crass (~> 1.0.2)
|
111
115
|
nokogiri (>= 1.5.9)
|
112
116
|
mail (2.7.1)
|
@@ -115,66 +119,65 @@ GEM
|
|
115
119
|
activesupport
|
116
120
|
marcel (0.3.3)
|
117
121
|
mimemagic (~> 0.3.2)
|
118
|
-
method_source (0.
|
119
|
-
mimemagic (0.3.
|
122
|
+
method_source (1.0.0)
|
123
|
+
mimemagic (0.3.5)
|
120
124
|
mini_mime (1.0.2)
|
121
125
|
mini_portile2 (2.4.0)
|
122
|
-
minitest (5.
|
123
|
-
nio4r (2.5.
|
124
|
-
nokogiri (1.10.
|
126
|
+
minitest (5.14.2)
|
127
|
+
nio4r (2.5.4)
|
128
|
+
nokogiri (1.10.10)
|
125
129
|
mini_portile2 (~> 2.4.0)
|
126
|
-
public_suffix (4.0.
|
127
|
-
rack (2.
|
130
|
+
public_suffix (4.0.6)
|
131
|
+
rack (2.2.3)
|
128
132
|
rack-test (1.1.0)
|
129
133
|
rack (>= 1.0, < 3)
|
130
|
-
rails (6.0
|
131
|
-
actioncable (= 6.0
|
132
|
-
actionmailbox (= 6.0
|
133
|
-
actionmailer (= 6.0
|
134
|
-
actionpack (= 6.0
|
135
|
-
actiontext (= 6.0
|
136
|
-
actionview (= 6.0
|
137
|
-
activejob (= 6.0
|
138
|
-
activemodel (= 6.0
|
139
|
-
activerecord (= 6.0
|
140
|
-
activestorage (= 6.0
|
141
|
-
activesupport (= 6.0
|
142
|
-
bundler (>= 1.
|
143
|
-
railties (= 6.0
|
134
|
+
rails (6.1.0)
|
135
|
+
actioncable (= 6.1.0)
|
136
|
+
actionmailbox (= 6.1.0)
|
137
|
+
actionmailer (= 6.1.0)
|
138
|
+
actionpack (= 6.1.0)
|
139
|
+
actiontext (= 6.1.0)
|
140
|
+
actionview (= 6.1.0)
|
141
|
+
activejob (= 6.1.0)
|
142
|
+
activemodel (= 6.1.0)
|
143
|
+
activerecord (= 6.1.0)
|
144
|
+
activestorage (= 6.1.0)
|
145
|
+
activesupport (= 6.1.0)
|
146
|
+
bundler (>= 1.15.0)
|
147
|
+
railties (= 6.1.0)
|
144
148
|
sprockets-rails (>= 2.0.0)
|
145
149
|
rails-dom-testing (2.0.3)
|
146
150
|
activesupport (>= 4.2.0)
|
147
151
|
nokogiri (>= 1.6)
|
148
152
|
rails-html-sanitizer (1.3.0)
|
149
153
|
loofah (~> 2.3)
|
150
|
-
railties (6.0
|
151
|
-
actionpack (= 6.0
|
152
|
-
activesupport (= 6.0
|
154
|
+
railties (6.1.0)
|
155
|
+
actionpack (= 6.1.0)
|
156
|
+
activesupport (= 6.1.0)
|
153
157
|
method_source
|
154
158
|
rake (>= 0.8.7)
|
155
|
-
thor (
|
156
|
-
rake (13.0.
|
159
|
+
thor (~> 1.0)
|
160
|
+
rake (13.0.3)
|
157
161
|
smart_excerpt (0.1.6)
|
158
162
|
activesupport
|
159
163
|
htmlentities
|
160
|
-
sprockets (4.0.
|
164
|
+
sprockets (4.0.2)
|
161
165
|
concurrent-ruby (~> 1.0)
|
162
166
|
rack (> 1, < 3)
|
163
|
-
sprockets-rails (3.2.
|
167
|
+
sprockets-rails (3.2.2)
|
164
168
|
actionpack (>= 4.0)
|
165
169
|
activesupport (>= 4.0)
|
166
170
|
sprockets (>= 3.0.0)
|
167
171
|
stringex (2.8.5)
|
168
|
-
thor (0.
|
169
|
-
|
170
|
-
|
171
|
-
thread_safe (~> 0.1)
|
172
|
+
thor (1.0.1)
|
173
|
+
tzinfo (2.0.4)
|
174
|
+
concurrent-ruby (~> 1.0)
|
172
175
|
validates_email_format_of (1.6.3)
|
173
176
|
i18n
|
174
|
-
websocket-driver (0.7.
|
177
|
+
websocket-driver (0.7.3)
|
175
178
|
websocket-extensions (>= 0.1.0)
|
176
|
-
websocket-extensions (0.1.
|
177
|
-
zeitwerk (2.2
|
179
|
+
websocket-extensions (0.1.5)
|
180
|
+
zeitwerk (2.4.2)
|
178
181
|
|
179
182
|
PLATFORMS
|
180
183
|
ruby
|
@@ -185,4 +188,4 @@ DEPENDENCIES
|
|
185
188
|
rocket_cms!
|
186
189
|
|
187
190
|
BUNDLED WITH
|
188
|
-
1.
|
191
|
+
2.1.4
|
data/app/views/shared/_og.slim
CHANGED
@@ -4,5 +4,5 @@
|
|
4
4
|
meta property='og:image' content="http://#{request.host_with_port}#{image}"
|
5
5
|
- if defined?(desc) && !desc.blank?
|
6
6
|
meta property='og:description' content=desc
|
7
|
-
- if defined?(
|
8
|
-
meta property='og:url' content=
|
7
|
+
- if defined?(og_url) && !og_url.blank?
|
8
|
+
meta property='og:url' content=og_url
|
@@ -1,12 +1,16 @@
|
|
1
1
|
import './index.sass';
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
//document.addEventListener('DOMContentLoaded', function () {
|
4
|
+
document.addEventListener("turbolinks:load", function() {
|
5
|
+
var close = document.querySelectorAll("a.close_flash");
|
6
|
+
close.forEach(function(n) {
|
7
|
+
n.addEventListener("click", function() {
|
8
|
+
var msg = this.parentNode.parentNode;
|
9
|
+
var box = msg.parentNode;
|
10
|
+
this.parentNode.parentNode.remove();
|
11
|
+
if (box.childNodes.length == 0) {
|
12
|
+
box.remove()
|
13
|
+
}
|
14
|
+
})
|
10
15
|
})
|
11
16
|
});
|
12
|
-
|
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', '>= 5.1', '< 6.
|
23
|
+
spec.add_dependency 'rails', '>= 5.1', '< 6.2'
|
24
24
|
spec.add_dependency 'jquery-rails'
|
25
25
|
spec.add_dependency 'coffee-rails'
|
26
26
|
#spec.add_dependency 'turbolinks'
|
data/template.rb
CHANGED
@@ -3,8 +3,11 @@ version = rails_spec.version.to_s
|
|
3
3
|
|
4
4
|
mongoid = options[:skip_active_record]
|
5
5
|
yarn = !options[:skip_yarn]
|
6
|
-
is_dev = options[:template].
|
6
|
+
is_dev = !options[:template].start_with?("http")
|
7
7
|
spring = !options[:skip_spring]
|
8
|
+
if is_dev
|
9
|
+
rocket_cms_path = File.realpath(options[:template] + "/..")
|
10
|
+
end
|
8
11
|
|
9
12
|
if Gem::Version.new(version) < Gem::Version.new('6.0.0')
|
10
13
|
puts "You are using an old version of Rails (#{version})"
|
@@ -24,15 +27,14 @@ git_source(:github) do |repo_name|
|
|
24
27
|
"https://github.com/#{repo_name}.git"
|
25
28
|
end
|
26
29
|
'}
|
27
|
-
gem 'rails', '6.0
|
30
|
+
gem 'rails', '~> 6.1.0'
|
28
31
|
gem 'rails-i18n'
|
29
|
-
#{if mongoid then "gem 'mongoid', '~>
|
32
|
+
#{if mongoid then "gem 'mongoid', '~> 7.2.0'" else "gem 'pg', '>= 0.18', '< 2.0'" end}
|
30
33
|
gem 'turbolinks' #required for redirects even if using via webpack
|
31
34
|
|
32
|
-
|
33
35
|
#{
|
34
|
-
"#{if mongoid then "gem 'rocket_cms_mongoid', path: '
|
35
|
-
gem 'rocket_cms', path: '
|
36
|
+
"#{if mongoid then "gem 'rocket_cms_mongoid', path: '#{rocket_cms_path}'" else "gem 'rocket_cms_activerecord', path: '#{rocket_cms_path}'" end}
|
37
|
+
gem 'rocket_cms', path: '#{rocket_cms_path}'" if is_dev}
|
36
38
|
#{"#{if mongoid then "gem 'rocket_cms_mongoid'" else "gem 'rocket_cms_activerecord'" end}" if !is_dev}
|
37
39
|
|
38
40
|
gem 'glebtv-ckeditor'
|
@@ -87,16 +89,21 @@ group :development do
|
|
87
89
|
gem 'capistrano-rails', require: false
|
88
90
|
end
|
89
91
|
|
90
|
-
group :test do
|
92
|
+
group :development, :test do
|
93
|
+
gem "factory_bot_rails"
|
91
94
|
gem 'rspec-rails'
|
92
|
-
gem 'email_spec'
|
93
95
|
#{if mongoid then " gem 'mongoid-rspec'" else "" end}
|
94
|
-
gem 'ffaker'
|
95
|
-
gem 'factory_bot_rails'
|
96
|
-
|
97
96
|
gem 'capybara'
|
98
|
-
|
97
|
+
# https://github.com/mattheworiordan/capybara-screenshot/issues/243
|
98
|
+
gem 'capybara-screenshot'
|
99
|
+
gem 'selenium-webdriver'
|
100
|
+
gem 'webdrivers'
|
99
101
|
gem 'database_cleaner'
|
102
|
+
#{if mongoid then " gem 'database_cleaner-mongoid'" else "" end}
|
103
|
+
#gem 'database_cleaner-redis'
|
104
|
+
gem 'ffaker'
|
105
|
+
gem 'timecop'
|
106
|
+
gem "pry-rails"
|
100
107
|
gem 'childprocess'
|
101
108
|
end
|
102
109
|
|
@@ -157,14 +164,14 @@ ORM: #{if mongoid then 'Mongoid' else 'ActiveRecord' end}
|
|
157
164
|
|
158
165
|
To run (windows):
|
159
166
|
```
|
160
|
-
|
167
|
+
yarn start
|
161
168
|
bundle exec rails s webrick
|
162
169
|
```
|
163
170
|
|
164
171
|
|
165
172
|
To run (nix/mac):
|
166
173
|
```
|
167
|
-
|
174
|
+
yarn start
|
168
175
|
puma
|
169
176
|
```
|
170
177
|
|
@@ -353,20 +360,40 @@ end
|
|
353
360
|
|
354
361
|
create_file 'extra/shrine/plugins/custom_pretty_location.rb' do <<-TEXT
|
355
362
|
require 'shrine/plugins/pretty_location'
|
363
|
+
|
356
364
|
class Shrine
|
357
365
|
module Plugins
|
358
366
|
module CustomPrettyLocation
|
359
|
-
|
367
|
+
def self.configure(uploader, **opts)
|
368
|
+
uploader.opts[:custom_pretty_location] ||= { identifier: :id }
|
369
|
+
uploader.opts[:custom_pretty_location].merge!(opts)
|
370
|
+
end
|
360
371
|
|
361
372
|
module InstanceMethods
|
362
|
-
|
373
|
+
def generate_location(io, **options)
|
374
|
+
custom_pretty_location(io, **options)
|
375
|
+
end
|
376
|
+
|
377
|
+
def custom_pretty_location(io, name: nil, record: nil, version: nil, derivative: nil, identifier: nil, metadata: {}, **)
|
378
|
+
if record
|
379
|
+
namespace = record_namespace(record)
|
380
|
+
identifier ||= record_identifier(record)
|
381
|
+
end
|
382
|
+
|
383
|
+
basename = basic_location(io, metadata: metadata)
|
384
|
+
basename = [*(version || derivative), basename].join("-")
|
385
|
+
|
386
|
+
[*namespace, *identifier, *name, basename].join("/")
|
387
|
+
end
|
388
|
+
|
389
|
+
private
|
363
390
|
|
364
391
|
def record_identifier(record)
|
365
392
|
id = record.public_send(opts[:custom_pretty_location][:identifier])
|
366
393
|
case id
|
367
394
|
when Integer
|
368
395
|
str_id = "%09d".freeze % id
|
369
|
-
str_id.scan(
|
396
|
+
str_id.scan(/\\d{3}/).join("/".freeze)
|
370
397
|
when String
|
371
398
|
id.scan(/.{3}/).first(3).join("/".freeze)
|
372
399
|
else
|
@@ -374,8 +401,27 @@ class Shrine
|
|
374
401
|
nil
|
375
402
|
end
|
376
403
|
end
|
377
|
-
end
|
378
404
|
|
405
|
+
def transform_class_name(class_name)
|
406
|
+
if opts[:custom_pretty_location][:class_underscore]
|
407
|
+
class_name.gsub(/([A-Z]+)([A-Z][a-z])/, '\\1_\\2').gsub(/([a-z])([A-Z])/, '\\1_\\2').downcase
|
408
|
+
else
|
409
|
+
class_name.downcase
|
410
|
+
end
|
411
|
+
end
|
412
|
+
|
413
|
+
def record_namespace(record)
|
414
|
+
class_name = record.class.name or return
|
415
|
+
parts = transform_class_name(class_name).split("::")
|
416
|
+
|
417
|
+
if separator = opts[:custom_pretty_location][:namespace]
|
418
|
+
parts.join(separator)
|
419
|
+
else
|
420
|
+
parts.last
|
421
|
+
end
|
422
|
+
end
|
423
|
+
|
424
|
+
end
|
379
425
|
end
|
380
426
|
register_plugin(:custom_pretty_location, CustomPrettyLocation)
|
381
427
|
end
|
@@ -770,18 +816,57 @@ TEXT
|
|
770
816
|
end
|
771
817
|
|
772
818
|
create_file "spec/support/capybara.rb" do <<-TEXT
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
819
|
+
if ENV['CI']
|
820
|
+
Selenium::WebDriver::Chrome.path = '/usr/bin/google-chrome-stable'
|
821
|
+
else
|
822
|
+
begin
|
823
|
+
Selenium::WebDriver::Chrome.path = '/usr/bin/chromium'
|
824
|
+
rescue Selenium::WebDriver::Error::WebDriverError
|
825
|
+
end
|
826
|
+
end
|
827
|
+
|
828
|
+
Capybara.register_driver :chrome_root do |app|
|
829
|
+
service = ::Selenium::WebDriver::Service.chrome#(args: { verbose: true, log_path: 'chromedriver.log' })
|
830
|
+
options = ::Selenium::WebDriver::Chrome::Options.new
|
831
|
+
options.args << '--headless' unless ENV['NO_HEADLESS']
|
832
|
+
options.args << '--no-sandbox'
|
833
|
+
options.args << '--window-size=1280,1024'
|
834
|
+
|
835
|
+
Capybara::Selenium::Driver.new(app, browser: :chrome, options: options, service: service)
|
836
|
+
end
|
837
|
+
# не работает, установлено выше
|
838
|
+
# Capybara::Screenshot.webkit_options = { width: 1280, height: 1024 }
|
839
|
+
|
840
|
+
if ENV['CHROME_VISIBLE']
|
841
|
+
Capybara.javascript_driver = :selenium_chrome
|
842
|
+
else
|
843
|
+
Capybara.javascript_driver = :chrome_root
|
844
|
+
end
|
845
|
+
Capybara.default_driver = :rack_test
|
846
|
+
Capybara.default_max_wait_time = 15
|
847
|
+
Capybara.register_server :puma do |app, port, host|
|
848
|
+
require 'rack/handler/puma'
|
849
|
+
Rack::Handler::Puma.run(app, Host: host, Port: port, Threads: "1:1")
|
850
|
+
end
|
851
|
+
|
852
|
+
Capybara.configure do |config|
|
853
|
+
config.app_host = "http://\#{Rails.application.secrets.host}"
|
854
|
+
config.server = :puma
|
855
|
+
config.server_port = 9332
|
856
|
+
config.run_server = true
|
857
|
+
config.always_include_port = true
|
858
|
+
end
|
859
|
+
|
860
|
+
|
861
|
+
Capybara::Screenshot.register_driver(:selenium_chrome) do |driver, path|
|
862
|
+
driver.browser.save_screenshot(path)
|
863
|
+
end
|
864
|
+
Capybara::Screenshot.register_driver(:chrome_root) do |driver, path|
|
865
|
+
driver.browser.save_screenshot(path)
|
866
|
+
end
|
867
|
+
|
868
|
+
Capybara::Screenshot.autosave_on_failure = true
|
869
|
+
|
785
870
|
TEXT
|
786
871
|
end
|
787
872
|
|
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.35.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- glebtv
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-12-23 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: '5.1'
|
48
48
|
- - "<"
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: '6.
|
50
|
+
version: '6.2'
|
51
51
|
type: :runtime
|
52
52
|
prerelease: false
|
53
53
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
version: '5.1'
|
58
58
|
- - "<"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '6.
|
60
|
+
version: '6.2'
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: jquery-rails
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
@@ -349,7 +349,7 @@ homepage: https://gitlab.com/rocket-science/rocket_cms
|
|
349
349
|
licenses:
|
350
350
|
- MIT
|
351
351
|
metadata: {}
|
352
|
-
post_install_message:
|
352
|
+
post_install_message:
|
353
353
|
rdoc_options: []
|
354
354
|
require_paths:
|
355
355
|
- lib
|
@@ -364,8 +364,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
364
364
|
- !ruby/object:Gem::Version
|
365
365
|
version: '0'
|
366
366
|
requirements: []
|
367
|
-
rubygems_version: 3.
|
368
|
-
signing_key:
|
367
|
+
rubygems_version: 3.1.4
|
368
|
+
signing_key:
|
369
369
|
specification_version: 4
|
370
370
|
summary: Please DO NOT use this gem directly, use rocket_cms_mongoid or rocket_cms_activerecord
|
371
371
|
instead!
|