Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to the latest dev-support template #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -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
closeComment: false
2 changes: 2 additions & 0 deletions .github_changelog_generator
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
issues=false
exclude-labels=infrastructure
21 changes: 1 addition & 20 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ require:
- solidus_dev_support/rubocop

AllCops:
NewCops: disable
Exclude:
- sandbox/**/*
- spec/dummy/**/*
Expand Down Expand Up @@ -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}
24 changes: 16 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

<!-- Explain what your extension does. -->

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.
Expand All @@ -19,12 +20,13 @@ gem 'solidus_content'
Bundle your dependencies and run the installation generator:

```shell
bundle
bin/rails generate solidus_content:install
```

## Usage

<!-- Explain how to use your extension once it's been installed. -->

Create an entry type for the home page:

```rb
Expand Down Expand Up @@ -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
```

Expand All @@ -427,22 +428,29 @@ 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
* Listening on tcp://127.0.0.1:3000
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
2 changes: 1 addition & 1 deletion bin/sandbox
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions lib/generators/solidus_content/install/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
2 changes: 1 addition & 1 deletion lib/solidus_content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
14 changes: 9 additions & 5 deletions lib/solidus_content/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 4 additions & 0 deletions lib/solidus_content/testing_support/factories.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# frozen_string_literal: true

FactoryBot.define do
end
3 changes: 1 addition & 2 deletions solidus_content.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down