pageflow-support 15.8.0 → 16.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21076315b25b8c73d4956f7771567f9457ec197aebe56a3722f497837d5d2b99
4
- data.tar.gz: cf0b9da8151febb9f4691fc96d738d5b11ba91651c2cc3b00c68395ffe3be7ce
3
+ metadata.gz: 266d6bc59226e8db71ae53f87bb7b2ff3de6f0081a4df7bdc19d773f74e4d8f2
4
+ data.tar.gz: eea3dba281c4c90558f0391898521947204d0f970310838b5b35df84f24d98e4
5
5
  SHA512:
6
- metadata.gz: e1b0b144ceeb7cb9a65b143bfa15b48eb972c06f1f7203486b4148eb3cf4e1bc09c40a9ce45868bff203d71d1e84821785edc65f44e94f31b26ea0e049a70e3d
7
- data.tar.gz: f983c779564d1241e083c54b34148bf206e99861519998999b483cd3c8e99672ae892565a13deb1649ab6106c7f90db48c973a592b79383078af9d6ff4a42bbd
6
+ metadata.gz: 942234acb0b8534fad62149958f3c7d701080231b8b7a906b37c69850d79319f7225590df196e0d36849ba48e7b07bc3eff130fd7e68292cf58b96204262cca4
7
+ data.tar.gz: 7c606816826bad55662f9c77849d84d674fad1caa08c9ad95c793946991dc7aba4d916f65d824f59458dd5b8b7aad77e5a9649781a4be05d49d3d61dacdcfb49
@@ -48,14 +48,14 @@ module Pageflow
48
48
  private_class_method :url
49
49
  end
50
50
 
51
- # The theming attributes table on the account page
51
+ # The site attributes table on the account page
52
52
  #
53
53
  # @since 12.2
54
- class ThemingAttributesTable < AttributesTable
55
- selector '.attributes_table.pageflow_theming'
54
+ class SiteAttributesTable < AttributesTable
55
+ selector '.attributes_table.pageflow_site'
56
56
 
57
- def self.url(theming)
58
- url_helpers.admin_account_path(theming.account)
57
+ def self.url(site)
58
+ url_helpers.admin_account_site_path(site.account, site)
59
59
  end
60
60
  private_class_method :url
61
61
  end
@@ -64,21 +64,21 @@ module Pageflow
64
64
  end
65
65
  end
66
66
 
67
- # Edit form for theming in account admin.
67
+ # Edit form for site in account admin.
68
68
  #
69
69
  # @since 12.2
70
- class ThemingEditForm < EditForm
71
- selector '.edit.admin_accounts'
70
+ class SiteEditForm < EditForm
71
+ selector '.edit.admin_sites'
72
72
 
73
- def self.url(theming)
74
- url_helpers.edit_admin_account_path(theming.account)
73
+ def self.url(site)
74
+ url_helpers.edit_admin_account_site_path(site.account, site)
75
75
  end
76
76
  private_class_method :url
77
77
 
78
78
  private
79
79
 
80
80
  def field_prefix
81
- 'account[default_theming_attributes]'
81
+ 'site'
82
82
  end
83
83
  end
84
84
  end
@@ -1,5 +1,6 @@
1
1
  require 'pageflow/version'
2
2
  require 'pageflow/dummy/exit_on_failure_patch'
3
+ require 'pageflow/rails_version'
3
4
 
4
5
  module Pageflow
5
6
  module Dummy
@@ -10,7 +11,7 @@ module Pageflow
10
11
  if File.exist?(directory)
11
12
  puts("Dummy directory #{directory} exists.")
12
13
  else
