Skip to content

Commit

Permalink
Upgrade infrastructure with solidus_dev_support
Browse files Browse the repository at this point in the history
  • Loading branch information
aldesantis committed Jan 24, 2020
1 parent f3669a1 commit a6cc39b
Show file tree
Hide file tree
Showing 20 changed files with 154 additions and 378 deletions.
5 changes: 5 additions & 0 deletions .gem_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bump:
recurse: false
file: 'lib/solidus_affirm/version.rb'
message: Bump SolidusAffirm to %{version}
tag: true
17 changes: 17 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ nbproject
pkg
*.swp
spec/dummy
spec/examples.txt
4 changes: 1 addition & 3 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
--color
--format
progress
--backtrace
--require spec_helper
236 changes: 2 additions & 234 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,234 +1,2 @@
# Relaxed.Ruby.Style

AllCops:
Exclude:
- 'solidus_affirm.gemspec'
- 'spec/dummy/**/*'
- 'vendor/bundle/**/*'
TargetRubyVersion: 2.2

# Sometimes I believe this reads better
# This also causes spacing issues on multi-line fixes
Style/BracesAroundHashParameters:
Enabled: false

# We use class vars and will have to continue doing so for compatability
Style/ClassVars:
Enabled: false

# We need these names for backwards compatability
Naming/PredicateName:
Enabled: false

Naming/AccessorMethodName:
Enabled: false

# This has been used for customization
Style/MutableConstant:
Enabled: false

Style/ClassAndModuleChildren:
Enabled: false

Style/GuardClause:
Enabled: false

Style/WordArray:
Enabled: false

Style/ConditionalAssignment:
Enabled: false

Performance/Count:
Enabled: false

Style/RaiseArgs:
Enabled: false

# We can use good judgement here
Style/RegexpLiteral:
Enabled: false

# Unicode comments are useful
Style/AsciiComments:
Enabled: false

Layout/EndAlignment:
Enabled: false

Layout/ElseAlignment:
Enabled: false

Layout/IndentationWidth:
Enabled: false

Layout/AlignParameters:
Enabled: false

Layout/ClosingParenthesisIndentation:
Enabled: false

Layout/MultilineMethodCallIndentation:
Enabled: false

Layout/IndentArray:
Enabled: false

Layout/IndentHash:
Enabled: false

Layout/AlignHash:
Enabled: false

# From http://relaxed.ruby.style/

Style/Alias:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylealias

Style/BeginBlock:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylebeginblock

Style/BlockDelimiters:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleblockdelimiters

Style/Documentation:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styledocumentation

Layout/DotPosition:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styledotposition

Style/DoubleNegation:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styledoublenegation

Style/EndBlock:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleendblock

Style/FormatString:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleformatstring

Style/IfUnlessModifier:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleifunlessmodifier

Style/Lambda:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylelambda

Style/ModuleFunction:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylemodulefunction

Style/MultilineBlockChain:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylemultilineblockchain

Style/NegatedIf:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylenegatedif

Style/NegatedWhile:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylenegatedwhile

Style/ParallelAssignment:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleparallelassignment

Style/PercentLiteralDelimiters:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylepercentliteraldelimiters

Style/PerlBackrefs:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#styleperlbackrefs

Style/Semicolon:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylesemicolon

Style/SignalException:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylesignalexception

Style/SingleLineBlockParams:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylesinglelineblockparams

Style/SingleLineMethods:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylesinglelinemethods

Layout/SpaceBeforeBlockBraces:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylespacebeforeblockbraces

Layout/SpaceInsideParens:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylespaceinsideparens

Style/SpecialGlobalVars:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylespecialglobalvars

Style/StringLiterals:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylestringliterals

Style/SymbolProc:
Enabled: false

Style/WhileUntilModifier:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylewhileuntilmodifier

Lint/AmbiguousRegexpLiteral:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#lintambiguousregexpliteral

Lint/AssignmentInCondition:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#lintassignmentincondition

Lint/HandleExceptions:
Exclude:
- 'Rakefile'

Metrics/AbcSize:
Enabled: false

Metrics/BlockNesting:
Enabled: false

Metrics/ClassLength:
Enabled: false

Metrics/ModuleLength:
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: false

Metrics/LineLength:
Enabled: false

Metrics/MethodLength:
Enabled: false

Metrics/ParameterLists:
Enabled: false

Metrics/BlockLength:
Exclude:
- 'spec/**/*.rb'
- '*.gemspec'

Naming/BinaryOperatorParameterName:
Enabled: false
require:
- solidus_dev_support/rubocop
48 changes: 21 additions & 27 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

branch = ENV.fetch('SOLIDUS_BRANCH', 'master')

gem 'solidus', github: 'solidusio/solidus', branch: branch

if ENV['DB'] == 'mysql'
gem 'mysql2'
else
gem 'pg', '~> 0.21'
end
# Needed to help Bundler figure out how to resolve dependencies,
# otherwise it takes forever to resolve them.
# See https://github.com/bundler/bundler/issues/6677
gem 'rails', '>0.a'

# Needed to help Bundler figure out how to resolve dependencies, otherwise it takes forever to
# resolve them
if branch == 'master' || Gem::Version.new(branch[1..-1]) >= Gem::Version.new('2.10.0')
gem 'rails', '~> 6.0'
else
gem 'rails', '~> 5.0'
end
# Provides basic authentication functionality for testing parts of your engine
gem 'solidus_auth_devise'

group :development, :test do
gem "pry-rails"
case ENV['DB']
when 'mysql'
gem 'mysql2'
when 'postgresql'
gem 'pg'
else
gem 'sqlite3'
end

group :test do
gem 'solidus_support', github: 'solidusio/solidus_support'

factory_bot_version = if branch < 'v2.5'
'4.10.0'
else
'> 4.10.0'
end

gem 'factory_bot', factory_bot_version
gem 'rails-controller-testing'
end
gem 'rails-controller-testing', group: :test

gemspec

# Use a local Gemfile to include development dependencies that might not be
# relevant for the project or for other contributors, e.g.: `gem 'pry-debug'`.
eval_gemfile 'Gemfile-local' if File.exist? 'Gemfile-local'
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2016 [name of plugin creator]
Copyright (c) 2020 Peter Berkenbosch
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
Expand All @@ -9,7 +9,7 @@ are permitted provided that the following conditions are met:
* 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 Spree nor the names of its contributors may be used to
* 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.

Expand Down
29 changes: 4 additions & 25 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
require 'bundler'
# frozen_string_literal: true

Bundler::GemHelper.install_tasks
require 'solidus_dev_support/rake_tasks'
SolidusDevSupport::RakeTasks.install

begin
require 'spree/testing_support/extension_rake'
require 'rspec/core/rake_task'

RSpec::Core::RakeTask.new(:spec)

task default: %i(first_run spec)
rescue LoadError
# no rspec available
end

task :first_run do
if Dir['spec/dummy'].empty?
Rake::Task[:test_app].invoke
Dir.chdir('../../')
end
end

desc 'Generates a dummy app for testing'
task :test_app do
ENV['LIB_NAME'] = 'solidus_affirm'
Rake::Task['extension:test_app'].invoke
end
task default: 'extension:specs'
2 changes: 1 addition & 1 deletion app/assets/javascripts/spree/frontend/solidus_affirm.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Placeholder manifest file.
// the installer will append this file to the app vendored assets here: vendor/assets/javascripts/spree/backend/all.js'
// the installer will append this file to the app vendored assets here: vendor/assets/javascripts/spree/frontend/all.js'
Loading

0 comments on commit a6cc39b

Please sign in to comment.