goca-spree-cmd 3.1.14.rails.5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +26 -0
- data/README.md +22 -0
- data/Rakefile +9 -0
- data/bin/spree +2 -0
- data/bin/spree_cmd +2 -0
- data/lib/spree_cmd/extension.rb +63 -0
- data/lib/spree_cmd/templates/extension/Appraisals +16 -0
- data/lib/spree_cmd/templates/extension/CONTRIBUTING.md +57 -0
- data/lib/spree_cmd/templates/extension/Gemfile +7 -0
- data/lib/spree_cmd/templates/extension/LICENSE +26 -0
- data/lib/spree_cmd/templates/extension/README.md +50 -0
- data/lib/spree_cmd/templates/extension/Rakefile +21 -0
- data/lib/spree_cmd/templates/extension/app/assets/javascripts/spree/backend/%file_name%.js +2 -0
- data/lib/spree_cmd/templates/extension/app/assets/javascripts/spree/frontend/%file_name%.js +2 -0
- data/lib/spree_cmd/templates/extension/app/assets/stylesheets/spree/backend/%file_name%.css +4 -0
- data/lib/spree_cmd/templates/extension/app/assets/stylesheets/spree/frontend/%file_name%.css +4 -0
- data/lib/spree_cmd/templates/extension/bin/rails.tt +7 -0
- data/lib/spree_cmd/templates/extension/config/locales/en.yml +5 -0
- data/lib/spree_cmd/templates/extension/config/routes.rb +3 -0
- data/lib/spree_cmd/templates/extension/extension.gemspec +39 -0
- data/lib/spree_cmd/templates/extension/gemfiles/spree_3_1.gemfile +8 -0
- data/lib/spree_cmd/templates/extension/gemfiles/spree_3_2.gemfile +9 -0
- data/lib/spree_cmd/templates/extension/gemfiles/spree_master.gemfile +9 -0
- data/lib/spree_cmd/templates/extension/gitignore +21 -0
- data/lib/spree_cmd/templates/extension/lib/%file_name%/engine.rb.tt +20 -0
- data/lib/spree_cmd/templates/extension/lib/%file_name%/factories.rb.tt +6 -0
- data/lib/spree_cmd/templates/extension/lib/%file_name%/version.rb.tt +18 -0
- data/lib/spree_cmd/templates/extension/lib/%file_name%.rb.tt +3 -0
- data/lib/spree_cmd/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt +31 -0
- data/lib/spree_cmd/templates/extension/rspec +3 -0
- data/lib/spree_cmd/templates/extension/spec/spec_helper.rb.tt +93 -0
- data/lib/spree_cmd/templates/extension/travis.yml +28 -0
- data/lib/spree_cmd/version.rb +10 -0
- data/lib/spree_cmd.rb +11 -0
- data/spree_cmd.gemspec +25 -0
- metadata +109 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: d2f2358b66da5257484bfbe18e2eb01a2fc5a827
|
4
|
+
data.tar.gz: 73f0615e17171cd4eba936d4af87224401664d76
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ca071bc55f52e3756511eb95a4b31cab82e90cd1fc7cb8446c1f744d0ec044cc1b8cf0c9dcedb77a8533fe54fe2598dee302d7fade394b030ac3541e62b42ea7
|
7
|
+
data.tar.gz: 0eae2eface3265ea44e7dfebd8b3a1802f8a52f75f50cc43d6fdbadea6e1a86f826dd8f7abb0411dd45f8e5e1e6c60e45afe973ff568f8775ee9d92124fb6e89
|
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,22 @@
|
|
1
|
+
Spree Installer
|
2
|
+
===============
|
3
|
+
|
4
|
+
Command line utility to create new Spree extensions
|
5
|
+
|
6
|
+
See the main spree project: https://github.com/spree/spree
|
7
|
+
|
8
|
+
Installation
|
9
|
+
------------
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem install spree_cmd
|
13
|
+
```
|
14
|
+
This will make the command line utility 'spree' available.
|
15
|
+
|
16
|
+
Extensions
|
17
|
+
----------
|
18
|
+
|
19
|
+
To build a new Spree Extension, you can run
|
20
|
+
```ruby
|
21
|
+
spree extension my_extension
|
22
|
+
```
|
data/Rakefile
ADDED
data/bin/spree
ADDED
data/bin/spree_cmd
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
module SpreeCmd
|
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: '.'
|
7
|
+
|
8
|
+
source_root File.expand_path('../templates/extension', __FILE__)
|
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 'gemfiles', "#{file_name}/gemfiles"
|
19
|
+
|
20
|
+
template 'extension.gemspec', "#{file_name}/#{file_name}.gemspec"
|
21
|
+
template 'Gemfile', "#{file_name}/Gemfile"
|
22
|
+
template 'gitignore', "#{file_name}/.gitignore"
|
23
|
+
template 'LICENSE', "#{file_name}/LICENSE"
|
24
|
+
template 'Rakefile', "#{file_name}/Rakefile"
|
25
|
+
template 'README.md', "#{file_name}/README.md"
|
26
|
+
template 'config/routes.rb', "#{file_name}/config/routes.rb"
|
27
|
+
template 'config/locales/en.yml', "#{file_name}/config/locales/en.yml"
|
28
|
+
template 'rspec', "#{file_name}/.rspec"
|
29
|
+
template 'spec/spec_helper.rb.tt', "#{file_name}/spec/spec_helper.rb"
|
30
|
+
template 'travis.yml', "#{file_name}/.travis.yml"
|
31
|
+
template 'Appraisals', "#{file_name}/Appraisals"
|
32
|
+
end
|
33
|
+
|
34
|
+
def final_banner
|
35
|
+
say %{
|
36
|
+
#{'*' * 80}
|
37
|
+
|
38
|
+
Your extension has been generated with a gemspec dependency on Spree #{spree_version}.
|
39
|
+
|
40
|
+
For more information on the versioning of Spree.
|
41
|
+
See http://guides.spreecommerce.org/developer/extensions_tutorial.html#versioning-your-extension
|
42
|
+
|
43
|
+
#{'*' * 80}
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
47
|
+
no_tasks do
|
48
|
+
def class_name
|
49
|
+
Thor::Util.camel_case file_name
|
50
|
+
end
|
51
|
+
|
52
|
+
def spree_version
|
53
|
+
Gem.loaded_specs['spree_cmd'].version.to_s
|
54
|
+
end
|
55
|
+
|
56
|
+
def use_prefix(prefix)
|
57
|
+
unless file_name =~ /^#{prefix}/
|
58
|
+
@file_name = prefix + Thor::Util.snake_case(file_name)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
appraise 'spree-3-1' do
|
2
|
+
gem 'spree', '~> 3.1.0'
|
3
|
+
gem 'spree_auth_devise', '~> 3.1.0'
|
4
|
+
end
|
5
|
+
|
6
|
+
appraise 'spree-3-2' do
|
7
|
+
gem 'spree', '~> 3.2.0.rc1'
|
8
|
+
gem 'spree_auth_devise', '~> 3.2.0.beta'
|
9
|
+
gem 'rails-controller-testing'
|
10
|
+
end
|
11
|
+
|
12
|
+
appraise 'spree-master' do
|
13
|
+
gem 'spree', github: 'spree/spree', branch: 'master'
|
14
|
+
gem 'spree_auth_devise', github: 'spree/spree_auth_devise', branch: 'master'
|
15
|
+
gem 'rails-controller-testing'
|
16
|
+
end
|
@@ -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,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,50 @@
|
|
1
|
+
<%= class_name %>
|
2
|
+
<%= "=" * class_name.size %>
|
3
|
+
|
4
|
+
Introduction goes here.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
1. Add this extension to your Gemfile with this line:
|
9
|
+
```ruby
|
10
|
+
gem '<%= file_name %>', github: '[your-github-handle]/<%= file_name %>'
|
11
|
+
```
|
12
|
+
|
13
|
+
2. Install the gem using Bundler:
|
14
|
+
```ruby
|
15
|
+
bundle install
|
16
|
+
```
|
17
|
+
|
18
|
+
3. Copy & run migrations
|
19
|
+
```ruby
|
20
|
+
bundle exec rails g <%= file_name %>:install
|
21
|
+
```
|
22
|
+
|
23
|
+
4. Restart your server
|
24
|
+
|
25
|
+
If your server was running, restart it so that it can find the assets properly.
|
26
|
+
|
27
|
+
## Testing
|
28
|
+
|
29
|
+
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`.
|
30
|
+
|
31
|
+
```shell
|
32
|
+
bundle
|
33
|
+
bundle exec rake
|
34
|
+
```
|
35
|
+
|
36
|
+
When testing your applications integration with this extension you may use it's factories.
|
37
|
+
Simply add this require statement to your spec_helper:
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
require '<%= file_name %>/factories'
|
41
|
+
```
|
42
|
+
|
43
|
+
|
44
|
+
## Contributing
|
45
|
+
|
46
|
+
If you'd like to contribute, please take a look at the
|
47
|
+
[instructions](CONTRIBUTING.md) for installing dependencies and crafting a good
|
48
|
+
pull request.
|
49
|
+
|
50
|
+
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
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
2
|
+
|
3
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
4
|
+
ENGINE_PATH = File.expand_path('../../lib/<%= file_name -%>/engine', __FILE__)
|
5
|
+
|
6
|
+
require 'rails/all'
|
7
|
+
require 'rails/engine/commands'
|
@@ -0,0 +1,39 @@
|
|
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.2.2'
|
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_core', '>= 3.1.0', '< 4.0'
|
25
|
+
|
26
|
+
s.add_development_dependency 'capybara'
|
27
|
+
s.add_development_dependency 'capybara-screenshot'
|
28
|
+
s.add_development_dependency 'coffee-rails'
|
29
|
+
s.add_development_dependency 'database_cleaner'
|
30
|
+
s.add_development_dependency 'factory_bot'
|
31
|
+
s.add_development_dependency 'ffaker'
|
32
|
+
s.add_development_dependency 'rspec-rails'
|
33
|
+
s.add_development_dependency 'sass-rails'
|
34
|
+
s.add_development_dependency 'selenium-webdriver'
|
35
|
+
s.add_development_dependency 'simplecov'
|
36
|
+
s.add_development_dependency 'pg'
|
37
|
+
s.add_development_dependency 'mysql2'
|
38
|
+
s.add_development_dependency 'appraisal'
|
39
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "spree", :github => "spree/spree", :branch => "master"
|
6
|
+
gem "spree_auth_devise", :github => "spree/spree_auth_devise", :branch => "master"
|
7
|
+
gem "rails-controller-testing"
|
8
|
+
|
9
|
+
gemspec :path => "../"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
\#*
|
2
|
+
*~
|
3
|
+
.#*
|
4
|
+
.DS_Store
|
5
|
+
.idea
|
6
|
+
.localeapp/locales
|
7
|
+
.project
|
8
|
+
coverage
|
9
|
+
default
|
10
|
+
Gemfile.lock
|
11
|
+
tmp
|
12
|
+
nbproject
|
13
|
+
pkg
|
14
|
+
*.sw?
|
15
|
+
spec/dummy
|
16
|
+
.rvmrc
|
17
|
+
.sass-cache
|
18
|
+
public/spree
|
19
|
+
.ruby-version
|
20
|
+
.ruby-gemset
|
21
|
+
gemfiles/*.gemfile.lock
|
@@ -0,0 +1,20 @@
|
|
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
|
+
def self.activate
|
13
|
+
Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
|
14
|
+
Rails.configuration.cache_classes ? require(c) : load(c)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
config.to_prepare &method(:activate).to_proc
|
19
|
+
end
|
20
|
+
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
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module <%= class_name %>
|
2
|
+
module_function
|
3
|
+
|
4
|
+
# Returns the version of the currently loaded <%= class_name %> as a
|
5
|
+
# <tt>Gem::Version</tt>.
|
6
|
+
def version
|
7
|
+
Gem::Version.new VERSION::STRING
|
8
|
+
end
|
9
|
+
|
10
|
+
module VERSION
|
11
|
+
MAJOR = 0
|
12
|
+
MINOR = 0
|
13
|
+
TINY = 1
|
14
|
+
PRE = 'alpha'.freeze
|
15
|
+
|
16
|
+
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
|
17
|
+
end
|
18
|
+
end
|
data/lib/spree_cmd/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
module <%= class_name %>
|
2
|
+
module Generators
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
4
|
+
|
5
|
+
class_option :auto_run_migrations, type: :boolean, default: false
|
6
|
+
|
7
|
+
def add_javascripts
|
8
|
+
append_file 'vendor/assets/javascripts/spree/frontend/all.js', "//= require spree/frontend/<%= file_name %>\n"
|
9
|
+
append_file 'vendor/assets/javascripts/spree/backend/all.js', "//= require spree/backend/<%= file_name %>\n"
|
10
|
+
end
|
11
|
+
|
12
|
+
def add_stylesheets
|
13
|
+
inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/<%= file_name %>\n", before: /\*\//, verbose: true
|
14
|
+
inject_into_file 'vendor/assets/stylesheets/spree/backend/all.css', " *= require spree/backend/<%= file_name %>\n", before: /\*\//, verbose: true
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_migrations
|
18
|
+
run 'bundle exec rake railties:install:migrations FROM=<%= file_name %>'
|
19
|
+
end
|
20
|
+
|
21
|
+
def run_migrations
|
22
|
+
run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask 'Would you like to run the migrations now? [Y/n]')
|
23
|
+
if run_migrations
|
24
|
+
run 'bundle exec rake db:migrate'
|
25
|
+
else
|
26
|
+
puts 'Skipping rake db:migrate, don\'t forget to run it!'
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,93 @@
|
|
1
|
+
# Run Coverage report
|
2
|
+
require 'simplecov'
|
3
|
+
SimpleCov.start do
|
4
|
+
add_filter 'spec/dummy'
|
5
|
+
add_group 'Controllers', 'app/controllers'
|
6
|
+
add_group 'Helpers', 'app/helpers'
|
7
|
+
add_group 'Mailers', 'app/mailers'
|
8
|
+
add_group 'Models', 'app/models'
|
9
|
+
add_group 'Views', 'app/views'
|
10
|
+
add_group 'Libraries', 'lib'
|
11
|
+
end
|
12
|
+
|
13
|
+
# Configure Rails Environment
|
14
|
+
ENV['RAILS_ENV'] = 'test'
|
15
|
+
|
16
|
+
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
17
|
+
|
18
|
+
require 'rspec/rails'
|
19
|
+
require 'database_cleaner'
|
20
|
+
require 'ffaker'
|
21
|
+
|
22
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
23
|
+
# in spec/support/ and its subdirectories.
|
24
|
+
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
|
25
|
+
|
26
|
+
# Requires factories and other useful helpers defined in spree_core.
|
27
|
+
require 'spree/testing_support/authorization_helpers'
|
28
|
+
require 'spree/testing_support/capybara_ext'
|
29
|
+
require 'spree/testing_support/controller_requests'
|
30
|
+
require 'spree/testing_support/factories'
|
31
|
+
require 'spree/testing_support/url_helpers'
|
32
|
+
|
33
|
+
# Requires factories defined in lib/<%= file_name %>/factories.rb
|
34
|
+
require '<%= file_name %>/factories'
|
35
|
+
|
36
|
+
RSpec.configure do |config|
|
37
|
+
config.include FactoryBot::Syntax::Methods
|
38
|
+
|
39
|
+
# Infer an example group's spec type from the file location.
|
40
|
+
config.infer_spec_type_from_file_location!
|
41
|
+
|
42
|
+
# == URL Helpers
|
43
|
+
#
|
44
|
+
# Allows access to Spree's routes in specs:
|
45
|
+
#
|
46
|
+
# visit spree.admin_path
|
47
|
+
# current_path.should eql(spree.products_path)
|
48
|
+
config.include Spree::TestingSupport::UrlHelpers
|
49
|
+
|
50
|
+
# == Requests support
|
51
|
+
#
|
52
|
+
# Adds convenient methods to request Spree's controllers
|
53
|
+
# spree_get :index
|
54
|
+
config.include Spree::TestingSupport::ControllerRequests, type: :controller
|
55
|
+
|
56
|
+
# == Mock Framework
|
57
|
+
#
|
58
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
59
|
+
#
|
60
|
+
# config.mock_with :mocha
|
61
|
+
# config.mock_with :flexmock
|
62
|
+
# config.mock_with :rr
|
63
|
+
config.mock_with :rspec
|
64
|
+
config.color = true
|
65
|
+
|
66
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
67
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
68
|
+
|
69
|
+
# Capybara javascript drivers require transactional fixtures set to false, and we use DatabaseCleaner
|
70
|
+
# to cleanup after each test instead. Without transactional fixtures set to false the records created
|
71
|
+
# to setup a test will be unavailable to the browser, which runs under a separate server instance.
|
72
|
+
config.use_transactional_fixtures = false
|
73
|
+
|
74
|
+
# Ensure Suite is set to use transactions for speed.
|
75
|
+
config.before :suite do
|
76
|
+
DatabaseCleaner.strategy = :transaction
|
77
|
+
DatabaseCleaner.clean_with :truncation
|
78
|
+
end
|
79
|
+
|
80
|
+
# Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary.
|
81
|
+
config.before :each do
|
82
|
+
DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction
|
83
|
+
DatabaseCleaner.start
|
84
|
+
end
|
85
|
+
|
86
|
+
# After each spec clean the database.
|
87
|
+
config.after :each do
|
88
|
+
DatabaseCleaner.clean
|
89
|
+
end
|
90
|
+
|
91
|
+
config.fail_fast = ENV['FAIL_FAST'] || false
|
92
|
+
config.order = "random"
|
93
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
sudo: required
|
2
|
+
dist: trusty
|
3
|
+
|
4
|
+
language: ruby
|
5
|
+
|
6
|
+
env:
|
7
|
+
- DB=postgres
|
8
|
+
- DB=mysql
|
9
|
+
|
10
|
+
gemfile:
|
11
|
+
- gemfiles/spree_3_1.gemfile
|
12
|
+
- gemfiles/spree_3_2.gemfile
|
13
|
+
- gemfiles/spree_master.gemfile
|
14
|
+
|
15
|
+
script:
|
16
|
+
- bundle exec rake test_app
|
17
|
+
- bundle exec rake spec
|
18
|
+
|
19
|
+
rvm:
|
20
|
+
- 2.3.1
|
21
|
+
- 2.2.5
|
22
|
+
|
23
|
+
addons:
|
24
|
+
apt:
|
25
|
+
packages:
|
26
|
+
- mysql-server-5.6
|
27
|
+
- mysql-client-core-5.6
|
28
|
+
- mysql-client-5.6
|
data/lib/spree_cmd.rb
ADDED
data/spree_cmd.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
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_cmd"
|
7
|
+
s.version = Spree.version
|
8
|
+
s.authors = ["Chris Mar"]
|
9
|
+
s.email = ["chris@spreecommerce.com"]
|
10
|
+
s.homepage = "http://spreecommerce.com"
|
11
|
+
s.license = 'BSD-3'
|
12
|
+
s.summary = %q{Spree Commerce command line utility}
|
13
|
+
s.description = %q{tools to create new Spree stores and extensions}
|
14
|
+
|
15
|
+
s.rubyforge_project = "spree_cmd"
|
16
|
+
|
17
|
+
s.files = `git ls-files`.split("\n").reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
|
18
|
+
s.bindir = 'bin'
|
19
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
20
|
+
s.require_paths = ["lib"]
|
21
|
+
|
22
|
+
s.add_development_dependency 'rspec'
|
23
|
+
# Temporary hack until https://github.com/wycats/thor/issues/234 is fixed
|
24
|
+
s.add_dependency 'thor', '~> 0.14'
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,109 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: goca-spree-cmd
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.1.14.rails.5.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Chris Mar
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2025-02-17 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: thor
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.14'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.14'
|
41
|
+
description: tools to create new Spree stores and extensions
|
42
|
+
email:
|
43
|
+
- chris@spreecommerce.com
|
44
|
+
executables:
|
45
|
+
- spree
|
46
|
+
- spree_cmd
|
47
|
+
extensions: []
|
48
|
+
extra_rdoc_files: []
|
49
|
+
files:
|
50
|
+
- LICENSE
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- bin/spree
|
54
|
+
- bin/spree_cmd
|
55
|
+
- lib/spree_cmd.rb
|
56
|
+
- lib/spree_cmd/extension.rb
|
57
|
+
- lib/spree_cmd/templates/extension/Appraisals
|
58
|
+
- lib/spree_cmd/templates/extension/CONTRIBUTING.md
|
59
|
+
- lib/spree_cmd/templates/extension/Gemfile
|
60
|
+
- lib/spree_cmd/templates/extension/LICENSE
|
61
|
+
- lib/spree_cmd/templates/extension/README.md
|
62
|
+
- lib/spree_cmd/templates/extension/Rakefile
|
63
|
+
- lib/spree_cmd/templates/extension/app/assets/javascripts/spree/backend/%file_name%.js
|
64
|
+
- lib/spree_cmd/templates/extension/app/assets/javascripts/spree/frontend/%file_name%.js
|
65
|
+
- lib/spree_cmd/templates/extension/app/assets/stylesheets/spree/backend/%file_name%.css
|
66
|
+
- lib/spree_cmd/templates/extension/app/assets/stylesheets/spree/frontend/%file_name%.css
|
67
|
+
- lib/spree_cmd/templates/extension/bin/rails.tt
|
68
|
+
- lib/spree_cmd/templates/extension/config/locales/en.yml
|
69
|
+
- lib/spree_cmd/templates/extension/config/routes.rb
|
70
|
+
- lib/spree_cmd/templates/extension/extension.gemspec
|
71
|
+
- lib/spree_cmd/templates/extension/gemfiles/spree_3_1.gemfile
|
72
|
+
- lib/spree_cmd/templates/extension/gemfiles/spree_3_2.gemfile
|
73
|
+
- lib/spree_cmd/templates/extension/gemfiles/spree_master.gemfile
|
74
|
+
- lib/spree_cmd/templates/extension/gitignore
|
75
|
+
- lib/spree_cmd/templates/extension/lib/%file_name%.rb.tt
|
76
|
+
- lib/spree_cmd/templates/extension/lib/%file_name%/engine.rb.tt
|
77
|
+
- lib/spree_cmd/templates/extension/lib/%file_name%/factories.rb.tt
|
78
|
+
- lib/spree_cmd/templates/extension/lib/%file_name%/version.rb.tt
|
79
|
+
- lib/spree_cmd/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
|
80
|
+
- lib/spree_cmd/templates/extension/rspec
|
81
|
+
- lib/spree_cmd/templates/extension/spec/spec_helper.rb.tt
|
82
|
+
- lib/spree_cmd/templates/extension/travis.yml
|
83
|
+
- lib/spree_cmd/version.rb
|
84
|
+
- spree_cmd.gemspec
|
85
|
+
homepage: http://spreecommerce.com
|
86
|
+
licenses:
|
87
|
+
- BSD-3
|
88
|
+
metadata: {}
|
89
|
+
post_install_message:
|
90
|
+
rdoc_options: []
|
91
|
+
require_paths:
|
92
|
+
- lib
|
93
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">"
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 1.3.1
|
103
|
+
requirements: []
|
104
|
+
rubyforge_project:
|
105
|
+
rubygems_version: 2.5.2.3
|
106
|
+
signing_key:
|
107
|
+
specification_version: 4
|
108
|
+
summary: Spree Commerce command line utility
|
109
|
+
test_files: []
|