13
- system("bundle exec rails new #{directory} " \
14
+ system("bundle exec rails new #{directory} --skip-spring " \
14
15
  "--template #{template_path} #{rails_new_options}") ||
15
16
  raise('Error generating dummy app.')
16
17
  end
@@ -29,7 +30,9 @@ module Pageflow
29
30
  end
30
31
 
31
32
  def rails_new_options
32
- '--skip-test-unit --skip-bundle --database=mysql'
33
+ result = '--skip-test-unit --skip-bundle --database=mysql'
34
+ result << ' --skip-javascript' if Pageflow::RailsVersion.experimental?
35
+ result
33
36
  end
34
37
  end
35
38
  end
@@ -1,3 +1,5 @@
1
+ require 'pageflow/rails_version'
2
+
1
3
  def source_paths
2
4
  [File.join(File.expand_path(File.dirname(__FILE__)), 'templates')]
3
5
  end
@@ -30,8 +32,10 @@ inject_into_file('config/application.rb',
30
32
  "require 'pageflow'\n",
31
33
  after: "Bundler.require(*Rails.groups)\n")
32
34
 
33
- # Remove requires to missing gems (i.e. turbolinks)
34
- gsub_file('app/assets/javascripts/application.js', %r'//=.*', '')
35
+ if in_root { File.exist?('app/assets/javascripts/application.js') }
36
+ # Remove requires to missing gems (i.e. turbolinks)
37
+ gsub_file('app/assets/javascripts/application.js', %r'//=.*', '')
38
+ end
35
39
 
36
40
  # Recreate db. Ignore if it does not exist.
37
41
 
@@ -40,7 +44,11 @@ rake 'db:create:all'
40
44
 
41
45
  # Install Webpacker
42
46
 
43
- rake 'webpacker:install' if ENV['PAGEFLOW_INSTALL_WEBPACKER'] == 'true'
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
44
52
 
45
53
  # Install pageflow and the tested engine via their generators.
46
54
 
@@ -2,6 +2,6 @@ class AddCustomFields < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :pageflow_entries, :custom_field, :string
4
4
  add_column :pageflow_accounts, :custom_field, :string
5
- add_column :pageflow_themings, :custom_field, :string
5
+ add_column :pageflow_sites, :custom_field, :string
6
6
  end
7
7
  end
@@ -24,7 +24,7 @@ module Pageflow
24
24
  # # ...
25
25
  # end
26
26
  def pageflow_configure(&block)
27
- GlobalConfigApiTestHelper.custom_configure_block = block
27
+ GlobalConfigApiTestHelper.custom_configure_block << block
28
28
  Pageflow.configure!
29
29
  end
30
30
 
@@ -39,12 +39,14 @@ module Pageflow
39
39
 
40
40
  config.before(:suite) do
41
41
  Pageflow.configure do |pageflow_config|
42
- GlobalConfigApiTestHelper.custom_configure_block&.call(pageflow_config)
42
+ GlobalConfigApiTestHelper.custom_configure_block.each do |block|
43
+ block.call(pageflow_config)
44
+ end
43
45
  end
44
46
  end
45
47
 
46
48
  config.before do
47
- GlobalConfigApiTestHelper.custom_configure_block = nil
49
+ GlobalConfigApiTestHelper.custom_configure_block = []
48
50
  Pageflow.configure!
49
51
  end
50
52
  end
data/pageflow/lint.rb CHANGED
@@ -25,8 +25,8 @@ module Pageflow
25
25
  # require 'pageflow/lint'
26
26
  #
27
27
  # Pageflow::Lint.entry_type(SomePlugin.entry_type)
28
- def self.entry_type(*args)
29
- Lint::EntryType.lint(*args)
28
+ def self.entry_type(*args, **kws)
29
+ Lint::EntryType.lint(*args, **kws)
30
30
  end
31
31
 
32
32
  # Ensure file type json partials render correctly.
@@ -52,8 +52,8 @@ module Pageflow
52
52
  # create_file_type: -> { SomePlugin.file_type },
53
53
  # create_file: -> { create(:some_file) })
54
54
  # end
55
- def self.file_type(*args)
56
- Lint::FileType.lint(*args)
55
+ def self.file_type(*args, **kws)
56
+ Lint::FileType.lint(*args, **kws)
57
57
  end
58
58
 
59
59
  # Contract specs for page types
@@ -70,8 +70,8 @@ module Pageflow
70
70
  # module SomePlugin
71
71
  # Pageflow::Lint.page_type(SomePLugin.page_type)
72
72
  # end
73
- def self.page_type(*args)
74
- Lint::PageType.lint(*args)
73
+ def self.page_type(*args, **kws)
74
+ Lint::PageType.lint(*args, **kws)
75
75
  end
76
76
 
77
77
  # Contracts specs for file import plugin
@@ -83,8 +83,8 @@ module Pageflow
83
83
  # module SomePlugin
84
84
  # Pageflow::Lint.file_import(SomePLugin.file_import)
85
85
  # end
86
- def self.file_import(*args)
87
- Lint::FileImport.lint(*args)
86
+ def self.file_import(*args, **kws)
87
+ Lint::FileImport.lint(*args, **kws)
88
88
  end
89
89
  end
90
90
  end
@@ -11,19 +11,14 @@ Capybara.register_driver :selenium_chrome_headless_no_sandbox do |app|
11
11
  # (see https://docs.travis-ci.com/user/chrome)
12
12
  browser_options.args << '--no-sandbox'
13
13
 
14
- capabilities = {
14
+ capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
15
15
  # see https://github.com/SeleniumHQ/selenium/issues/3738
16
- loggingPrefs: {browser: 'ALL'},
17
- # see https://github.com/dbalatero/capybara-chromedriver-logger/issues/11
18
- chromeOptions: {
19
- w3c: false
20
- }
21
- }
16
+ 'goog:loggingPrefs': {browser: 'ALL'}
17
+ )
22
18
 
