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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8dda5260d2f59be109256d17bc14c77c290f0df9957ff585cf3d7f17afdbb509
4
- data.tar.gz: d669d9b7847909fe11af3e01c9668364df9a800c58f26f2659bf37049e28fc88
3
+ metadata.gz: 2dbd1a306484dcc6450c27a1a73d47d0f50dab83c5ff9a3c4715e136c13d224b
4
+ data.tar.gz: f2482a20b6362f2507be3fc5ac0e151bf7f60360fb550529d20e4a4574624a29
5
5
  SHA512:
6
- metadata.gz: aa3ba254fde4c0a576c9984a0734a994d9ae3b43be583e25c5830d7f0a1b8266d0adb272d7af2d41ff9fc98d8e35ba2629a9d7cd66774ccc3681a8d91f104f6a
7
- data.tar.gz: 512fc3a2780c8bacfd4a67d8850818030387a4deed5f2125e588390ad797b4cd1c8b2d0f40adcf28a2ba8a7bda73c0492fe97dea5e9dfc057e144816b9688395
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 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.2.0'
6
+ VERSION = '1.2.1'
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'
@@ -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 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.2.0
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-06-30 00:00:00.000000000 Z
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.0
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.0
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
- post_install_message:
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.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
- rubygems_version: 3.3.7
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)