From 1d042964f8d2e4b3d63fc930b73dec872971e6bb Mon Sep 17 00:00:00 2001 From: Elia Schito Date: Mon, 23 Nov 2020 13:18:39 +0100 Subject: [PATCH] Update to the latest dev-support template --- .github/stale.yml | 8 +++---- .github_changelog_generator | 2 ++ .rubocop.yml | 21 +--------------- README.md | 24 ++++++++++++------- bin/sandbox | 2 +- .../install/install_generator.rb | 9 +++---- lib/solidus_content.rb | 2 +- lib/solidus_content/configuration.rb | 14 +++++++---- .../testing_support/factories.rb | 4 ++++ solidus_content.gemspec | 3 +-- spec/spec_helper.rb | 4 ++-- 11 files changed, 46 insertions(+), 47 deletions(-) create mode 100644 .github_changelog_generator create mode 100644 lib/solidus_content/testing_support/factories.rb diff --git a/.github/stale.yml b/.github/stale.yml index d9f6563..03407b3 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -1,17 +1,17 @@ # Number of days of inactivity before an issue becomes stale daysUntilStale: 60 # Number of days of inactivity before a stale issue is closed -daysUntilClose: 7 +daysUntilClose: false # Issues with these labels will never be considered stale exemptLabels: - pinned - security # Label to use when marking an issue as stale -staleLabel: wontfix +staleLabel: stale # Comment to post when marking an issue as stale. Set to `false` to disable markComment: > This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you + recent activity. It might be closed if no further activity occurs. Thank you for your contributions. # Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false \ No newline at end of file +closeComment: false diff --git a/.github_changelog_generator b/.github_changelog_generator new file mode 100644 index 0000000..eac0962 --- /dev/null +++ b/.github_changelog_generator @@ -0,0 +1,2 @@ +issues=false +exclude-labels=infrastructure diff --git a/.rubocop.yml b/.rubocop.yml index 498ebdc..6d8ea0b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,6 +2,7 @@ require: - solidus_dev_support/rubocop AllCops: + NewCops: disable Exclude: - sandbox/**/* - spec/dummy/**/* @@ -39,23 +40,3 @@ RSpec/NestedGroups: RSpec/VerifiedDoubles: IgnoreSymbolicNames: true - - -# Enabled on 2020-09-08 - -Rails/ActiveRecordCallbacksOrder: {Enabled: true} -Rails/AfterCommitOverride: {Enabled: true} -Rails/FindById: {Enabled: true} -Rails/Inquiry: {Enabled: true} -Rails/MailerName: {Enabled: true} -Rails/MatchRoute: {Enabled: true} -Rails/NegateInclude: {Enabled: true} -Rails/Pluck: {Enabled: true} -Rails/PluckInWhere: {Enabled: true} -Rails/RenderInline: {Enabled: true} -Rails/RenderPlainText: {Enabled: true} -Rails/ShortI18n: {Enabled: true} -Rails/SquishedSQLHeredocs: {Enabled: true} -Rails/WhereExists: {Enabled: true} -Rails/WhereNot: {Enabled: true} -Performance/Sum: {Enabled: true} diff --git a/README.md b/README.md index de77743..c7859a2 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ - -# SolidusContent +# Solidus Content [![CircleCI](https://circleci.com/gh/solidusio-contrib/solidus_content.svg?style=shield)](https://circleci.com/gh/solidusio-contrib/solidus_content) [![codecov](https://codecov.io/gh/solidusio-contrib/solidus_content/branch/master/graph/badge.svg)](https://codecov.io/gh/solidusio-contrib/solidus_content) + + An extremely modular and extensible CMS for Solidus. It can consume content from different sources such as Contentful, DatoCMS, Prismic.io or custom JSON, YAML and raw formats. It makes it super easy to render and customize any content. @@ -19,12 +20,13 @@ gem 'solidus_content' Bundle your dependencies and run the installation generator: ```shell -bundle bin/rails generate solidus_content:install ``` ## Usage + + Create an entry type for the home page: ```rb @@ -402,7 +404,6 @@ app if it does not exist, then it will run specs. The dummy app can be regenerat `bin/rake extension:test_app`. ```shell -bundle bin/rake ``` @@ -427,7 +428,7 @@ the sandbox app is `./sandbox` and `bin/rails` will forward any Rails commands t Here's an example: -```shell +``` $ bin/rails server => Booting Puma => Rails 6.0.2.1 application starting in development @@ -435,14 +436,21 @@ $ bin/rails server Use Ctrl-C to stop ``` -### Releasing new versions +### Updating the changelog -Your new extension version can be released using `gem-release` like this: +Before and after releases the changelog should be updated to reflect the up-to-date status of +the project: ```shell -bundle exec gem bump -v VERSION --tag --push --remote origin && gem release +bin/rake changelog +git add CHANGELOG.md +git commit -m "Update the changelog" ``` +### Releasing new versions + +Please refer to the dedicated [page](https://github.com/solidusio/solidus/wiki/How-to-release-extensions) on Solidus wiki. + ## License Copyright (c) 2020 Nebulab, released under the New BSD License diff --git a/bin/sandbox b/bin/sandbox index 253d5e3..a1bfb6a 100755 --- a/bin/sandbox +++ b/bin/sandbox @@ -72,7 +72,7 @@ unbundled bundle exec rails generate spree:install \ --user_class=Spree::User \ --enforce_available_locales=true \ --with-authentication=false \ - --payment-method=none + --payment-method=none \ $@ unbundled bundle exec rails generate solidus:auth:install diff --git a/lib/generators/solidus_content/install/install_generator.rb b/lib/generators/solidus_content/install/install_generator.rb index ca442b5..ec79782 100644 --- a/lib/generators/solidus_content/install/install_generator.rb +++ b/lib/generators/solidus_content/install/install_generator.rb @@ -4,6 +4,11 @@ module SolidusContent module Generators class InstallGenerator < Rails::Generators::Base class_option :auto_run_migrations, type: :boolean, default: false + source_root File.expand_path('templates', __dir__) + + def copy_initializer + template 'initializer.rb', 'config/initializers/solidus_content.rb' + end def add_javascripts append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/solidus_content\n" @@ -27,10 +32,6 @@ def run_migrations puts 'Skipping bin/rails db:migrate, don\'t forget to run it!' # rubocop:disable Rails/Output end end - - def copy_initializer - copy_file 'initializer.rb', 'config/initializers/solidus_content.rb' - end end end end diff --git a/lib/solidus_content.rb b/lib/solidus_content.rb index dcd448e..340e337 100644 --- a/lib/solidus_content.rb +++ b/lib/solidus_content.rb @@ -3,8 +3,8 @@ require 'solidus_core' require 'solidus_support' +require 'solidus_content/configuration' require 'solidus_content/version' require 'solidus_content/engine' -require 'solidus_content/configuration' require 'solidus_content/providers' require 'solidus_content/active_record' diff --git a/lib/solidus_content/configuration.rb b/lib/solidus_content/configuration.rb index 91cfafa..ac1b9d8 100644 --- a/lib/solidus_content/configuration.rb +++ b/lib/solidus_content/configuration.rb @@ -28,11 +28,15 @@ def register_provider(name, provider) end end - def self.config - @config ||= Configuration.new - end + class << self + def configuration + @configuration ||= Configuration.new + end - def self.configure - yield config + alias config configuration + + def configure + yield configuration + end end end diff --git a/lib/solidus_content/testing_support/factories.rb b/lib/solidus_content/testing_support/factories.rb new file mode 100644 index 0000000..745a01e --- /dev/null +++ b/lib/solidus_content/testing_support/factories.rb @@ -0,0 +1,4 @@ +# frozen_string_literal: true + +FactoryBot.define do +end diff --git a/solidus_content.gemspec b/solidus_content.gemspec index 9f8ba35..d7d1ee9 100644 --- a/solidus_content.gemspec +++ b/solidus_content.gemspec @@ -32,6 +32,5 @@ Gem::Specification.new do |spec| spec.add_dependency 'solidus_core', ['>= 2.0.0', '< 3'] spec.add_dependency 'solidus_support', '~> 0.5' - spec.add_development_dependency 'solidus_dev_support' - spec.add_development_dependency 'webdrivers' + spec.add_development_dependency 'solidus_dev_support', '~> 2.1' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3c9c4f3..4042c73 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -18,8 +18,8 @@ # in spec/support/ and its subdirectories. Dir["#{__dir__}/support/**/*.rb"].sort.each { |f| require f } -# Requires factories defined in lib/solidus_content/factories.rb -require 'solidus_content/factories' +# Requires factories defined in lib/solidus_content/testing_support/factories.rb +require 'solidus_content/testing_support/factories' RSpec.configure do |config| config.infer_spec_type_from_file_location!