solidus_cmd 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/solidus +3 -0
- data/lib/solidus_cmd.rb +13 -0
- data/lib/solidus_cmd/extension.rb +55 -0
- data/lib/solidus_cmd/templates/extension/CONTRIBUTING.md +57 -0
- data/lib/solidus_cmd/templates/extension/Gemfile +10 -0
- data/lib/solidus_cmd/templates/extension/LICENSE +26 -0
- data/lib/solidus_cmd/templates/extension/README.md +39 -0
- data/lib/solidus_cmd/templates/extension/Rakefile +21 -0
- data/lib/solidus_cmd/templates/extension/app/assets/javascripts/spree/backend/%file_name%.js +2 -0
- data/lib/solidus_cmd/templates/extension/app/assets/javascripts/spree/frontend/%file_name%.js +2 -0
- data/lib/solidus_cmd/templates/extension/app/assets/stylesheets/spree/backend/%file_name%.css +4 -0
- data/lib/solidus_cmd/templates/extension/app/assets/stylesheets/spree/frontend/%file_name%.css +4 -0
- data/lib/solidus_cmd/templates/extension/bin/rails.tt +7 -0
- data/lib/solidus_cmd/templates/extension/config/locales/en.yml +5 -0
- data/lib/solidus_cmd/templates/extension/config/routes.rb +3 -0
- data/lib/solidus_cmd/templates/extension/extension.gemspec +30 -0
- data/lib/solidus_cmd/templates/extension/gitignore +14 -0
- data/lib/solidus_cmd/templates/extension/lib/%file_name%.rb.tt +2 -0
- data/lib/solidus_cmd/templates/extension/lib/%file_name%/engine.rb.tt +20 -0
- data/lib/solidus_cmd/templates/extension/lib/%file_name%/factories.rb.tt +6 -0
- data/lib/solidus_cmd/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt +31 -0
- data/lib/solidus_cmd/templates/extension/rspec +1 -0
- data/lib/solidus_cmd/templates/extension/spec/spec_helper.rb.tt +87 -0
- data/lib/solidus_cmd/version.rb +3 -0
- data/solidus_cmd.gemspec +27 -0
- metadata +136 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 77ab455f7554b49f5a49e13975b61b0fa7996be4
|
4
|
+
data.tar.gz: f13cc6f6199cf1765e0ac00722588d7ac417a474
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bcb7e0b2f715127cba93f6a55aa100c08d4c86a601cd87330d8aa0301dc331e7b1ab7b518aa0045f1dfc2c94b7911014abbf047a0ee1b6442c77605c56e9edbd
|
7
|
+
data.tar.gz: a8617037f4321301291d1fcbbad7426840187fcfe600f196c2805b61f586bf2bb6cf5804f734823889b5f8c731e98503df52bfa457e8b0df67bea22874d05431
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Peter Berkenbosch
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
# SolidusCmd
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/solidus_cmd`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'solidus_cmd'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install solidus_cmd
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/solidus_cmd. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
36
|
+
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
41
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "solidus_cmd"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/solidus
ADDED
data/lib/solidus_cmd.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
require "solidus_cmd/version"
|
2
|
+
|
3
|
+
require 'thor'
|
4
|
+
require 'thor/group'
|
5
|
+
|
6
|
+
case ARGV.first
|
7
|
+
when 'version', '-v', '--version'
|
8
|
+
puts SolidusCmd::VERSION
|
9
|
+
when 'extension'
|
10
|
+
ARGV.shift
|
11
|
+
require 'solidus_cmd/extension'
|
12
|
+
SolidusCmd::Extension.start
|
13
|
+
end
|
@@ -0,0 +1,55 @@
|
|
1
|
+
module SolidusCmd
|
2
|
+
|
3
|
+
class Extension < Thor::Group
|
4
|
+
include Thor::Actions
|
5
|
+
|
6
|
+
desc "builds a solidus extension"
|
7
|
+
argument :file_name, :type => :string, :desc => 'rails app_path', :default => '.'
|
8
|
+
|
9
|
+
source_root File.expand_path('../templates/extension', __FILE__)
|
10
|
+
|
11
|
+
def generate
|
12
|
+
use_prefix 'solidus_'
|
13
|
+
|
14
|
+
empty_directory file_name
|
15
|
+
|
16
|
+
directory 'app', "#{file_name}/app"
|
17
|
+
directory 'lib', "#{file_name}/lib"
|
18
|
+
directory 'bin', "#{file_name}/bin"
|
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
|
+
end
|
31
|
+
|
32
|
+
def final_banner
|
33
|
+
say %Q{
|
34
|
+
#{'*' * 80}
|
35
|
+
|
36
|
+
Your extension has been generated.
|
37
|
+
|
38
|
+
#{'*' * 80}
|
39
|
+
}
|
40
|
+
end
|
41
|
+
|
42
|
+
no_tasks do
|
43
|
+
def class_name
|
44
|
+
Thor::Util.camel_case file_name
|
45
|
+
end
|
46
|
+
|
47
|
+
def use_prefix(prefix)
|
48
|
+
unless file_name =~ /^#{prefix}/
|
49
|
+
@file_name = prefix + Thor::Util.snake_case(file_name)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
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,39 @@
|
|
1
|
+
<%= class_name %>
|
2
|
+
<%= "=" * class_name.size %>
|
3
|
+
|
4
|
+
Introduction goes here.
|
5
|
+
|
6
|
+
Installation
|
7
|
+
------------
|
8
|
+
|
9
|
+
Add <%= file_name %> to your Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem '<%= file_name %>'
|
13
|
+
```
|
14
|
+
|
15
|
+
Bundle your dependencies and run the installation generator:
|
16
|
+
|
17
|
+
```shell
|
18
|
+
bundle
|
19
|
+
bundle exec rails g <%= file_name %>:install
|
20
|
+
```
|
21
|
+
|
22
|
+
Testing
|
23
|
+
-------
|
24
|
+
|
25
|
+
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`.
|
26
|
+
|
27
|
+
```shell
|
28
|
+
bundle
|
29
|
+
bundle exec rake
|
30
|
+
```
|
31
|
+
|
32
|
+
When testing your applications integration with this extension you may use it's factories.
|
33
|
+
Simply add this require statement to your spec_helper:
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
require '<%= file_name %>/factories'
|
37
|
+
```
|
38
|
+
|
39
|
+
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,30 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
Gem::Specification.new do |s|
|
3
|
+
s.platform = Gem::Platform::RUBY
|
4
|
+
s.name = '<%= file_name %>'
|
5
|
+
s.version = '0.0.1'
|
6
|
+
s.summary = 'TODO: Add gem summary here'
|
7
|
+
s.description = 'TODO: Add (optional) gem description here'
|
8
|
+
s.required_ruby_version = '>= 2.1'
|
9
|
+
|
10
|
+
# s.author = 'You'
|
11
|
+
# s.email = 'you@example.com'
|
12
|
+
# s.homepage = 'http://www.spreecommerce.com'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split("\n")
|
15
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
16
|
+
s.require_path = "lib"
|
17
|
+
s.requirements << "none"
|
18
|
+
|
19
|
+
s.add_dependency "solidus", [">= 1.0.0", "< 1.2.0"]
|
20
|
+
|
21
|
+
s.add_development_dependency "rspec-rails", "~> 3.2"
|
22
|
+
s.add_development_dependency "simplecov"
|
23
|
+
s.add_development_dependency "sqlite3"
|
24
|
+
s.add_development_dependency "sass-rails"
|
25
|
+
s.add_development_dependency "coffee-rails"
|
26
|
+
s.add_development_dependency "factory_girl"
|
27
|
+
s.add_development_dependency "capybara"
|
28
|
+
s.add_development_dependency "database_cleaner"
|
29
|
+
s.add_development_dependency "ffaker"
|
30
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module <%= class_name %>
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
require "solidus_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
|
+
FactoryGirl.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/solidus_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 @@
|
|
1
|
+
--color
|
@@ -0,0 +1,87 @@
|
|
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 FactoryGirl::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
|
+
# == Mock Framework
|
51
|
+
#
|
52
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
53
|
+
#
|
54
|
+
# config.mock_with :mocha
|
55
|
+
# config.mock_with :flexmock
|
56
|
+
# config.mock_with :rr
|
57
|
+
config.mock_with :rspec
|
58
|
+
config.color = true
|
59
|
+
|
60
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
61
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
62
|
+
|
63
|
+
# Capybara javascript drivers require transactional fixtures set to false, and we use DatabaseCleaner
|
64
|
+
# to cleanup after each test instead. Without transactional fixtures set to false the records created
|
65
|
+
# to setup a test will be unavailable to the browser, which runs under a separate server instance.
|
66
|
+
config.use_transactional_fixtures = false
|
67
|
+
|
68
|
+
# Ensure Suite is set to use transactions for speed.
|
69
|
+
config.before :suite do
|
70
|
+
DatabaseCleaner.strategy = :transaction
|
71
|
+
DatabaseCleaner.clean_with :truncation
|
72
|
+
end
|
73
|
+
|
74
|
+
# Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary.
|
75
|
+
config.before :each do
|
76
|
+
DatabaseCleaner.strategy = RSpec.current_example.metadata[:js] ? :truncation : :transaction
|
77
|
+
DatabaseCleaner.start
|
78
|
+
end
|
79
|
+
|
80
|
+
# After each spec clean the database.
|
81
|
+
config.after :each do
|
82
|
+
DatabaseCleaner.clean
|
83
|
+
end
|
84
|
+
|
85
|
+
config.fail_fast = ENV['FAIL_FAST'] || false
|
86
|
+
config.order = "random"
|
87
|
+
end
|
data/solidus_cmd.gemspec
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'solidus_cmd/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "solidus_cmd"
|
8
|
+
spec.version = SolidusCmd::VERSION
|
9
|
+
spec.authors = ["Peter Berkenbosch"]
|
10
|
+
spec.email = ["peter@pero-ict.nl"]
|
11
|
+
|
12
|
+
spec.summary = %q{Solidus command line utility for extension generation}
|
13
|
+
spec.description = spec.summary
|
14
|
+
spec.homepage = "https://github.com/pero-ict-solutions/solidus_cmd"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = "bin"
|
19
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
spec.add_dependency 'thor', '~> 0.14'
|
23
|
+
|
24
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
25
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
26
|
+
spec.add_development_dependency "rspec"
|
27
|
+
end
|
metadata
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: solidus_cmd
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Peter Berkenbosch
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: thor
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0.14'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0.14'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.10'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.10'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Solidus command line utility for extension generation
|
70
|
+
email:
|
71
|
+
- peter@pero-ict.nl
|
72
|
+
executables:
|
73
|
+
- console
|
74
|
+
- solidus
|
75
|
+
extensions: []
|
76
|
+
extra_rdoc_files: []
|
77
|
+
files:
|
78
|
+
- ".gitignore"
|
79
|
+
- ".rspec"
|
80
|
+
- ".travis.yml"
|
81
|
+
- CODE_OF_CONDUCT.md
|
82
|
+
- Gemfile
|
83
|
+
- LICENSE.txt
|
84
|
+
- README.md
|
85
|
+
- Rakefile
|
86
|
+
- bin/console
|
87
|
+
- bin/solidus
|
88
|
+
- lib/solidus_cmd.rb
|
89
|
+
- lib/solidus_cmd/extension.rb
|
90
|
+
- lib/solidus_cmd/templates/extension/CONTRIBUTING.md
|
91
|
+
- lib/solidus_cmd/templates/extension/Gemfile
|
92
|
+
- lib/solidus_cmd/templates/extension/LICENSE
|
93
|
+
- lib/solidus_cmd/templates/extension/README.md
|
94
|
+
- lib/solidus_cmd/templates/extension/Rakefile
|
95
|
+
- lib/solidus_cmd/templates/extension/app/assets/javascripts/spree/backend/%file_name%.js
|
96
|
+
- lib/solidus_cmd/templates/extension/app/assets/javascripts/spree/frontend/%file_name%.js
|
97
|
+
- lib/solidus_cmd/templates/extension/app/assets/stylesheets/spree/backend/%file_name%.css
|
98
|
+
- lib/solidus_cmd/templates/extension/app/assets/stylesheets/spree/frontend/%file_name%.css
|
99
|
+
- lib/solidus_cmd/templates/extension/bin/rails.tt
|
100
|
+
- lib/solidus_cmd/templates/extension/config/locales/en.yml
|
101
|
+
- lib/solidus_cmd/templates/extension/config/routes.rb
|
102
|
+
- lib/solidus_cmd/templates/extension/extension.gemspec
|
103
|
+
- lib/solidus_cmd/templates/extension/gitignore
|
104
|
+
- lib/solidus_cmd/templates/extension/lib/%file_name%.rb.tt
|
105
|
+
- lib/solidus_cmd/templates/extension/lib/%file_name%/engine.rb.tt
|
106
|
+
- lib/solidus_cmd/templates/extension/lib/%file_name%/factories.rb.tt
|
107
|
+
- lib/solidus_cmd/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
|
108
|
+
- lib/solidus_cmd/templates/extension/rspec
|
109
|
+
- lib/solidus_cmd/templates/extension/spec/spec_helper.rb.tt
|
110
|
+
- lib/solidus_cmd/version.rb
|
111
|
+
- solidus_cmd.gemspec
|
112
|
+
homepage: https://github.com/pero-ict-solutions/solidus_cmd
|
113
|
+
licenses:
|
114
|
+
- MIT
|
115
|
+
metadata: {}
|
116
|
+
post_install_message:
|
117
|
+
rdoc_options: []
|
118
|
+
require_paths:
|
119
|
+
- lib
|
120
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: '0'
|
130
|
+
requirements: []
|
131
|
+
rubyforge_project:
|
132
|
+
rubygems_version: 2.4.8
|
133
|
+
signing_key:
|
134
|
+
specification_version: 4
|
135
|
+
summary: Solidus command line utility for extension generation
|
136
|
+
test_files: []
|