wcc-contentful-app 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- 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 +5 -5
- metadata +10 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dbd1a306484dcc6450c27a1a73d47d0f50dab83c5ff9a3c4715e136c13d224b
|
4
|
+
data.tar.gz: f2482a20b6362f2507be3fc5ac0e151bf7f60360fb550529d20e4a4574624a29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1ecf2db8bb7615381249cf1a8da22fd1927d72371cdf94181f85471e2ff17dba5c9d548e491892843e2938755432972bf8a8189447dcb92351a36b3e5c4d567
|
7
|
+
data.tar.gz: 1a16797c8a01efa08a2fe056064c179e8e6bcae30ba0077889046a723e330c38860e7715ba95f073ebece5d9699d5d6f279e7f9024fd4b65198c9d50768a346e
|
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'
|
@@ -62,4 +62,4 @@ Gem::Specification.new do |spec|
|
|
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.2.
|
4
|
+
version: 1.2.1
|
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-09 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
|
@@ -352,14 +338,14 @@ dependencies:
|
|
352
338
|
requirements:
|
353
339
|
- - "~>"
|
354
340
|
- !ruby/object:Gem::Version
|
355
|
-
version: 1.2.
|
341
|
+
version: 1.2.1
|
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.2.
|
348
|
+
version: 1.2.1
|
363
349
|
description: Models, Controllers, and Views common to Watermark Church apps
|
364
350
|
email:
|
365
351
|
- dev@watermark.org
|
@@ -459,7 +445,8 @@ licenses:
|
|
459
445
|
- MIT
|
460
446
|
metadata:
|
461
447
|
documentation_uri: https://watermarkchurch.github.io/wcc-contentful/1.2/wcc-contentful-app
|
462
|
-
|
448
|
+
rubygems_mfa_required: 'true'
|
449
|
+
post_install_message:
|
463
450
|
rdoc_options: []
|
464
451
|
require_paths:
|
465
452
|
- lib
|
@@ -467,15 +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
|
-
rubygems_version: 3.
|
478
|
-
signing_key:
|
464
|
+
rubygems_version: 3.1.6
|
465
|
+
signing_key:
|
479
466
|
specification_version: 4
|
480
467
|
summary: "[![Gem Version](https://badge.fury.io/rb/wcc-contentful-app.svg)](https://rubygems.org/gems/wcc-contentful-app)
|
481
468
|
[![Build Status](https://circleci.com/gh/watermarkchurch/wcc-contentful.svg?style=svg)](https://circleci.com/gh/watermarkchurch/wcc-contentful)
|