From 28d72bd52928647c172e963618e61cdfdd9fef9b Mon Sep 17 00:00:00 2001 From: Alessandro Desantis Date: Thu, 16 Jan 2020 11:40:33 +0100 Subject: [PATCH 1/3] Use HTTPS to load gems from GitHub --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index 41947fb..e09c638 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,8 @@ source 'https://rubygems.org' +git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } + branch = ENV.fetch('SOLIDUS_BRANCH', 'master') gem 'solidus_core', github: 'solidusio/solidus', branch: branch From 6c658aa583130cbc2f8b4943dabad48fff8c4765 Mon Sep 17 00:00:00 2001 From: Alessandro Desantis Date: Thu, 16 Jan 2020 11:40:41 +0100 Subject: [PATCH 2/3] Use the stable version of solidus_dev_support --- Gemfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Gemfile b/Gemfile index e09c638..4292ff2 100644 --- a/Gemfile +++ b/Gemfile @@ -10,7 +10,6 @@ gem 'solidus_core', github: 'solidusio/solidus', branch: branch # Specify your gem's dependencies in solidus_support.gemspec gemspec -gem 'solidus_dev_support', github: 'solidusio-contrib/solidus_dev_support' gem 'sprockets', '~> 3' gem 'sprockets-rails' From 00070f1df3792418930140db103136cc80bfdf42 Mon Sep 17 00:00:00 2001 From: Alessandro Desantis Date: Thu, 16 Jan 2020 11:46:19 +0100 Subject: [PATCH 3/3] Update to the latest solidus_dev_support configuration --- .gem_release.yml | 5 +++++ .github/stale.yml | 17 +++++++++++++++++ .gitignore | 29 +++++++++++++++++------------ .rspec | 1 + .rubocop.yml | 2 +- Gemfile | 15 +++++---------- bin/console | 17 +++++++++++++++++ bin/setup | 7 +++++++ solidus_support.gemspec | 41 +++++++++++++++++++++++------------------ spec/spec_helper.rb | 13 +++++++++++++ 10 files changed, 106 insertions(+), 41 deletions(-) create mode 100644 .gem_release.yml create mode 100644 .github/stale.yml create mode 100755 bin/console create mode 100755 bin/setup diff --git a/.gem_release.yml b/.gem_release.yml new file mode 100644 index 0000000..124e687 --- /dev/null +++ b/.gem_release.yml @@ -0,0 +1,5 @@ +bump: + recurse: false + file: 'lib/solidus_support/version.rb' + message: Bump SolidusSupport to %{version} + branch: true diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..d9f6563 --- /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: 7 +# Issues with these labels will never be considered stale +exemptLabels: + - pinned + - security +# Label to use when marking an issue as stale +staleLabel: wontfix +# 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 + for your contributions. +# Comment to post when closing a stale issue. Set to `false` to disable +closeComment: false \ No newline at end of file diff --git a/.gitignore b/.gitignore index 27f565f..a8b7852 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,17 @@ -/.bundle/ -/.yardoc -/Gemfile.lock -/_yardoc/ -/coverage/ -/doc/ -/pkg/ -/spec/reports/ -/tmp/ -/log/ -/spec/ - +*.gem +\#* +*~ +.#* +.DS_Store +.idea +.project +.sass-cache +coverage +Gemfile.lock +tmp +nbproject +pkg +*.swp +spec/dummy +spec/examples.txt +log diff --git a/.rspec b/.rspec index c99d2e7..3687797 100644 --- a/.rspec +++ b/.rspec @@ -1 +1,2 @@ --require spec_helper +--color diff --git a/.rubocop.yml b/.rubocop.yml index 6f4bb00..6207a64 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,2 +1,2 @@ require: - - solidus_extension_dev_tools/rubocop + - solidus_dev_support/rubocop diff --git a/Gemfile b/Gemfile index 4292ff2..452267f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,23 +1,18 @@ # frozen_string_literal: true source 'https://rubygems.org' - -git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } +git_source(:github) { |repo| "https://github.com/#{repo}.git" } branch = ENV.fetch('SOLIDUS_BRANCH', 'master') gem 'solidus_core', github: 'solidusio/solidus', branch: branch -# Specify your gem's dependencies in solidus_support.gemspec -gemspec - -gem 'sprockets', '~> 3' -gem 'sprockets-rails' - case ENV['DB'] -when 'postgresql' - gem 'pg' when 'mysql' gem 'mysql2' +when 'postgresql' + gem 'pg' else gem 'sqlite3' end + +gemspec diff --git a/bin/console b/bin/console new file mode 100755 index 0000000..4fd503b --- /dev/null +++ b/bin/console @@ -0,0 +1,17 @@ +#!/usr/bin/env ruby + +# frozen_string_literal: true + +require "bundler/setup" +require "solidus_support" + +# You can add fixtures and/or initialization code here to make experimenting +# with your gem easier. You can also use a different console, if you like. +$LOAD_PATH.unshift(*Dir["#{__dir__}/../app/*"]) + +# (If you use this, don't forget to add pry to your Gemfile!) +# require "pry" +# Pry.start + +require "irb" +IRB.start(__FILE__) diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..7ef2658 --- /dev/null +++ b/bin/setup @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + +gem install bundler --conservative +bundle update diff --git a/solidus_support.gemspec b/solidus_support.gemspec index 6ba80ca..174141a 100644 --- a/solidus_support.gemspec +++ b/solidus_support.gemspec @@ -1,26 +1,31 @@ # frozen_string_literal: true -lib = File.expand_path('lib', __dir__) -$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) +$:.push File.expand_path('lib', __dir__) 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'] +Gem::Specification.new do |s| + s.name = 'solidus_support' + s.version = SolidusSupport::VERSION + s.summary = 'Common runtime helpers for Solidus extensions.' + s.license = 'BSD-3-Clause' - spec.summary = 'Common runtime helpers for Solidus extensions.' - spec.homepage = 'https://solidus.io' + s.author = 'John Hawthorn' + s.email = 'john@stembolt.com' + s.homepage = 'https://github.com/solidusio/solidus_support' - spec.files = `git ls-files -z`.split("\x0") - spec.require_paths = ['lib'] + s.files = Dir.chdir(File.expand_path(__dir__)) do + `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) } + end + s.test_files = Dir['spec/**/*'] + s.bindir = "exe" + s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) } + s.require_paths = ["lib"] - spec.add_development_dependency 'bundler' - spec.add_development_dependency 'rake' - spec.add_development_dependency 'rspec-rails' - spec.add_development_dependency 'rubocop' - spec.add_development_dependency 'rubocop-rspec' - spec.add_development_dependency 'solidus_core' - spec.add_development_dependency 'solidus_dev_support' + s.add_development_dependency 'bundler' + s.add_development_dependency 'rake' + s.add_development_dependency 'rspec-rails' + s.add_development_dependency 'rubocop' + s.add_development_dependency 'rubocop-rspec' + s.add_development_dependency 'solidus_core' + s.add_development_dependency 'solidus_dev_support' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index afa590a..b2f6c0f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,17 @@ # frozen_string_literal: true +# Configure Rails Environment +ENV['RAILS_ENV'] = 'test' + +# Run Coverage report +require 'solidus_dev_support/rspec/coverage' + +# Load dummy app require_relative 'support/dummy_app' + +# Requires factories and other useful helpers defined in spree_core. require 'solidus_dev_support/rspec/spec_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 }