pageflow-support 16.1.0 → 16.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 266d6bc59226e8db71ae53f87bb7b2ff3de6f0081a4df7bdc19d773f74e4d8f2
4
- data.tar.gz: eea3dba281c4c90558f0391898521947204d0f970310838b5b35df84f24d98e4
3
+ metadata.gz: f5025199d00a123265a8a38fc2ab1bb3450e577d61e0813fac8e5d971caf294f
4
+ data.tar.gz: 05dfba6fdfa469667ff2e98a6108c6f9b23dbade34680b74f1b80710f51be978
5
5
  SHA512:
6
- metadata.gz: 942234acb0b8534fad62149958f3c7d701080231b8b7a906b37c69850d79319f7225590df196e0d36849ba48e7b07bc3eff130fd7e68292cf58b96204262cca4
7
- data.tar.gz: 7c606816826bad55662f9c77849d84d674fad1caa08c9ad95c793946991dc7aba4d916f65d824f59458dd5b8b7aad77e5a9649781a4be05d49d3d61dacdcfb49
6
+ metadata.gz: 93baec3ea0932a52a834a9fd6a3c5957e03702274488c775c32ec501a733903b84bc3ff760c7ae319e30e6cf3c2bc4fce700ab947229af606964bf0ca1b40e46
7
+ data.tar.gz: a882466b94aa06c45741770e2ca9030dd75e807535fe94b74dbf80d12637108059bb3e54771c882d3697506e345e350a6601402db0ac8a4594b8beb5901c7a39
@@ -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
@@ -11,13 +11,13 @@ module Pageflow
11
11
  if File.exist?(directory)
12
12
  puts("Dummy directory #{directory} exists.")
13
13
  else
14
- system("bundle exec rails new #{directory} --skip-spring " \
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' if Pageflow::RailsVersion.experimental?
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.paperclip_s3_root = 'test-host'
2
+ s3_bucket = config.paperclip_s3_default_options.dig(:s3_credentials, :bucket)
3
3
 
4
- config.paperclip_s3_default_options.merge!(
5
- storage: :filesystem,
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
- config.paperclip_direct_upload_options = lambda do |_|
11
- {
12
- url: '#',
13
- fields: []
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,15 +44,13 @@ 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 Pageflow::RailsVersion.experimental?
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
 
@@ -67,6 +69,12 @@ prepend_to_file('config/initializers/pageflow.rb', <<-END)
67
69
  ActiveAdmin.application.load_paths.unshift(Dir[Rails.root.join('app/admin')].first)\n
68
70
  END
69
71
 
72
+ # Adapt default configuration
73
+
74
+ inject_into_file('config/initializers/pageflow.rb',
75
+ "require 'pageflow/dummy/config/pageflow'\n",
76
+ after: "Pageflow.finalize!\n")
77
+
70
78
  # Add required files for test theme
71
79
 
72
80
  copy_file('test_theme.scss',
@@ -95,4 +103,4 @@ copy_file('create_test_revision_components.rb',
95
103
  copy_file('add_custom_fields.rb',
96
104
  'db/migrate/99990000000000_add_custom_fields.rb')
97
105
 
98
- rake 'db:migrate db:test:load', env: 'development'
106
+ 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
- browser_options = ::Selenium::WebDriver::Chrome::Options.new
8
- browser_options.args << '--headless'
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
- capabilities: [browser_options, capabilities])
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(:post_process)
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: 16.1.0
4
+ version: 16.2.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: 2023-10-25 00:00:00.000000000 Z
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: 16.1.0
19
+ version: 16.2.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: 16.1.0
26
+ version: 16.2.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: '2.5'
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: '2.5'
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.5.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.5.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.2.3
255
+ rubygems_version: 3.4.10
255
256
  signing_key:
256
257
  specification_version: 4
257
258
  summary: Spec support for Pageflow extensions.