Skip to content

Commit

Permalink
Update the extension with the latest solidus_dev_support defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Oct 5, 2020
1 parent 70d796a commit 8aaef9d
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 32 deletions.
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
15 changes: 1 addition & 14 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: enable
Exclude:
- sandbox/**/*
- spec/dummy/**/*
Expand Down Expand Up @@ -62,17 +63,3 @@ Rails/Inquiry:
Enabled: true
Exclude:
- spec/lib/solidus_paypal_commerce_platform/configuration_spec.rb

# New cops (2020-09-03)

Rails/ActiveRecordCallbacksOrder: {Enabled: true}
Rails/FindById: {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/WhereExists: {Enabled: true}
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ gem 'solidus_paypal_commerce_platform'
Bundle your dependencies and run the installation generator:

```shell
bundle
bundle exec rails g solidus_paypal_commerce_platform:install
bin/rails generate solidus_paypal_commerce_platform:install
```

### PayPal Sandbox/Live Environment
Expand Down Expand Up @@ -172,20 +171,35 @@ 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
```

### 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 origin && gem release
bundle exec gem bump -v 1.6.0
bin/rake changelog
git commit -a --amend
git push
bundle exec gem release
```

## Referral Fee
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ module SolidusPaypalCommercePlatform
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_paypal_commerce_platform.rb'
end

def add_javascripts
append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/solidus_paypal_commerce_platform\n" # rubocop:disable Layout/LineLength
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# frozen_string_literal: true

SolidusPaypalCommercePlatform.configure do |config|
# TODO: Remember to change this with the actual preferences you have implemented!
# config.sample_preference = 'sample_value'
end
12 changes: 7 additions & 5 deletions lib/solidus_paypal_commerce_platform.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
require 'solidus_core'
require 'solidus_support'

require 'solidus_paypal_commerce_platform/version'
require 'solidus_paypal_commerce_platform/configuration'
require 'solidus_paypal_commerce_platform/client'
require 'solidus_paypal_commerce_platform/configuration'
require 'solidus_paypal_commerce_platform/version'
require 'solidus_paypal_commerce_platform/engine'

module SolidusPaypalCommercePlatform
class << self
def config
@config ||= Configuration.new
def configuration
@configuration ||= Configuration.new
end

alias config configuration

def configure
yield config
yield configuration
end
end
end
4 changes: 2 additions & 2 deletions solidus_paypal_commerce_platform.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |spec|
spec.license = 'BSD-3-Clause'

spec.metadata['homepage_uri'] = spec.homepage
spec.metadata['source_code_uri'] = 'https://github.com/solidusio-contrib/solidus_paypal_commerce_platform#readme'
spec.metadata['source_code_uri'] = 'https://github.com/solidusio-contrib/solidus_paypal_commerce_platform'
spec.metadata['changelog_uri'] = 'https://github.com/solidusio-contrib/solidus_paypal_commerce_platform/releases'

spec.required_ruby_version = Gem::Requirement.new('~> 2.5')
Expand All @@ -36,5 +36,5 @@ Gem::Specification.new do |spec|
spec.add_dependency 'paypal-checkout-sdk'

spec.add_development_dependency 'cuprite'
spec.add_development_dependency 'solidus_dev_support'
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 @@ -19,8 +19,8 @@
# in spec/support/ and its subdirectories.
Dir["#{__dir__}/support/**/*.rb"].sort.each { |f| require f }

# Requires factories defined in lib/solidus_paypal_commerce_platform/factories.rb
require 'solidus_paypal_commerce_platform/factories'
# Requires factories defined in lib/solidus_paypal_commerce_platform/testing_support/factories.rb
require 'solidus_paypal_commerce_platform/testing_support/factories'

RSpec.configure do |config|
config.infer_spec_type_from_file_location!
Expand Down

0 comments on commit 8aaef9d

Please sign in to comment.