wcc-contentful-app 1.1.2 → 1.3.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/Rakefile +4 -4
- data/app/controllers/wcc/contentful/app/pages_controller.rb +1 -1
- data/app/helpers/wcc/contentful/app/menu_helper.rb +1 -1
- data/app/helpers/wcc/contentful/app/section_helper.rb +3 -3
- data/app/views/components/_menu-item.html.erb +1 -1
- data/lib/generators/wcc/model_generator.rb +2 -4
- data/lib/wcc/contentful/app/configuration.rb +3 -7
- data/lib/wcc/contentful/app/exceptions.rb +1 -1
- data/lib/wcc/contentful/app/markdown_renderer.rb +4 -4
- data/lib/wcc/contentful/app/version.rb +1 -1
- data/lib/wcc/contentful/model/site_config.rb +1 -1
- data/wcc-contentful-app.gemspec +6 -6
- metadata +13 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bf429e535dc9c5c753e3468a8595bf049e633bc75fdda5e3d9bca30ff971e02
|
4
|
+
data.tar.gz: bd25d75d2a97383392614936177d307ddb0577a3f7afba8a1d02234bdf81631a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a713913402d4b69b17ed490e4c25ac1e6c3110b9698e87ed6ab1e23f67aaebbc12acb209dfaaec44e5a2b16937cb08751ef7321020f2c3e1955bbf1d5ba34500
|
7
|
+
data.tar.gz: 3ce3e2b1f5d6a064faef9c86154b983febae13aaddd392c5a0575d3044ea8b9812ec2a2ed15943f0ca711165eae7429c7c744f7f281c3c891ce874b015cf8e47
|
data/Rakefile
CHANGED
@@ -5,12 +5,12 @@ require 'fileutils'
|
|
5
5
|
|
6
6
|
require 'wcc/contentful'
|
7
7
|
|
8
|
-
# rubocop:disable
|
8
|
+
# rubocop:disable Layout/LineLength
|
9
9
|
# Disabling line length for contentful-schema-diff backtick execution
|
10
10
|
|
11
11
|
namespace :app do
|
12
12
|
desc "Imports a set of models from a space as a single template for the ModelGenerator.\n" \
|
13
|
-
|
13
|
+
'Usage: rake wcc:import_model[content-type-id,space-id?,extra-content-type-1,extra-content-type-2...]'
|
14
14
|
task :import_model, [:model, :space] do |_t, args|
|
15
15
|
raise ArgumentError, 'Must give a content type' unless model = args[:model]
|
16
16
|
|
@@ -20,7 +20,7 @@ namespace :app do
|
|
20
20
|
all_models = [model, *args.extras]
|
21
21
|
|
22
22
|
unless space = args[:space].presence
|
23
|
-
space = ENV
|
23
|
+
space = ENV.fetch('CONTENTFUL_SPACE_ID', nil)
|
24
24
|
space = "#{space}/#{ENV['CONTENTFUL_ENVIRONMENT']}" if ENV['CONTENTFUL_ENVIRONMENT']
|
25
25
|
end
|
26
26
|
raise ArgumentError, 'Must provide a space' unless space
|
@@ -118,7 +118,7 @@ namespace :app do
|
|
118
118
|
end
|
119
119
|
end
|
120
120
|
|
121
|
-
# rubocop:enable
|
121
|
+
# rubocop:enable Layout/LineLength
|
122
122
|
|
123
123
|
task :release do
|
124
124
|
raise StandardError, 'Please run rake release only from the root folder.'
|
@@ -12,7 +12,7 @@ class WCC::Contentful::App::PagesController < ApplicationController
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def show
|
15
|
-
slug =
|
15
|
+
slug = "/#{params[:slug]}"
|
16
16
|
@page = page_model.find_by(slug: slug, options: { include: 3, preview: preview? })
|
17
17
|
|
18
18
|
return render 'pages/show' if @page
|
@@ -18,7 +18,7 @@ module WCC::Contentful::App::SectionHelper
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def section_styles(section)
|
21
|
-
section_styles = [
|
21
|
+
section_styles = ["section-#{section_css_name(section)}"]
|
22
22
|
if styles = section.try(:styles)
|
23
23
|
section_styles.push(styles.map { |style| style.downcase.gsub(/[^\w]/, '-') })
|
24
24
|
elsif style = section.try(:style)
|
@@ -49,8 +49,8 @@ module WCC::Contentful::App::SectionHelper
|
|
49
49
|
return unless text.present?
|
50
50
|
|
51
51
|
text = CGI.escapeHTML(text)
|
52
|
-
text = text.gsub(
|
53
|
-
.gsub(
|
52
|
+
text = text.gsub(/&(nbsp|vert|\#\d+);/, '&\1;')
|
53
|
+
.gsub(/<br\/?>/, '<br/>')
|
54
54
|
content_tag(:span, text.html_safe, {
|
55
55
|
class: 'safe-line-break'
|
56
56
|
}.merge(options))
|
@@ -28,15 +28,13 @@ module Wcc
|
|
28
28
|
|
29
29
|
unless deps.try(:[], '@watermarkchurch/contentful-migration').present?
|
30
30
|
run 'npm install --save @watermarkchurch/contentful-migration ts-node ' \
|
31
|
-
|
31
|
+
'typescript contentful-export'
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
def ensure_wrapper_script_in_bin_dir
|
37
|
-
unless inside('bin') { File.exist?('contentful') }
|
38
|
-
copy_file 'contentful_shell_wrapper', 'bin/contentful'
|
39
|
-
end
|
37
|
+
copy_file 'contentful_shell_wrapper', 'bin/contentful' unless inside('bin') { File.exist?('contentful') }
|
40
38
|
|
41
39
|
if inside('bin') { File.exist?('release') }
|
42
40
|
release = inside('bin') { File.read('release') }
|
@@ -19,7 +19,7 @@ class WCC::Contentful::App::Configuration
|
|
19
19
|
|
20
20
|
def initialize(wcc_contentful_config)
|
21
21
|
@wcc_contentful_config = wcc_contentful_config
|
22
|
-
@preview_password = ENV
|
22
|
+
@preview_password = ENV.fetch('CONTENTFUL_PREVIEW_PASSWORD', nil)
|
23
23
|
end
|
24
24
|
|
25
25
|
# Validates the configuration, raising ArgumentError if anything is wrong. This
|
@@ -33,16 +33,12 @@ class WCC::Contentful::App::Configuration
|
|
33
33
|
end
|
34
34
|
|
35
35
|
class FrozenConfiguration
|
36
|
-
attr_reader(*ATTRIBUTES)
|
37
|
-
|
38
|
-
attr_reader :wcc_contentful_config
|
36
|
+
attr_reader(*ATTRIBUTES, :wcc_contentful_config)
|
39
37
|
|
40
38
|
delegate(*WCC::Contentful::Configuration::ATTRIBUTES, to: :wcc_contentful_config)
|
41
39
|
|
42
40
|
def initialize(configuration, frozen_wcc_contentful_config)
|
43
|
-
unless frozen_wcc_contentful_config.frozen?
|
44
|
-
raise ArgumentError, 'Please first freeze the wcc_contentful_config'
|
45
|
-
end
|
41
|
+
raise ArgumentError, 'Please first freeze the wcc_contentful_config' unless frozen_wcc_contentful_config.frozen?
|
46
42
|
|
47
43
|
@wcc_contentful_config = frozen_wcc_contentful_config
|
48
44
|
|
@@ -25,7 +25,7 @@ module WCC::Contentful::App
|
|
25
25
|
hash.map do |k, v|
|
26
26
|
if v.is_a?(Hash)
|
27
27
|
msgs = join_msg_keys(v)
|
28
|
-
msgs.map { |msg| Message.new(k
|
28
|
+
msgs.map { |msg| Message.new("#{k}.#{msg.path}", msg.error) }
|
29
29
|
else
|
30
30
|
v.map { |msg| Message.new(k.to_s, msg) }
|
31
31
|
end
|
@@ -50,7 +50,7 @@ class WCC::Contentful::App::MarkdownRenderer
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def links_within_markdown(text)
|
53
|
-
text.scan(/(\[(.*?)\]\((.*?)\)(\{
|
53
|
+
text.scan(/(\[(.*?)\]\((.*?)\)(\{:.*?\})?)/)
|
54
54
|
end
|
55
55
|
|
56
56
|
def gather_links_with_classes_data(markdown_links)
|
@@ -75,7 +75,7 @@ class WCC::Contentful::App::MarkdownRenderer
|
|
75
75
|
def url_and_title(markdown_link_and_title)
|
76
76
|
match =
|
77
77
|
markdown_link_and_title.scan(
|
78
|
-
/(\s|^)(https?:\/\/\S*|^\/\S*\/*\S*|^#\S*|mailto:\S*)(?=\s|$)|(
|
78
|
+
/(\s|^)(https?:\/\/\S*|^\/\S*\/*\S*|^#\S*|mailto:\S*)(?=\s|$)|(".*?")/
|
79
79
|
)
|
80
80
|
url = match[0][1]
|
81
81
|
title = match[1] ? match[1][2] : nil
|
@@ -83,13 +83,13 @@ class WCC::Contentful::App::MarkdownRenderer
|
|
83
83
|
end
|
84
84
|
|
85
85
|
def capture_individual_classes(classes)
|
86
|
-
classes.scan(/\.[
|
86
|
+
classes.scan(/\.[^.}\s]*/)
|
87
87
|
end
|
88
88
|
|
89
89
|
def combine_individual_classes_to_one_string(classes)
|
90
90
|
class_string = ''
|
91
91
|
classes.each do |klass|
|
92
|
-
class_string += klass.tr('.', '')
|
92
|
+
class_string += "#{klass.tr('.', '')} "
|
93
93
|
end
|
94
94
|
class_string
|
95
95
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class WCC::Contentful::Model::SiteConfig < WCC::Contentful::Model
|
4
|
-
def self.instance(preview = false)
|
4
|
+
def self.instance(preview = false) # rubocop:disable Style/OptionalBooleanParameter
|
5
5
|
find_by(foreign_key: 'default', options: { include: 4, preview: preview })
|
6
6
|
end
|
7
7
|
end
|
data/wcc-contentful-app.gemspec
CHANGED
@@ -6,7 +6,7 @@ require 'wcc/contentful/app/version'
|
|
6
6
|
|
7
7
|
doc_version = Gem::Version.new(WCC::Contentful::App::VERSION).release.to_s.sub(/\.\d+$/, '')
|
8
8
|
|
9
|
-
# rubocop:disable
|
9
|
+
# rubocop:disable Layout/LineLength
|
10
10
|
Gem::Specification.new do |spec|
|
11
11
|
spec.name = 'wcc-contentful-app'
|
12
12
|
spec.version = WCC::Contentful::App::VERSION
|
@@ -19,10 +19,11 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.license = 'MIT'
|
20
20
|
|
21
21
|
spec.metadata = {
|
22
|
-
'documentation_uri' => "https://watermarkchurch.github.io/wcc-contentful/#{doc_version}/wcc-contentful-app"
|
22
|
+
'documentation_uri' => "https://watermarkchurch.github.io/wcc-contentful/#{doc_version}/wcc-contentful-app",
|
23
|
+
'rubygems_mfa_required' => 'true'
|
23
24
|
}
|
24
25
|
|
25
|
-
spec.required_ruby_version = '>= 2.
|
26
|
+
spec.required_ruby_version = '>= 2.7'
|
26
27
|
|
27
28
|
spec.files = Dir['app/**/*', 'config/**/*', 'lib/**/*'] +
|
28
29
|
%w[Rakefile README.md wcc-contentful-app.gemspec]
|
@@ -38,7 +39,6 @@ Gem::Specification.new do |spec|
|
|
38
39
|
spec.add_development_dependency 'rake', '~> 13.0'
|
39
40
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
40
41
|
spec.add_development_dependency 'rspec_junit_formatter', '~> 0.4.1'
|
41
|
-
spec.add_development_dependency 'rubocop', '0.68'
|
42
42
|
spec.add_development_dependency 'simplecov', '~> 0.16.1'
|
43
43
|
spec.add_development_dependency 'vcr', '~> 5.0'
|
44
44
|
spec.add_development_dependency 'webmock', '~> 3.0'
|
@@ -55,11 +55,11 @@ Gem::Specification.new do |spec|
|
|
55
55
|
# wcc-contentful-app needs rails to function, so require it for specs.
|
56
56
|
spec.add_development_dependency 'rails', '~> 5'
|
57
57
|
spec.add_development_dependency 'rspec-rails', '~> 3.7'
|
58
|
-
spec.add_development_dependency 'sqlite3', '~> 1.
|
58
|
+
spec.add_development_dependency 'sqlite3', '~> 1.4'
|
59
59
|
spec.add_development_dependency 'timecop', '~> 0.9.1'
|
60
60
|
spec.add_development_dependency 'typhoeus', '~> 1.4.0'
|
61
61
|
|
62
62
|
spec.add_dependency 'redcarpet', '~> 3.4'
|
63
63
|
spec.add_dependency 'wcc-contentful', "~> #{WCC::Contentful::App::VERSION}"
|
64
64
|
end
|
65
|
-
# rubocop:enable
|
65
|
+
# rubocop:enable Layout/LineLength
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wcc-contentful-app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Watermark Dev
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -136,20 +136,6 @@ dependencies:
|
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: 0.4.1
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: rubocop
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - '='
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0.68'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - '='
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0.68'
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
140
|
name: simplecov
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -296,14 +282,14 @@ dependencies:
|
|
296
282
|
requirements:
|
297
283
|
- - "~>"
|
298
284
|
- !ruby/object:Gem::Version
|
299
|
-
version: 1.
|
285
|
+
version: '1.4'
|
300
286
|
type: :development
|
301
287
|
prerelease: false
|
302
288
|
version_requirements: !ruby/object:Gem::Requirement
|
303
289
|
requirements:
|
304
290
|
- - "~>"
|
305
291
|
- !ruby/object:Gem::Version
|
306
|
-
version: 1.
|
292
|
+
version: '1.4'
|
307
293
|
- !ruby/object:Gem::Dependency
|
308
294
|
name: timecop
|
309
295
|
requirement: !ruby/object:Gem::Requirement
|
@@ -352,14 +338,14 @@ dependencies:
|
|
352
338
|
requirements:
|
353
339
|
- - "~>"
|
354
340
|
- !ruby/object:Gem::Version
|
355
|
-
version: 1.
|
341
|
+
version: 1.3.0
|
356
342
|
type: :runtime
|
357
343
|
prerelease: false
|
358
344
|
version_requirements: !ruby/object:Gem::Requirement
|
359
345
|
requirements:
|
360
346
|
- - "~>"
|
361
347
|
- !ruby/object:Gem::Version
|
362
|
-
version: 1.
|
348
|
+
version: 1.3.0
|
363
349
|
description: Models, Controllers, and Views common to Watermark Church apps
|
364
350
|
email:
|
365
351
|
- dev@watermark.org
|
@@ -458,8 +444,9 @@ homepage: https://github.com/watermarkchurch/wcc-contentful
|
|
458
444
|
licenses:
|
459
445
|
- MIT
|
460
446
|
metadata:
|
461
|
-
documentation_uri: https://watermarkchurch.github.io/wcc-contentful/1.
|
462
|
-
|
447
|
+
documentation_uri: https://watermarkchurch.github.io/wcc-contentful/1.3/wcc-contentful-app
|
448
|
+
rubygems_mfa_required: 'true'
|
449
|
+
post_install_message:
|
463
450
|
rdoc_options: []
|
464
451
|
require_paths:
|
465
452
|
- lib
|
@@ -467,16 +454,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
467
454
|
requirements:
|
468
455
|
- - ">="
|
469
456
|
- !ruby/object:Gem::Version
|
470
|
-
version: '2.
|
457
|
+
version: '2.7'
|
471
458
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
472
459
|
requirements:
|
473
460
|
- - ">="
|
474
461
|
- !ruby/object:Gem::Version
|
475
462
|
version: '0'
|
476
463
|
requirements: []
|
477
|
-
|
478
|
-
|
479
|
-
signing_key:
|
464
|
+
rubygems_version: 3.1.6
|
465
|
+
signing_key:
|
480
466
|
specification_version: 4
|
481
467
|
summary: "[](https://rubygems.org/gems/wcc-contentful-app)
|
482
468
|
[](https://circleci.com/gh/watermarkchurch/wcc-contentful)
|