23
19
  Capybara::Selenium::Driver.new(app,
24
20
  browser: :chrome,
25
- options: browser_options,
26
- desired_capabilities: capabilities)
21
+ capabilities: [browser_options, capabilities])
27
22
  end
28
23
 
29
24
  Capybara.javascript_driver = :selenium_chrome_headless_no_sandbox
@@ -2,7 +2,12 @@ require 'webmock/rspec'
2
2
 
3
3
  RSpec.configure do |config|
4
4
  config.before(:each) do
5
- driver_urls = Webdrivers::Common.subclasses.map(&:base_url)
6
- WebMock.disable_net_connect!(allow_localhost: true, allow: driver_urls)
5
+ WebMock.disable_net_connect!(
6
+ allow_localhost: true,
7
+ allow: [
8
+ 'https://googlechromelabs.github.io',
9
+ 'https://edgedl.me.gvt1.com'
10
+ ]
11
+ )
7
12
  end
8
13
  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: 15.8.0
4
+ version: 16.1.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: 2022-12-23 00:00:00.000000000 Z
11
+ date: 2023-10-25 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: 15.8.0
19
+ version: 16.1.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: 15.8.0
26
+ version: 16.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mysql2
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -222,7 +222,6 @@ files:
222
222
  - pageflow/lint/page_type.rb
223
223
  - pageflow/matchers/have_json_ld.rb
224
224
  - pageflow/matchers/have_meta_tag.rb
225
- - pageflow/rails_version.rb
226
225
  - pageflow/render_page_test_helper.rb
227
226
  - pageflow/shared_contexts/fake_translations.rb
228
227
  - pageflow/support.rb
@@ -252,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
252
251
  - !ruby/object:Gem::Version
253
252
  version: '0'
254
253
  requirements: []
255
- rubygems_version: 3.0.8
254
+ rubygems_version: 3.2.3
256
255
  signing_key:
257
256
  specification_version: 4
258
257
  summary: Spec support for Pageflow extensions.
@@ -1,23 +0,0 @@
1
- module Pageflow
2
- module RailsVersion
3
- extend self
4
-
5
- RAILS_VERSION_FILE = File.expand_path('../../../../.rails_version')
6
-
7
- def detect
8
- from_env || from_file || '5.2.0'
9
- end
10
-
11
- private
12
-
13
- def from_env
14
- ENV['PAGEFLOW_RAILS_VERSION']
15
- end
16
-
17
- def from_file
18
- if File.exists?(RAILS_VERSION_FILE)
19
- File.read(RAILS_VERSION_FILE).chomp.strip.presence
20
- end
21
- end
22
- end
23
- end