diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f8baaee..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -sudo: false -language: ruby -dist: trusty -cache: - bundler: true -before_install: - - "gem install bundler --pre" - - "bundler -v" -rvm: - - 2.4.2 -env: - matrix: - - SOLIDUS_BRANCH=v2.4 - - SOLIDUS_BRANCH=v2.5 - - SOLIDUS_BRANCH=v2.6 - - SOLIDUS_BRANCH=v2.7 - - SOLIDUS_BRANCH=v2.8 - - SOLIDUS_BRANCH=master diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f4c815b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,89 @@ +# Changelog + +## [v0.4.0](https://github.com/solidusio/solidus_support/tree/v0.4.0) (2019-12-16) + +[Full Changelog](https://github.com/solidusio/solidus_support/compare/v0.3.2...v0.4.0) + +**Closed issues:** + +- Configure CircleCI [\#30](https://github.com/solidusio/solidus_support/issues/30) +- Models::SolidusGlobalize::Spree::TaxonomyDecorator \(NameError\) [\#26](https://github.com/solidusio/solidus_support/issues/26) + +**Merged pull requests:** + +- Fix issues with test runs [\#32](https://github.com/solidusio/solidus_support/pull/32) ([aldesantis](https://github.com/aldesantis)) +- Add CircleCI configuration [\#31](https://github.com/solidusio/solidus_support/pull/31) ([aldesantis](https://github.com/aldesantis)) +- Introduce solidus\_extension\_dev\_tools [\#29](https://github.com/solidusio/solidus_support/pull/29) ([aldesantis](https://github.com/aldesantis)) +- Remove support for testing and extensions [\#28](https://github.com/solidusio/solidus_support/pull/28) ([MinasMazar](https://github.com/MinasMazar)) +- Add SolidusSupport::EngineExtension::Decorators to load decorators [\#27](https://github.com/solidusio/solidus_support/pull/27) ([kennyadsl](https://github.com/kennyadsl)) +- Add support for Codecov [\#24](https://github.com/solidusio/solidus_support/pull/24) ([aldesantis](https://github.com/aldesantis)) + +## [v0.3.2](https://github.com/solidusio/solidus_support/tree/v0.3.2) (2019-08-08) + +[Full Changelog](https://github.com/solidusio/solidus_support/compare/v0.2.1...v0.3.2) + +**Merged pull requests:** + +- Add `capybara-screenshot` dependency [\#23](https://github.com/solidusio/solidus_support/pull/23) ([spaghetticode](https://github.com/spaghetticode)) +- Do not reset spree preferences starting from v2.9 [\#22](https://github.com/solidusio/solidus_support/pull/22) ([kennyadsl](https://github.com/kennyadsl)) +- Update Travis config [\#19](https://github.com/solidusio/solidus_support/pull/19) ([aitbw](https://github.com/aitbw)) +- Override Capybara JS driver via `CAPYBARA\_DRIVER` ENV variable [\#18](https://github.com/solidusio/solidus_support/pull/18) ([spaghetticode](https://github.com/spaghetticode)) +- Migrate from Poltergeist to Headless Chrome [\#16](https://github.com/solidusio/solidus_support/pull/16) ([aitbw](https://github.com/aitbw)) +- Remove running rubocop on rake task [\#14](https://github.com/solidusio/solidus_support/pull/14) ([kennyadsl](https://github.com/kennyadsl)) +- Cleanup extension [\#13](https://github.com/solidusio/solidus_support/pull/13) ([kennyadsl](https://github.com/kennyadsl)) +- Fix how we compare gem versions to determine new gateway code usage [\#12](https://github.com/solidusio/solidus_support/pull/12) ([kennyadsl](https://github.com/kennyadsl)) +- Add payment method parent class [\#8](https://github.com/solidusio/solidus_support/pull/8) ([tvdeyen](https://github.com/tvdeyen)) +- Improve gem documentation [\#7](https://github.com/solidusio/solidus_support/pull/7) ([kennyadsl](https://github.com/kennyadsl)) + +## [v0.2.1](https://github.com/solidusio/solidus_support/tree/v0.2.1) (2018-02-22) + +[Full Changelog](https://github.com/solidusio/solidus_support/compare/v0.2.0...v0.2.1) + +**Merged pull requests:** + +- Ensure database cleaning is very last in each spec [\#9](https://github.com/solidusio/solidus_support/pull/9) ([jhawthorn](https://github.com/jhawthorn)) + +## [v0.2.0](https://github.com/solidusio/solidus_support/tree/v0.2.0) (2017-10-25) + +[Full Changelog](https://github.com/solidusio/solidus_support/compare/v0.1.5...v0.2.0) + +**Merged pull requests:** + +- Rename FactoryBot [\#6](https://github.com/solidusio/solidus_support/pull/6) ([tvdeyen](https://github.com/tvdeyen)) +- Remove unused files [\#5](https://github.com/solidusio/solidus_support/pull/5) ([tvdeyen](https://github.com/tvdeyen)) + +## [v0.1.5](https://github.com/solidusio/solidus_support/tree/v0.1.5) (2017-07-27) + +[Full Changelog](https://github.com/solidusio/solidus_support/compare/v0.1.4...v0.1.5) + +## [v0.1.4](https://github.com/solidusio/solidus_support/tree/v0.1.4) (2017-07-26) + +[Full Changelog](https://github.com/solidusio/solidus_support/compare/v0.1.3...v0.1.4) + +## [v0.1.3](https://github.com/solidusio/solidus_support/tree/v0.1.3) (2017-07-26) + +[Full Changelog](https://github.com/solidusio/solidus_support/compare/v0.1.2...v0.1.3) + +**Merged pull requests:** + +- Add a basic spec\_helper for extensions to include [\#2](https://github.com/solidusio/solidus_support/pull/2) ([jhawthorn](https://github.com/jhawthorn)) + +## [v0.1.2](https://github.com/solidusio/solidus_support/tree/v0.1.2) (2017-07-24) + +[Full Changelog](https://github.com/solidusio/solidus_support/compare/v0.1.1...v0.1.2) + +**Merged pull requests:** + +- Add SolidusSupport.payment\_source\_parent\_class [\#1](https://github.com/solidusio/solidus_support/pull/1) ([jordan-brough](https://github.com/jordan-brough)) + +## [v0.1.1](https://github.com/solidusio/solidus_support/tree/v0.1.1) (2017-05-03) + +[Full Changelog](https://github.com/solidusio/solidus_support/compare/v0.1.0...v0.1.1) + +## [v0.1.0](https://github.com/solidusio/solidus_support/tree/v0.1.0) (2017-03-21) + +[Full Changelog](https://github.com/solidusio/solidus_support/compare/b34d603b2b603e8799ce801913b577322bd39bdc...v0.1.0) + + + +\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8f33900 --- /dev/null +++ b/LICENSE @@ -0,0 +1,26 @@ +Copyright (c) 2017 Solidus +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + * Neither the name Solidus nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md index f5d00d5..3dc674c 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,18 @@ # SolidusSupport -This gem holds some common functionality for Solidus Extensions. +This gem contains common runtime functionality for Solidus extensions. -It has some utilities to make it easier to support multiple versions of Solidus. +If you are looking for development tools instead, see +[solidus_extension_dev_tools](https://github.com/solidusio-contrib/solidus_extension_dev_tools). ## Usage ### `SolidusSupport::Migration` -Rails >= 5 introduced the concept of specifying what rails version your migration was written for, like `ActiveRecord::Migration[5.0]`. -Not specifying a version is deprecated in Rails 5.0 and removed in rails 5.1. -This wasn't backported to Rails 4.2, but Rails 4.2 _is_ Rails 4.2. So we provide this helper. +Rails >= 5 introduced the concept of specifying what Rails version your migration was written for, +like `ActiveRecord::Migration[5.0]`. Not specifying a version is deprecated in Rails 5.0 and removed +in Rails 5.1. This wasn't backported to Rails 4.2, so we provide this helper to return the right +parent class: ``` ruby # On Rails 4.2 @@ -22,15 +24,14 @@ SolidusSupport::Migration[4.2] # same as `ActiveRecord::Migration[4.2]` SolidusSupport::Migration[5.0] # same as `ActiveRecord::Migration[5.0]` ``` -There's no reason to use `SolidusSupport::Migration[5.0]` over `ActiveRecord::Migration[5.0]`, but it is provided. +There's no reason to use `SolidusSupport::Migration[5.0]` over `ActiveRecord::Migration[5.0]`, but +it is provided. -### Engine Extensions +### Engine extensions -This extension provides a module that extends `Rails::Engine` functionalities -to support loading correctly the decorators class created into an extension -both for development and production enviroments. - -To use it just include the provided module in the Engine as follow: +This extension provides a module that decorates `Rails::Engine` to seamlessly support autoloading +decorators both with the classic autoloader and with Zeitwerk on Rails 6. In order to use it, just +include the provided module in your `Engine` class: ```ruby module SolidusExtensionName @@ -38,13 +39,13 @@ module SolidusExtensionName engine_name 'solidus_extension_name' include SolidusSupport::EngineExtensions::Decorators + # ... end end ``` -To make it work, be sure to remove the previous implementation from the -Engine, that should be something like: +If needed, also ensure to remove the original implementation of `.activate`: ```ruby def self.activate @@ -58,9 +59,10 @@ config.to_prepare(&method(:activate).to_proc) ## Development -After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment. - -To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). +To install this gem onto your local machine, run `bundle exec rake install`. To release a new +version, update the version number in `version.rb`, and then run `bundle exec rake release`, which +will create a git tag for the version, push git commits and tags, and push the `.gem` file to +[rubygems.org](https://rubygems.org). ## Contributing diff --git a/solidus_support.gemspec b/solidus_support.gemspec index 98c0330..da92c70 100644 --- a/solidus_support.gemspec +++ b/solidus_support.gemspec @@ -5,16 +5,15 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) require 'solidus_support/version' Gem::Specification.new do |spec| - spec.name = 'solidus_support' - spec.version = SolidusSupport::VERSION - spec.authors = ['John Hawthorn'] - spec.email = ['john@stembolt.com'] + spec.name = 'solidus_support' + spec.version = SolidusSupport::VERSION + spec.authors = ['John Hawthorn'] + spec.email = ['john@stembolt.com'] - spec.summary = 'A common functionality for solidus extensions' - spec.description = 'Collection of common functionality for solidus extensions' - spec.homepage = 'https://solidus.io' + spec.summary = 'Common runtime helpers for Solidus extensions.' + spec.homepage = 'https://solidus.io' - spec.files = `git ls-files -z`.split("\x0") + spec.files = `git ls-files -z`.split("\x0") spec.require_paths = ['lib'] spec.add_development_dependency 'bundler'