pageflow-support 16.1.0 → 17.0.0
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.
- checksums.yaml +4 -4
- data/pageflow/caching_test_helpers.rb +20 -0
- data/pageflow/dummy/app.rb +3 -3
- data/pageflow/dummy/config/pageflow.rb +15 -14
- data/pageflow/dummy/rails_template.rb +18 -7
- data/pageflow/support/config/capybara.rb +7 -12
- data/pageflow/support/config/paperclip.rb +1 -1
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 746ba5bb5b07c1ed4d31d74aa067873c876a9ecd07e9d76dfc08395459f19fd1
|
4
|
+
data.tar.gz: 9cb529a7f934496119e056822e66826ce9aac90e2b8743e8874cca9c30553313
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3485fa1f941a442e7e2f1d703d38d15bf92f7587e5f96bc415d3f49e118c2f84ceb4d20037d89c30d8169fcf2bab136ec1bedea9375c48e828f18d4ad6bd441d
|
7
|
+
data.tar.gz: ec77c3b28a9468b27220d0a664167c9440676626cee02af0c61b34f4ec2abe144416194bf888789fb5decb4fe83cc04fdffbddf333cb77f755a6a1ff7e6474d6
|
@@ -0,0 +1,20 @@
|
|
1
|
+
RSpec.configure do |config|
|
2
|
+
# Inspired by
|
3
|
+
# https://gitlab.com/gitlab-org/gitlab-foss/-/blob/6f5be4b446db2f17fc0307c4fce8ae285b35d89a/spec/support/caching.rb
|
4
|
+
config.around(:each, :use_clean_rails_memory_store_fragment_caching) do |example|
|
5
|
+
rails_cache = Rails.cache
|
6
|
+
controller_cache_store = ActionController::Base.cache_store
|
7
|
+
|
8
|
+
# Also replace Rails.cache for consistency since JBuilder uses
|
9
|
+
# it directly to cache fragments instead of going through
|
10
|
+
# ActionController::Base.cache_store.
|
11
|
+
ActionController::Base.cache_store = Rails.cache = ActiveSupport::Cache::MemoryStore.new
|
12
|
+
ActionController::Base.perform_caching = true
|
13
|
+
|
14
|
+
example.run
|
15
|
+
ensure
|
16
|
+
ActionController::Base.perform_caching = false
|
17
|
+
ActionController::Base.cache_store = controller_cache_store
|
18
|
+
Rails.cache = rails_cache
|
19
|
+
end
|
20
|
+
end
|
data/pageflow/dummy/app.rb
CHANGED
@@ -11,13 +11,13 @@ module Pageflow
|
|
11
11
|
if File.exist?(directory)
|
12
12
|
puts("Dummy directory #{directory} exists.")
|
13
13
|
else
|
14
|
-
system(
|
14
|
+
system('SKIP_EAGER_LOAD=true ' \
|
15
|
+
"bundle exec rails new #{directory} --skip-spring " \
|
15
16
|
"--template #{template_path} #{rails_new_options}") ||
|
16
17
|
raise('Error generating dummy app.')
|
17
18
|
end
|
18
19
|
|
19
20
|
require(File.join(ENV['RAILS_ROOT'], 'config', 'environment'))
|
20
|
-
require('pageflow/dummy/config/pageflow')
|
21
21
|
end
|
22
22
|
|
23
23
|
def directory
|
@@ -31,7 +31,7 @@ module Pageflow
|
|
31
31
|
|
32
32
|
def rails_new_options
|
33
33
|
result = '--skip-test-unit --skip-bundle --database=mysql'
|
34
|
-
result << ' --skip-javascript'
|
34
|
+
result << ' --skip-javascript'
|
35
35
|
result
|
36
36
|
end
|
37
37
|
end
|
@@ -1,19 +1,20 @@
|
|
1
1
|
Pageflow.configure do |config|
|
2
|
-
config.
|
2
|
+
s3_bucket = config.paperclip_s3_default_options.dig(:s3_credentials, :bucket)
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
url: '/system/s3/:class/:attachment/:id_partition/:style/:filename',
|
7
|
-
path: ':rails_root/public:url'
|
8
|
-
)
|
4
|
+
if s3_bucket == 'com-example-pageflow-development'
|
5
|
+
config.paperclip_s3_root = 'test-host'
|
9
6
|
|
10
|
-
|
11
|
-
|
12
|
-
url: '
|
13
|
-
|
14
|
-
|
7
|
+
config.paperclip_s3_default_options.merge!(
|
8
|
+
storage: :filesystem,
|
9
|
+
url: '/system/s3/:class/:attachment/:id_partition/:style/:filename',
|
10
|
+
path: ':rails_root/public:url'
|
11
|
+
)
|
12
|
+
|
13
|
+
config.paperclip_direct_upload_options = lambda do |_|
|
14
|
+
{
|
15
|
+
url: '#',
|
16
|
+
fields: []
|
17
|
+
}
|
18
|
+
end
|
15
19
|
end
|
16
20
|
end
|
17
|
-
|
18
|
-
# Reconstruct current config to ensure config block above is used
|
19
|
-
Pageflow.configure!
|
@@ -21,6 +21,10 @@ gsub_file('config/database.yml',
|
|
21
21
|
/^ database: /,
|
22
22
|
" database: #{database_prefix}-")
|
23
23
|
|
24
|
+
gsub_file('config/environments/test.rb',
|
25
|
+
'config.eager_load = ENV["CI"].present?',
|
26
|
+
'config.eager_load = ENV["CI"].present? && !ENV["SKIP_EAGER_LOAD"]')
|
27
|
+
|
24
28
|
append_to_file('config/application.rb', <<-END)
|
25
29
|
if ENV['PAGEFLOW_DB_HOST'].present?
|
26
30
|
ActiveRecord::Tasks::DatabaseTasks::LOCAL_HOSTS << ENV['PAGEFLOW_DB_HOST']
|
@@ -40,20 +44,21 @@ end
|
|
40
44
|
# Recreate db. Ignore if it does not exist.
|
41
45
|
|
42
46
|
in_root { run('rake db:environment:set db:drop:all', capture: true, abort_on_failure: false) }
|
47
|
+
|
48
|
+
rake 'db:create' # workaround for https://github.com/rails/rails/issues/50038
|
43
49
|
rake 'db:create:all'
|
44
50
|
|
45
51
|
# Install Webpacker
|
46
52
|
|
47
|
-
if
|
48
|
-
rake 'shakapacker:install' if ENV['PAGEFLOW_INSTALL_WEBPACKER'] == 'true'
|
49
|
-
else
|
50
|
-
rake 'webpacker:install' if ENV['PAGEFLOW_INSTALL_WEBPACKER'] == 'true'
|
51
|
-
end
|
53
|
+
rake 'shakapacker:install' if ENV['PAGEFLOW_INSTALL_SHAKAPACKER'] == 'true'
|
52
54
|
|
53
55
|
# Install pageflow and the tested engine via their generators.
|
54
56
|
|
55
57
|
generate 'pageflow:install', '--force'
|
56
|
-
|
58
|
+
|
59
|
+
if ENV['PAGEFLOW_PLUGIN_ENGINE'].present?
|
60
|
+
generate "#{ENV['PAGEFLOW_PLUGIN_ENGINE']}:install", '--force'
|
61
|
+
end
|
57
62
|
|
58
63
|
# Devise needs default_url_options for generating mails.
|
59
64
|
|
@@ -67,6 +72,12 @@ prepend_to_file('config/initializers/pageflow.rb', <<-END)
|
|
67
72
|
ActiveAdmin.application.load_paths.unshift(Dir[Rails.root.join('app/admin')].first)\n
|
68
73
|
END
|
69
74
|
|
75
|
+
# Adapt default configuration
|
76
|
+
|
77
|
+
inject_into_file('config/initializers/pageflow.rb',
|
78
|
+
"require 'pageflow/dummy/config/pageflow'\n",
|
79
|
+
after: "Pageflow.finalize!\n")
|
80
|
+
|
70
81
|
# Add required files for test theme
|
71
82
|
|
72
83
|
copy_file('test_theme.scss',
|
@@ -95,4 +106,4 @@ copy_file('create_test_revision_components.rb',
|
|
95
106
|
copy_file('add_custom_fields.rb',
|
96
107
|
'db/migrate/99990000000000_add_custom_fields.rb')
|
97
108
|
|
98
|
-
rake 'db:migrate db:test:
|
109
|
+
rake 'db:migrate db:test:load_schema', env: 'development'
|
@@ -1,24 +1,19 @@
|
|
1
1
|
require 'capybara/rspec'
|
2
2
|
require 'selenium-webdriver'
|
3
3
|
require 'capybara/chromedriver/logger'
|
4
|
-
require 'webdrivers/chromedriver'
|
5
4
|
|
6
5
|
Capybara.register_driver :selenium_chrome_headless_no_sandbox do |app|
|
7
|
-
|
8
|
-
|
9
|
-
browser_options.args << '--disable-gpu'
|
10
|
-
# Required for chrome to work in container based Travis environment
|
11
|
-
# (see https://docs.travis-ci.com/user/chrome)
|
12
|
-
browser_options.args << '--no-sandbox'
|
13
|
-
|
14
|
-
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
|
15
|
-
# see https://github.com/SeleniumHQ/selenium/issues/3738
|
16
|
-
'goog:loggingPrefs': {browser: 'ALL'}
|
6
|
+
options = Selenium::WebDriver::Options.chrome(
|
7
|
+
logging_prefs: {browser: 'ALL'}
|
17
8
|
)
|
18
9
|
|
10
|
+
options.add_argument('--headless=new')
|
11
|
+
options.add_argument('--no-sandbox')
|
12
|
+
options.add_argument('--disable-gpu') if Gem.win_platform?
|
13
|
+
|
19
14
|
Capybara::Selenium::Driver.new(app,
|
20
15
|
browser: :chrome,
|
21
|
-
|
16
|
+
options: options)
|
22
17
|
end
|
23
18
|
|
24
19
|
Capybara.javascript_driver = :selenium_chrome_headless_no_sandbox
|
@@ -13,7 +13,7 @@ RSpec.configure do |config|
|
|
13
13
|
|
14
14
|
config.before(:each) do |example|
|
15
15
|
unless example.metadata[:unstub_paperclip] || example.metadata[:js]
|
16
|
-
allow_any_instance_of(Paperclip::Attachment).to receive(:
|
16
|
+
allow_any_instance_of(Paperclip::Attachment).to receive(:post_process_styles)
|
17
17
|
allow(Paperclip).to receive(:run).and_return('100x100')
|
18
18
|
end
|
19
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pageflow-support
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 17.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Codevise Solutions Ltd
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pageflow
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 17.0.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 17.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: mysql2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,28 +114,28 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '4.10'
|
118
118
|
type: :runtime
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '4.10'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: ar_after_transaction
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 0.
|
131
|
+
version: 0.10.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 0.
|
138
|
+
version: 0.10.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: redis
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -185,6 +185,7 @@ executables: []
|
|
185
185
|
extensions: []
|
186
186
|
extra_rdoc_files: []
|
187
187
|
files:
|
188
|
+
- pageflow/caching_test_helpers.rb
|
188
189
|
- pageflow/dom.rb
|
189
190
|
- pageflow/dom/admin.rb
|
190
191
|
- pageflow/dom/admin/attributes_tables.rb
|
@@ -251,7 +252,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
252
|
- !ruby/object:Gem::Version
|
252
253
|
version: '0'
|
253
254
|
requirements: []
|
254
|
-
rubygems_version: 3.
|
255
|
+
rubygems_version: 3.4.10
|
255
256
|
signing_key:
|
256
257
|
specification_version: 4
|
257
258
|
summary: Spec support for Pageflow extensions.
|