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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a1c5db978665f7473218668fdf7086a3c2598b1228c35c76d8eaa92fde6a24f9
4
- data.tar.gz: a8e34afa1a49597e75c9a64aec58df7aad0a602d2303dda722c63833e35cf946
3
+ metadata.gz: 3bf429e535dc9c5c753e3468a8595bf049e633bc75fdda5e3d9bca30ff971e02
4
+ data.tar.gz: bd25d75d2a97383392614936177d307ddb0577a3f7afba8a1d02234bdf81631a
5
5
  SHA512:
6
- metadata.gz: 506d1c263c3fac5e51e4486a898fadf0f59595c1c19649df72829e98cd7614baf42b8ac58ba7346cbe878d886e3b867ec82ca8d40387b87c0bb80264ee8bebd1
7
- data.tar.gz: 04e83685824a6ddc81f6aa3162b0268eee5700793b13dc14f28ff5130071b4f013ee78e2154a64a74ada0f094c119db0cbd33ccfaba9d5ecc343e482a1fbdd36
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 Metrics/LineLength
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
- 'Usage: rake wcc:import_model[content-type-id,space-id?,extra-content-type-1,extra-content-type-2...]'
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['CONTENTFUL_SPACE_ID']
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 Metrics/LineLength
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 = '/' + params[: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
@@ -69,7 +69,7 @@ module WCC::Contentful::App::MenuHelper
69
69
 
70
70
  def hash_only(href)
71
71
  url = URI(href)
72
- '#' + url.fragment if url.fragment.present?
72
+ "##{url.fragment}" if url.fragment.present?
73
73
  end
74
74
 
75
75
  # An href is local if it points to a part of the page
@@ -18,7 +18,7 @@ module WCC::Contentful::App::SectionHelper
18
18
  end
19
19
 
20
20
  def section_styles(section)
21
- section_styles = ['section-' + section_css_name(section)]
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(/\&amp;(nbsp|vert|\#\d+);/, '&\1;')
53
- .gsub(/\&lt;br\/?\&gt;/, '<br/>')
52
+ text = text.gsub(/&amp;(nbsp|vert|\#\d+);/, '&\1;')
53
+ .gsub(/&lt;br\/?&gt;/, '<br/>')
54
54
  content_tag(:span, text.html_safe, {
55
55
  class: 'safe-line-break'
56
56
  }.merge(options))
@@ -1,4 +1,4 @@
1
- <% return '' unless item
1
+ <% return '' unless item # rubocop:disable Lint/TopLevelReturnWithArgument
2
2
 
3
3
  classes ||= ['nav-item']
4
4
  classes.push('active') if item_active?(item)
@@ -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
- 'typescript contentful-export'
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['CONTENTFUL_PREVIEW_PASSWORD']
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.to_s + '.' + msg.path, msg.error) }
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(/\.[^\.\}\s]*/)
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
@@ -3,7 +3,7 @@
3
3
  module WCC
4
4
  module Contentful
5
5
  module App
6
- VERSION = '1.1.2'
6
+ VERSION = '1.3.0'
7
7
  end
8
8
  end
9
9
  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
@@ -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 Metrics/LineLength
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.3'
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.3.6'
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 Metrics/LineLength
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.1.2
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-02-16 00:00:00.000000000 Z
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.3.6
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.3.6
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.1.2
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.1.2
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.1/wcc-contentful-app
462
- post_install_message:
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.3'
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
- rubyforge_project:
478
- rubygems_version: 2.7.6.2
479
- signing_key:
464
+ rubygems_version: 3.1.6
465
+ signing_key:
480
466
  specification_version: 4
481
467
  summary: "[![Gem Version](https://badge.fury.io/rb/wcc-contentful-app.svg)](https://rubygems.org/gems/wcc-contentful-app)
482
468
  [![Build Status](https://circleci.com/gh/watermarkchurch/wcc-contentful.svg?style=svg)](https://circleci.com/gh/watermarkchurch/wcc-contentful)