spree_cli 4.4.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +26 -0
- data/README.md +11 -0
- data/Rakefile +9 -0
- data/bin/spree +2 -0
- data/bin/spree_cli +2 -0
- data/lib/spree_cli/extension.rb +59 -0
- data/lib/spree_cli/templates/extension/.rubocop.yml +24 -0
- data/lib/spree_cli/templates/extension/CONTRIBUTING.md +57 -0
- data/lib/spree_cli/templates/extension/Gemfile +12 -0
- data/lib/spree_cli/templates/extension/LICENSE +26 -0
- data/lib/spree_cli/templates/extension/README.md +60 -0
- data/lib/spree_cli/templates/extension/Rakefile +21 -0
- data/lib/spree_cli/templates/extension/app/.gitkeep +0 -0
- data/lib/spree_cli/templates/extension/app/controllers/.gitkeep +0 -0
- data/lib/spree_cli/templates/extension/app/models/%file_name%/configuration.rb.tt +13 -0
- data/lib/spree_cli/templates/extension/app/models/.gitkeep +0 -0
- data/lib/spree_cli/templates/extension/app/serializers/.gitkeep +0 -0
- data/lib/spree_cli/templates/extension/app/services/.gitkeep +0 -0
- data/lib/spree_cli/templates/extension/bin/rails.tt +8 -0
- data/lib/spree_cli/templates/extension/config/locales/en.yml +5 -0
- data/lib/spree_cli/templates/extension/config/routes.rb +3 -0
- data/lib/spree_cli/templates/extension/extension.gemspec +28 -0
- data/lib/spree_cli/templates/extension/gitignore +23 -0
- data/lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt +24 -0
- data/lib/spree_cli/templates/extension/lib/%file_name%/factories.rb.tt +6 -0
- data/lib/spree_cli/templates/extension/lib/%file_name%/version.rb.tt +11 -0
- data/lib/spree_cli/templates/extension/lib/%file_name%.rb.tt +4 -0
- data/lib/spree_cli/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt +20 -0
- data/lib/spree_cli/templates/extension/rspec +3 -0
- data/lib/spree_cli/templates/extension/spec/.rubocop.yml +9 -0
- data/lib/spree_cli/templates/extension/spec/spec_helper.rb +10 -0
- data/lib/spree_cli/templates/extension/travis.yml +37 -0
- data/lib/spree_cli.rb +11 -0
- data/spree_cli.gemspec +28 -0
- metadata +98 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: aec73ae40dd92f3bc25730403f9130ed57cf409935a588d9038e500a44a05ece
|
4
|
+
data.tar.gz: a539d4e0d450235edbc0e501d659be86c2e33a604f8b284172c3d26a2122e05d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d133e9ff7172060b3ea65577930321a0c0d65af9421774937aa140de4f535cc92672a3ee41271778460a7fd078b98230c8120e4795f4f54f15ec2b9ae2b24e3c
|
7
|
+
data.tar.gz: 2d5a0ab81afbadbb771292acf5b5521e70cadd5922785c411f5a6f766e7e19b1dc6564f16b0ec0b0fbfc6922e36780f7f7fc2135209ab14155513734890dfcd2
|
data/LICENSE
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
Copyright (c) 2007-2015, Spree Commerce, Inc. and other contributors
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
5
|
+
are permitted provided that the following conditions are met:
|
6
|
+
|
7
|
+
* Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
9
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
11
|
+
and/or other materials provided with the distribution.
|
12
|
+
* Neither the name Spree nor the names of its contributors may be used to
|
13
|
+
endorse or promote products derived from this software without specific
|
14
|
+
prior written permission.
|
15
|
+
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
20
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
21
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
22
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
23
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
24
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
26
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
Spree CLI
|
2
|
+
===============
|
3
|
+
|
4
|
+
Command line utility to create new Spree extensions
|
5
|
+
|
6
|
+
To build a new Spree Extension, you can run
|
7
|
+
```ruby
|
8
|
+
spree extension my_extension
|
9
|
+
```
|
10
|
+
|
11
|
+
This will create a brand new project with all the developer tools and gems needed to developer your extension.
|
data/Rakefile
ADDED
data/bin/spree
ADDED
data/bin/spree_cli
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
module SpreeCli
|
2
|
+
class Extension < Thor::Group
|
3
|
+
include Thor::Actions
|
4
|
+
|
5
|
+
desc 'builds a spree extension'
|
6
|
+
argument :file_name, type: :string, desc: 'rails app_path', default: 'sample_extension'
|
7
|
+
|
8
|
+
source_root File.expand_path('templates/extension', __dir__)
|
9
|
+
|
10
|
+
def generate
|
11
|
+
use_prefix 'spree_'
|
12
|
+
|
13
|
+
empty_directory file_name
|
14
|
+
|
15
|
+
directory 'app', "#{file_name}/app"
|
16
|
+
directory 'lib', "#{file_name}/lib"
|
17
|
+
directory 'bin', "#{file_name}/bin"
|
18
|
+
directory 'spec', "#{file_name}/spec"
|
19
|
+
|
20
|
+
chmod "#{file_name}/bin/rails", 0o755
|
21
|
+
|
22
|
+
template 'extension.gemspec', "#{file_name}/#{file_name}.gemspec"
|
23
|
+
template 'Gemfile', "#{file_name}/Gemfile"
|
24
|
+
template 'gitignore', "#{file_name}/.gitignore"
|
25
|
+
template 'LICENSE', "#{file_name}/LICENSE"
|
26
|
+
template 'Rakefile', "#{file_name}/Rakefile"
|
27
|
+
template 'README.md', "#{file_name}/README.md"
|
28
|
+
template 'config/routes.rb', "#{file_name}/config/routes.rb"
|
29
|
+
template 'config/locales/en.yml', "#{file_name}/config/locales/en.yml"
|
30
|
+
template 'rspec', "#{file_name}/.rspec"
|
31
|
+
template 'travis.yml', "#{file_name}/.travis.yml"
|
32
|
+
template '.rubocop.yml', "#{file_name}/.rubocop.yml"
|
33
|
+
end
|
34
|
+
|
35
|
+
def final_banner
|
36
|
+
say %{
|
37
|
+
#{'*' * 80}
|
38
|
+
|
39
|
+
Congrats, Your extension has been generated :rocket:
|
40
|
+
|
41
|
+
Next steps:
|
42
|
+
* Read Spree Developer Documentation at: https://dev-docs.spreecommerce.org/customization
|
43
|
+
* Start your extension at: https://dev-docs.spreecommerce.org/extensions/extensions
|
44
|
+
|
45
|
+
#{'*' * 80}
|
46
|
+
}
|
47
|
+
end
|
48
|
+
|
49
|
+
no_tasks do
|
50
|
+
def class_name
|
51
|
+
Thor::Util.camel_case file_name
|
52
|
+
end
|
53
|
+
|
54
|
+
def use_prefix(prefix)
|
55
|
+
@file_name = prefix + Thor::Util.snake_case(file_name) unless file_name =~ /^#{prefix}/
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
AllCops:
|
2
|
+
DisplayCopNames: true
|
3
|
+
TargetRubyVersion: 2.5
|
4
|
+
Include:
|
5
|
+
- '**/Gemfile'
|
6
|
+
- '**/Rakefile'
|
7
|
+
- '**/Appraisals'
|
8
|
+
Exclude:
|
9
|
+
- 'spec/dummy/**/*'
|
10
|
+
- 'lib/generators/**/*'
|
11
|
+
|
12
|
+
Rails:
|
13
|
+
Enabled: true
|
14
|
+
|
15
|
+
Metrics/LineLength:
|
16
|
+
Max: 150
|
17
|
+
|
18
|
+
# DISABLED
|
19
|
+
|
20
|
+
Style/Documentation:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
Style/FrozenStringLiteralComment:
|
24
|
+
Enabled: false
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# How to contribute
|
2
|
+
|
3
|
+
Third-party patches are essential to any great open source project. We want
|
4
|
+
to keep it as easy as possible to contribute changes that get things working
|
5
|
+
in your environment. There are a few guidelines that we need contributors to
|
6
|
+
follow so that we can have a chance of keeping on top of things.
|
7
|
+
|
8
|
+
## Getting Started
|
9
|
+
|
10
|
+
* Make sure you have a [GitHub account](https://github.com/signup/free)
|
11
|
+
* Submit a ticket for your issue, assuming one does not already exist.
|
12
|
+
* Clearly describe the issue including steps to reproduce when it is a bug.
|
13
|
+
* Make sure you fill in the earliest version that you know has the issue.
|
14
|
+
* Fork the repository on GitHub
|
15
|
+
|
16
|
+
## Making Changes
|
17
|
+
|
18
|
+
* Create a topic branch from where you want to base your work.
|
19
|
+
* This is usually the master branch.
|
20
|
+
* Only target release branches if you are certain your fix must be on that
|
21
|
+
branch.
|
22
|
+
* To quickly create a topic branch based on master; `git branch
|
23
|
+
fix/master/my_contribution master` then checkout the new branch with `git
|
24
|
+
checkout fix/master/my_contribution`. Please avoid working directly on the
|
25
|
+
`master` branch.
|
26
|
+
* Make commits of logical units.
|
27
|
+
* Check for unnecessary whitespace with `git diff --check` before committing.
|
28
|
+
* Make sure your commit messages are in the proper format.
|
29
|
+
|
30
|
+
````
|
31
|
+
(#99999) Make the example in CONTRIBUTING imperative and concrete
|
32
|
+
|
33
|
+
Without this patch applied the example commit message in the CONTRIBUTING
|
34
|
+
document is not a concrete example. This is a problem because the
|
35
|
+
contributor is left to imagine what the commit message should look like
|
36
|
+
based on a description rather than an example. This patch fixes the
|
37
|
+
problem by making the example concrete and imperative.
|
38
|
+
|
39
|
+
The first line is a real life imperative statement with a ticket number
|
40
|
+
from our issue tracker. The body describes the behavior without the patch,
|
41
|
+
why this is a problem, and how the patch fixes the problem when applied.
|
42
|
+
````
|
43
|
+
|
44
|
+
* Make sure you have added the necessary tests for your changes.
|
45
|
+
* Run _all_ the tests to assure nothing else was accidentally broken.
|
46
|
+
|
47
|
+
## Submitting Changes
|
48
|
+
|
49
|
+
* Push your changes to a topic branch in your fork of the repository.
|
50
|
+
* Submit a pull request to the extensions repository.
|
51
|
+
* Update any Github issues to mark that you have submitted code and are ready for it to be reviewed.
|
52
|
+
* Include a link to the pull request in the ticket
|
53
|
+
|
54
|
+
# Additional Resources
|
55
|
+
|
56
|
+
* [General GitHub documentation](http://help.github.com/)
|
57
|
+
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
source 'https://rubygems.org'
|
2
|
+
|
3
|
+
git_source(:github) do |repo_name|
|
4
|
+
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/')
|
5
|
+
"https://github.com/#{repo_name}.git"
|
6
|
+
end
|
7
|
+
|
8
|
+
gem 'spree', github: 'spree/spree', branch: 'main'
|
9
|
+
# gem 'spree_backend', github: 'spree/spree', branch: 'main'
|
10
|
+
gem 'rails-controller-testing'
|
11
|
+
|
12
|
+
gemspec
|
@@ -0,0 +1,26 @@
|
|
1
|
+
Copyright (c) <%= Time.now.year %> [name of plugin creator]
|
2
|
+
All rights reserved.
|
3
|
+
|
4
|
+
Redistribution and use in source and binary forms, with or without modification,
|
5
|
+
are permitted provided that the following conditions are met:
|
6
|
+
|
7
|
+
* Redistributions of source code must retain the above copyright notice,
|
8
|
+
this list of conditions and the following disclaimer.
|
9
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
10
|
+
this list of conditions and the following disclaimer in the documentation
|
11
|
+
and/or other materials provided with the distribution.
|
12
|
+
* Neither the name Spree nor the names of its contributors may be used to
|
13
|
+
endorse or promote products derived from this software without specific
|
14
|
+
prior written permission.
|
15
|
+
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
17
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
18
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
19
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
20
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
21
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
22
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
23
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
24
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
25
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
26
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# <%= class_name %>
|
2
|
+
|
3
|
+
Introduction goes here.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
1. Add this extension to your Gemfile with this line:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem '<%= file_name %>'
|
11
|
+
```
|
12
|
+
|
13
|
+
2. Install the gem using Bundler
|
14
|
+
|
15
|
+
```ruby
|
16
|
+
bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
3. Copy & run migrations
|
20
|
+
|
21
|
+
```ruby
|
22
|
+
bundle exec rails g <%= file_name %>:install
|
23
|
+
```
|
24
|
+
|
25
|
+
4. Restart your server
|
26
|
+
|
27
|
+
If your server was running, restart it so that it can find the assets properly.
|
28
|
+
|
29
|
+
## Testing
|
30
|
+
|
31
|
+
First bundle your dependencies, then run `rake`. `rake` will default to building the dummy app if it does not exist, then it will run specs. The dummy app can be regenerated by using `rake test_app`.
|
32
|
+
|
33
|
+
```shell
|
34
|
+
bundle update
|
35
|
+
bundle exec rake
|
36
|
+
```
|
37
|
+
|
38
|
+
When testing your applications integration with this extension you may use it's factories.
|
39
|
+
Simply add this require statement to your spec_helper:
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
require '<%= file_name %>/factories'
|
43
|
+
```
|
44
|
+
|
45
|
+
## Releasing
|
46
|
+
|
47
|
+
```shell
|
48
|
+
bundle exec gem bump -p -t
|
49
|
+
bundle exec gem release
|
50
|
+
```
|
51
|
+
|
52
|
+
For more options please see [gem-release README](https://github.com/svenfuchs/gem-release)
|
53
|
+
|
54
|
+
## Contributing
|
55
|
+
|
56
|
+
If you'd like to contribute, please take a look at the
|
57
|
+
[instructions](CONTRIBUTING.md) for installing dependencies and crafting a good
|
58
|
+
pull request.
|
59
|
+
|
60
|
+
Copyright (c) <%= Time.now.year %> [name of extension creator], released under the New BSD License
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
Bundler::GemHelper.install_tasks
|
3
|
+
|
4
|
+
require 'rspec/core/rake_task'
|
5
|
+
require 'spree/testing_support/extension_rake'
|
6
|
+
|
7
|
+
RSpec::Core::RakeTask.new
|
8
|
+
|
9
|
+
task :default do
|
10
|
+
if Dir['spec/dummy'].empty?
|
11
|
+
Rake::Task[:test_app].invoke
|
12
|
+
Dir.chdir('../../')
|
13
|
+
end
|
14
|
+
Rake::Task[:spec].invoke
|
15
|
+
end
|
16
|
+
|
17
|
+
desc 'Generates a dummy app for testing'
|
18
|
+
task :test_app do
|
19
|
+
ENV['LIB_NAME'] = '<%=file_name%>'
|
20
|
+
Rake::Task['extension:test_app'].invoke
|
21
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module <%= class_name %>
|
2
|
+
class Configuration < Spree::Preferences::Configuration
|
3
|
+
|
4
|
+
# Some example preferences are shown below, for more information visit:
|
5
|
+
# https://dev-docs.spreecommerce.org/internals/preferences
|
6
|
+
|
7
|
+
preference :enabled, :boolean, default: true
|
8
|
+
# preference :dark_chocolate, :boolean, default: true
|
9
|
+
# preference :color, :string, default: 'Red'
|
10
|
+
# preference :favorite_number, :integer
|
11
|
+
# preference :supported_locales, :array, default: [:en]
|
12
|
+
end
|
13
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,8 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" from the root of your extension
|
3
|
+
|
4
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
5
|
+
ENGINE_PATH = File.expand_path('../../lib/<%= file_name -%>/engine', __FILE__)
|
6
|
+
|
7
|
+
require 'rails/all'
|
8
|
+
require 'rails/engine/commands'
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
lib = File.expand_path('../lib/', __FILE__)
|
3
|
+
$LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
require '<%= file_name %>/version'
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.platform = Gem::Platform::RUBY
|
9
|
+
s.name = '<%= file_name %>'
|
10
|
+
s.version = <%= class_name %>.version
|
11
|
+
s.summary = 'Add extension summary here'
|
12
|
+
s.description = 'Add (optional) extension description here'
|
13
|
+
s.required_ruby_version = '>= 2.5'
|
14
|
+
|
15
|
+
s.author = 'You'
|
16
|
+
s.email = 'you@example.com'
|
17
|
+
s.homepage = 'https://github.com/your-github-handle/<%= file_name %>'
|
18
|
+
s.license = 'BSD-3-Clause'
|
19
|
+
|
20
|
+
s.files = `git ls-files`.split("\n").reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
|
21
|
+
s.require_path = 'lib'
|
22
|
+
s.requirements << 'none'
|
23
|
+
|
24
|
+
s.add_dependency 'spree', '>= <%= Gem.loaded_specs['spree_cli'].version %>'
|
25
|
+
s.add_dependency 'spree_extension'
|
26
|
+
|
27
|
+
s.add_development_dependency 'spree_dev_tools'
|
28
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
\#*
|
2
|
+
*~
|
3
|
+
.#*
|
4
|
+
.DS_Store
|
5
|
+
.idea
|
6
|
+
.localeapp/locales
|
7
|
+
.project
|
8
|
+
.vscode
|
9
|
+
coverage
|
10
|
+
default
|
11
|
+
Gemfile.lock
|
12
|
+
tmp
|
13
|
+
nbproject
|
14
|
+
pkg
|
15
|
+
*.sw?
|
16
|
+
spec/dummy
|
17
|
+
.rvmrc
|
18
|
+
.sass-cache
|
19
|
+
public/spree
|
20
|
+
.ruby-version
|
21
|
+
.ruby-gemset
|
22
|
+
*.gem
|
23
|
+
*/*.gem
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module <%= class_name %>
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
require 'spree/core'
|
4
|
+
isolate_namespace Spree
|
5
|
+
engine_name '<%= file_name %>'
|
6
|
+
|
7
|
+
# use rspec for tests
|
8
|
+
config.generators do |g|
|
9
|
+
g.test_framework :rspec
|
10
|
+
end
|
11
|
+
|
12
|
+
initializer '<%= file_name %>.environment', before: :load_config_initializers do |_app|
|
13
|
+
<%= class_name %>::Config = <%= class_name %>::Configuration.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.activate
|
17
|
+
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
|
18
|
+
Rails.configuration.cache_classes ? require(c) : load(c)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
config.to_prepare(&method(:activate).to_proc)
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
FactoryBot.define do
|
2
|
+
# Define your Spree extensions Factories within this file to enable applications, and other extensions to use and override them.
|
3
|
+
#
|
4
|
+
# Example adding this to your spec_helper will load these Factories for use:
|
5
|
+
# require '<%= file_name %>/factories'
|
6
|
+
end
|
data/lib/spree_cli/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
module <%= class_name %>
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
class_option :migrate, type: :boolean, default: true
|
5
|
+
|
6
|
+
def add_migrations
|
7
|
+
run 'bundle exec rake railties:install:migrations FROM=<%= file_name %>'
|
8
|
+
end
|
9
|
+
|
10
|
+
def run_migrations
|
11
|
+
run_migrations = options[:migrate] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]'))
|
12
|
+
if run_migrations
|
13
|
+
run 'bundle exec rails db:migrate'
|
14
|
+
else
|
15
|
+
puts 'Skipping rails db:migrate, don\'t forget to run it!'
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Configure Rails Environment
|
2
|
+
ENV['RAILS_ENV'] = 'test'
|
3
|
+
|
4
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
5
|
+
|
6
|
+
require 'spree_dev_tools/rspec/spec_helper'
|
7
|
+
|
8
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
9
|
+
# in spec/support/ and its subdirectories.
|
10
|
+
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].sort.each { |f| require f }
|
@@ -0,0 +1,37 @@
|
|
1
|
+
os: linux
|
2
|
+
dist: bionic
|
3
|
+
|
4
|
+
addons:
|
5
|
+
apt:
|
6
|
+
sources:
|
7
|
+
- google-chrome
|
8
|
+
packages:
|
9
|
+
- google-chrome-stable
|
10
|
+
|
11
|
+
services:
|
12
|
+
- mysql
|
13
|
+
- postgresql
|
14
|
+
|
15
|
+
language: ruby
|
16
|
+
|
17
|
+
rvm:
|
18
|
+
- 2.7
|
19
|
+
- 3.0
|
20
|
+
|
21
|
+
env:
|
22
|
+
- DB=mysql
|
23
|
+
- DB=postgres
|
24
|
+
|
25
|
+
before_install:
|
26
|
+
- mysql -u root -e "GRANT ALL ON *.* TO 'travis'@'%';"
|
27
|
+
|
28
|
+
before_script:
|
29
|
+
- CHROME_MAIN_VERSION=`google-chrome-stable --version | sed -E 's/(^Google Chrome |\.[0-9]+ )//g'`
|
30
|
+
- CHROMEDRIVER_VERSION=`curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_MAIN_VERSION"`
|
31
|
+
- curl "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" -O
|
32
|
+
- unzip chromedriver_linux64.zip -d ~/bin
|
33
|
+
- nvm install 16
|
34
|
+
|
35
|
+
script:
|
36
|
+
- bundle exec rake test_app
|
37
|
+
- bundle exec rspec
|
data/lib/spree_cli.rb
ADDED
data/spree_cli.gemspec
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require_relative '../core/lib/spree/core/version.rb'
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "spree_cli"
|
7
|
+
s.version = Spree.version
|
8
|
+
s.authors = ['Chris Mar', 'Spark Solutions']
|
9
|
+
s.email = ['hello@spreecommerce.org']
|
10
|
+
s.summary = 'Spree Commerce CLI'
|
11
|
+
s.description = 'Spree Commerce command line interface'
|
12
|
+
s.homepage = 'https://spreecommerce.org'
|
13
|
+
s.license = 'BSD-3-Clause'
|
14
|
+
|
15
|
+
s.metadata = {
|
16
|
+
"bug_tracker_uri" => "https://github.com/spree/spree/issues",
|
17
|
+
"changelog_uri" => "https://github.com/spree/spree/releases/tag/v#{s.version}",
|
18
|
+
"documentation_uri" => "https://dev-docs.spreecommerce.org/",
|
19
|
+
"source_code_uri" => "https://github.com/spree/spree/tree/v#{s.version}",
|
20
|
+
}
|
21
|
+
|
22
|
+
s.files = `git ls-files`.split("\n").reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
|
23
|
+
s.bindir = 'bin'
|
24
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
25
|
+
s.require_paths = ['lib']
|
26
|
+
|
27
|
+
s.add_dependency 'thor', '~> 1.0'
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: spree_cli
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 4.4.0.rc1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Mar
|
8
|
+
- Spark Solutions
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2021-12-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: thor
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '1.0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "~>"
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '1.0'
|
28
|
+
description: Spree Commerce command line interface
|
29
|
+
email:
|
30
|
+
- hello@spreecommerce.org
|
31
|
+
executables:
|
32
|
+
- spree
|
33
|
+
- spree_cli
|
34
|
+
extensions: []
|
35
|
+
extra_rdoc_files: []
|
36
|
+
files:
|
37
|
+
- LICENSE
|
38
|
+
- README.md
|
39
|
+
- Rakefile
|
40
|
+
- bin/spree
|
41
|
+
- bin/spree_cli
|
42
|
+
- lib/spree_cli.rb
|
43
|
+
- lib/spree_cli/extension.rb
|
44
|
+
- lib/spree_cli/templates/extension/.rubocop.yml
|
45
|
+
- lib/spree_cli/templates/extension/CONTRIBUTING.md
|
46
|
+
- lib/spree_cli/templates/extension/Gemfile
|
47
|
+
- lib/spree_cli/templates/extension/LICENSE
|
48
|
+
- lib/spree_cli/templates/extension/README.md
|
49
|
+
- lib/spree_cli/templates/extension/Rakefile
|
50
|
+
- lib/spree_cli/templates/extension/app/.gitkeep
|
51
|
+
- lib/spree_cli/templates/extension/app/controllers/.gitkeep
|
52
|
+
- lib/spree_cli/templates/extension/app/models/%file_name%/configuration.rb.tt
|
53
|
+
- lib/spree_cli/templates/extension/app/models/.gitkeep
|
54
|
+
- lib/spree_cli/templates/extension/app/serializers/.gitkeep
|
55
|
+
- lib/spree_cli/templates/extension/app/services/.gitkeep
|
56
|
+
- lib/spree_cli/templates/extension/bin/rails.tt
|
57
|
+
- lib/spree_cli/templates/extension/config/locales/en.yml
|
58
|
+
- lib/spree_cli/templates/extension/config/routes.rb
|
59
|
+
- lib/spree_cli/templates/extension/extension.gemspec
|
60
|
+
- lib/spree_cli/templates/extension/gitignore
|
61
|
+
- lib/spree_cli/templates/extension/lib/%file_name%.rb.tt
|
62
|
+
- lib/spree_cli/templates/extension/lib/%file_name%/engine.rb.tt
|
63
|
+
- lib/spree_cli/templates/extension/lib/%file_name%/factories.rb.tt
|
64
|
+
- lib/spree_cli/templates/extension/lib/%file_name%/version.rb.tt
|
65
|
+
- lib/spree_cli/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
|
66
|
+
- lib/spree_cli/templates/extension/rspec
|
67
|
+
- lib/spree_cli/templates/extension/spec/.rubocop.yml
|
68
|
+
- lib/spree_cli/templates/extension/spec/spec_helper.rb
|
69
|
+
- lib/spree_cli/templates/extension/travis.yml
|
70
|
+
- spree_cli.gemspec
|
71
|
+
homepage: https://spreecommerce.org
|
72
|
+
licenses:
|
73
|
+
- BSD-3-Clause
|
74
|
+
metadata:
|
75
|
+
bug_tracker_uri: https://github.com/spree/spree/issues
|
76
|
+
changelog_uri: https://github.com/spree/spree/releases/tag/v4.4.0.rc1
|
77
|
+
documentation_uri: https://dev-docs.spreecommerce.org/
|
78
|
+
source_code_uri: https://github.com/spree/spree/tree/v4.4.0.rc1
|
79
|
+
post_install_message:
|
80
|
+
rdoc_options: []
|
81
|
+
require_paths:
|
82
|
+
- lib
|
83
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
89
|
+
requirements:
|
90
|
+
- - ">"
|
91
|
+
- !ruby/object:Gem::Version
|
92
|
+
version: 1.3.1
|
93
|
+
requirements: []
|
94
|
+
rubygems_version: 3.2.22
|
95
|
+
signing_key:
|
96
|
+
specification_version: 4
|
97
|
+
summary: Spree Commerce CLI
|
98
|
+
test_files: []
|