summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Desantis <desa.alessandro@gmail.com>2020-09-24 14:21:43 +0200
committerAlessandro Desantis <desa.alessandro@gmail.com>2020-09-25 11:52:33 +0200
commitc2ff76ed6f1b9aa377f566d7d98e743446919c0a (patch)
treebee9a4cd0cd97128882a157b55591f736bd6357f
parentbf0f1c6a6c54a90861d736368408642c6852d48e (diff)
Update extension with latest solidus_dev_support defaults
-rw-r--r--.circleci/config.yml6
-rw-r--r--.github/stale.yml17
-rw-r--r--README.md29
-rwxr-xr-xbin/rails-sandbox2
-rwxr-xr-xbin/sandbox2
-rw-r--r--solidus_subscriptions.gemspec2
-rw-r--r--spec/spec_helper.rb18
7 files changed, 60 insertions, 16 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 12bb10e..e7e2f71 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -16,12 +16,18 @@ jobs:
executor: solidusio_extensions/mysql
steps:
- solidusio_extensions/run-tests
+ lint-code:
+ executor: solidusio_extensions/sqlite-memory
+ steps:
+ - solidusio_extensions/lint-code
workflows:
"Run specs on supported Solidus versions":
jobs:
- run-specs-with-postgres
- run-specs-with-mysql
+ - lint-code
+
"Weekly run specs against master":
triggers:
- schedule:
diff --git a/.github/stale.yml b/.github/stale.yml
new file mode 100644
index 0000000..03407b3
--- /dev/null
+++ b/.github/stale.yml
@@ -0,0 +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: false
+# Issues with these labels will never be considered stale
+exemptLabels:
+ - pinned
+ - security
+# Label to use when marking an issue as stale
+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 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
diff --git a/README.md b/README.md
index cb4912b..81b4a29 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,7 @@
-# SolidusSubscriptions
+# solidus_subscriptions
-[![CircleCI](https://circleci.com/gh/solidusio-contrib/solidus_subscriptions/tree/master.svg?style=svg)](https://circleci.com/gh/solidusio-contrib/solidus_subscriptions/tree/master)
+[![CircleCI](https://circleci.com/gh/solidusio-contrib/solidus_subscriptions.svg?style=shield)](https://circleci.com/gh/solidusio-contrib/solidus_subscriptions)
+[![codecov](https://codecov.io/gh/solidusio-contrib/solidus_subscriptions/branch/master/graph/badge.svg)](https://codecov.io/gh/solidusio-contrib/solidus_subscriptions)
A Solidus extension to add subscriptions to your store.
@@ -15,8 +16,8 @@ gem 'solidus_subscriptions', github: 'solidusio-contrib/solidus_subscriptions'
Bundle your dependencies and run the installation generator:
```shell
-bundle
-bundle exec rails g solidus_subscriptions:install
+$ bundle
+$ bin/rails generate solidus_subscriptions:install
```
### Guest checkout
@@ -103,7 +104,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
```
@@ -128,7 +128,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
@@ -136,12 +136,27 @@ $ bin/rails server
Use Ctrl-C to stop
```
+### Updating the changelog
+
+Before and after releases the changelog should be updated to reflect the up-to-date status of
+the project:
+
+```shell
+bin/rake changelog
+git add CHANGELOG.md
+git commit -m "Update the changelog"
+```
+
### Releasing new versions
Your new extension version can be released using `gem-release` like this:
```shell
-bundle exec gem bump -v VERSION --tag --push --remote upstream && gem release
+bundle exec gem bump -v 1.6.0
+bin/rake changelog
+git commit -a --amend
+git push
+bundle exec gem release
```
## License
diff --git a/bin/rails-sandbox b/bin/rails-sandbox
index c89b2ae..ad2df04 100755
--- a/bin/rails-sandbox
+++ b/bin/rails-sandbox
@@ -5,7 +5,7 @@ app_root = 'sandbox'
unless File.exist? "#{app_root}/bin/rails"
warn 'Creating the sandbox app...'
Dir.chdir "#{__dir__}/.." do
- system "#{__dir__}/sandbox" or begin # rubocop:disable Style/AndOr
+ system "#{__dir__}/sandbox" or begin
warn 'Automatic creation of the sandbox app failed'
exit 1
end
diff --git a/bin/sandbox b/bin/sandbox
index 6b848ab..83aea83 100755
--- a/bin/sandbox
+++ b/bin/sandbox
@@ -72,9 +72,11 @@ unbundled bundle exec rails generate spree:install \
--user_class=Spree::User \
--enforce_available_locales=true \
--with-authentication=false \
+ --payment-method=none \
$@
unbundled bundle exec rails generate solidus:auth:install
+unbundled bundle exec rails generate ${extension_name}:install
echo
echo "🚀 Sandbox app successfully created for $extension_name!"
diff --git a/solidus_subscriptions.gemspec b/solidus_subscriptions.gemspec
index 4d0a4f8..a084471 100644
--- a/solidus_subscriptions.gemspec
+++ b/solidus_subscriptions.gemspec
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rspec-activemodel-mocks'
spec.add_development_dependency 'shoulda-matchers', '~> 4.4'
- spec.add_development_dependency 'solidus_dev_support'
+ spec.add_development_dependency 'solidus_dev_support', '~> 2.0'
spec.add_development_dependency 'timecop'
spec.add_development_dependency 'versioncake'
spec.add_development_dependency 'yard'
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index c0569f2..4087c5b 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -6,22 +6,26 @@ ENV['RAILS_ENV'] = 'test'
# Run Coverage report
require 'solidus_dev_support/rspec/coverage'
-require File.expand_path('dummy/config/environment.rb', __dir__).tap { |file|
- # Create the dummy app if it's still missing.
- system 'bin/rake extension:test_app' unless File.exist? file
-}
+# Create the dummy app if it's still missing.
+dummy_env = "#{__dir__}/dummy/config/environment.rb"
+system 'bin/rake extension:test_app' unless File.exist? dummy_env
+require dummy_env
# Requires factories and other useful helpers defined in spree_core.
require 'solidus_dev_support/rspec/feature_helper'
# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
-Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
+Dir["#{__dir__}/support/**/*.rb"].sort.each { |f| require f }
-# Requires factories defined in lib/solidus_subscriptions/testing_support/factories.rb
-require 'solidus_subscriptions/testing_support/factories'
+# Requires factories defined in lib/solidus_subscriptions/factories.rb
+require 'solidus_subscriptions/factories'
RSpec.configure do |config|
config.infer_spec_type_from_file_location!
config.use_transactional_fixtures = false
+
+ if Spree.solidus_gem_version < Gem::Version.new('2.11')
+ config.extend Spree::TestingSupport::AuthorizationHelpers::Request, type: :system
+ end
end