spree_cmd 1.3.5 → 2.0.0.rc1
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 +14 -6
- data/lib/spree_cmd/extension.rb +1 -1
- data/lib/spree_cmd/installer.rb +3 -3
- data/lib/spree_cmd/templates/extension/CONTRIBUTING.md +57 -0
- data/lib/spree_cmd/templates/extension/Gemfile +2 -2
- data/lib/spree_cmd/templates/extension/README.md +25 -6
- data/lib/spree_cmd/templates/extension/Rakefile +2 -2
- data/lib/spree_cmd/templates/extension/app/assets/javascripts/admin/%file_name%.js +1 -1
- data/lib/spree_cmd/templates/extension/app/assets/javascripts/store/%file_name%.js +1 -1
- data/lib/spree_cmd/templates/extension/app/assets/stylesheets/admin/%file_name%.css +1 -1
- data/lib/spree_cmd/templates/extension/app/assets/stylesheets/store/%file_name%.css +1 -1
- data/lib/spree_cmd/templates/extension/extension.gemspec +5 -2
- data/lib/spree_cmd/templates/extension/lib/%file_name%/factories.rb.tt +6 -0
- data/lib/spree_cmd/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt +8 -6
- data/lib/spree_cmd/templates/extension/spec/spec_helper.rb.tt +43 -9
- data/spec/spec_helper.rb +14 -0
- metadata +12 -11
- data/lib/spree_cmd/templates/extension/rspec +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
Yjg2MWJiYWRiZmQyNTE2MzVlNzM3NjE0OWE2YjQ2ZTEzYzExNGE0Nw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NGFkMWEwYjkyZDdhMzE0MmM4YWU1OTEyZDBkZDRlMjEzZDVmYzFjZQ==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MjA0NTUwMmY3MTkxNDRlMWMzNDQwYjY5N2MwNmUwN2MzZjMwZjk1NTk0MzRh
|
10
|
+
ZWYxMTRiZGYwM2UxZTY0NmQyNDdkNjQ2ZGRkMDAwMjgzMTA0NTg5MjJjNDI4
|
11
|
+
ZTBkNDIxYWViNjk1NmY2M2JkMGU0MGQ1YTc4ZjhlOGI2NzQwMzE=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OTZkMGQ3ZGM2MTUzZGJjOWM5YTIxZmQ4YmU0ZDFiMGZhY2YzYjA2YWYzOGE3
|
14
|
+
ZDNhN2FjZjM4ODZjMWE2OTNjOTQ0OTgwYTI1YmM4MWFiYjhmNGYzOGMwMzRm
|
15
|
+
MTUyY2ZkZDU0YzUzMTRjMGUzOTE0MWU5ZTFiYzJkNzY2YjQ1ZmE=
|
data/lib/spree_cmd/extension.rb
CHANGED
data/lib/spree_cmd/installer.rb
CHANGED
@@ -43,7 +43,7 @@ module SpreeCmd
|
|
43
43
|
@spree_gem_options = {}
|
44
44
|
|
45
45
|
if options[:edge]
|
46
|
-
@spree_gem_options[:git] = '
|
46
|
+
@spree_gem_options[:git] = 'https://github.com/spree/spree.git'
|
47
47
|
elsif options[:path]
|
48
48
|
@spree_gem_options[:path] = options[:path]
|
49
49
|
elsif options[:git]
|
@@ -94,11 +94,11 @@ module SpreeCmd
|
|
94
94
|
gem :spree, @spree_gem_options
|
95
95
|
|
96
96
|
if @install_default_gateways
|
97
|
-
gem :spree_gateway, :
|
97
|
+
gem :spree_gateway, :git => "https://github.com/spree/spree_gateway.git"
|
98
98
|
end
|
99
99
|
|
100
100
|
if @install_default_auth
|
101
|
-
gem :spree_auth_devise, :
|
101
|
+
gem :spree_auth_devise, :git => "https://github.com/spree/spree_auth_devise.git"
|
102
102
|
end
|
103
103
|
|
104
104
|
run 'bundle install', :capture => true
|
@@ -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/)
|
@@ -1,6 +1,6 @@
|
|
1
|
-
source '
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
|
3
3
|
# Provides basic authentication functionality for testing parts of your engine
|
4
|
-
gem 'spree_auth_devise', :
|
4
|
+
gem 'spree_auth_devise', github: 'spree/spree_auth_devise'
|
5
5
|
|
6
6
|
gemspec
|
@@ -3,19 +3,38 @@
|
|
3
3
|
|
4
4
|
Introduction goes here.
|
5
5
|
|
6
|
+
Installation
|
7
|
+
------------
|
6
8
|
|
7
|
-
|
8
|
-
=======
|
9
|
+
Add <%= file_name %> to your Gemfile:
|
9
10
|
|
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
|
+
```
|
11
21
|
|
12
22
|
Testing
|
13
23
|
-------
|
14
24
|
|
15
25
|
Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.
|
16
26
|
|
17
|
-
|
18
|
-
|
19
|
-
|
27
|
+
```shell
|
28
|
+
bundle
|
29
|
+
bundle exec rake test_app
|
30
|
+
bundle exec rspec spec
|
31
|
+
```
|
32
|
+
|
33
|
+
When testing your applications integration with this extension you may use it's factories.
|
34
|
+
Simply add this require statement to your spec_helper:
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
require '<%= file_name %>/factories'
|
38
|
+
```
|
20
39
|
|
21
40
|
Copyright (c) <%= Time.now.year %> [name of extension creator], released under the New BSD License
|
@@ -2,7 +2,7 @@ require 'bundler'
|
|
2
2
|
Bundler::GemHelper.install_tasks
|
3
3
|
|
4
4
|
require 'rspec/core/rake_task'
|
5
|
-
require 'spree/
|
5
|
+
require 'spree/testing_support/extension_rake'
|
6
6
|
|
7
7
|
RSpec::Core::RakeTask.new
|
8
8
|
|
@@ -11,5 +11,5 @@ task :default => [:spec]
|
|
11
11
|
desc 'Generates a dummy app for testing'
|
12
12
|
task :test_app do
|
13
13
|
ENV['LIB_NAME'] = '<%=file_name%>'
|
14
|
-
Rake::Task['
|
14
|
+
Rake::Task['extension:test_app'].invoke
|
15
15
|
end
|
@@ -1 +1 @@
|
|
1
|
-
//= require admin/
|
1
|
+
//= require admin/spree_backend
|
@@ -1 +1 @@
|
|
1
|
-
//= require store/
|
1
|
+
//= require store/spree_frontend
|
@@ -5,7 +5,7 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.version = '<%= spree_version %>'
|
6
6
|
s.summary = 'TODO: Add gem summary here'
|
7
7
|
s.description = 'TODO: Add (optional) gem description here'
|
8
|
-
s.required_ruby_version = '>= 1.
|
8
|
+
s.required_ruby_version = '>= 1.9.3'
|
9
9
|
|
10
10
|
# s.author = 'You'
|
11
11
|
# s.email = 'you@example.com'
|
@@ -18,11 +18,14 @@ Gem::Specification.new do |s|
|
|
18
18
|
|
19
19
|
s.add_dependency 'spree_core', '~> <%= spree_version %>'
|
20
20
|
|
21
|
-
s.add_development_dependency 'capybara', '~> 2.
|
21
|
+
s.add_development_dependency 'capybara', '~> 2.1'
|
22
22
|
s.add_development_dependency 'coffee-rails'
|
23
|
+
s.add_development_dependency 'database_cleaner'
|
23
24
|
s.add_development_dependency 'factory_girl', '~> 4.2'
|
24
25
|
s.add_development_dependency 'ffaker'
|
25
26
|
s.add_development_dependency 'rspec-rails', '~> 2.13'
|
26
27
|
s.add_development_dependency 'sass-rails'
|
28
|
+
s.add_development_dependency 'selenium-webdriver'
|
29
|
+
s.add_development_dependency 'simplecov'
|
27
30
|
s.add_development_dependency 'sqlite3'
|
28
31
|
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/spree_cmd/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
CHANGED
@@ -2,6 +2,8 @@ module <%= class_name %>
|
|
2
2
|
module Generators
|
3
3
|
class InstallGenerator < Rails::Generators::Base
|
4
4
|
|
5
|
+
class_option :auto_run_migrations, :type => :boolean, :default => false
|
6
|
+
|
5
7
|
def add_javascripts
|
6
8
|
append_file 'app/assets/javascripts/store/all.js', "//= require store/<%= file_name %>\n"
|
7
9
|
append_file 'app/assets/javascripts/admin/all.js', "//= require admin/<%= file_name %>\n"
|
@@ -17,12 +19,12 @@ module <%= class_name %>
|
|
17
19
|
end
|
18
20
|
|
19
21
|
def run_migrations
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
26
28
|
end
|
27
29
|
end
|
28
30
|
end
|
@@ -1,9 +1,21 @@
|
|
1
|
+
# Run Coverage report
|
2
|
+
require 'simplecov'
|
3
|
+
SimpleCov.start do
|
4
|
+
add_group 'Controllers', 'app/controllers'
|
5
|
+
add_group 'Helpers', 'app/helpers'
|
6
|
+
add_group 'Mailers', 'app/mailers'
|
7
|
+
add_group 'Models', 'app/models'
|
8
|
+
add_group 'Views', 'app/views'
|
9
|
+
add_group 'Libraries', 'lib'
|
10
|
+
end
|
11
|
+
|
1
12
|
# Configure Rails Environment
|
2
13
|
ENV['RAILS_ENV'] = 'test'
|
3
14
|
|
4
15
|
require File.expand_path('../dummy/config/environment.rb', __FILE__)
|
5
16
|
|
6
17
|
require 'rspec/rails'
|
18
|
+
require 'database_cleaner'
|
7
19
|
require 'ffaker'
|
8
20
|
|
9
21
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
@@ -11,10 +23,13 @@ require 'ffaker'
|
|
11
23
|
Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
|
12
24
|
|
13
25
|
# Requires factories defined in spree_core
|
14
|
-
require 'spree/
|
15
|
-
require 'spree/
|
16
|
-
require 'spree/
|
17
|
-
require 'spree/
|
26
|
+
require 'spree/testing_support/factories'
|
27
|
+
require 'spree/testing_support/controller_requests'
|
28
|
+
require 'spree/testing_support/authorization_helpers'
|
29
|
+
require 'spree/testing_support/url_helpers'
|
30
|
+
|
31
|
+
# Requires factories defined in lib/<%= file_name %>/factories.rb
|
32
|
+
require '<%= file_name %>/factories'
|
18
33
|
|
19
34
|
RSpec.configure do |config|
|
20
35
|
config.include FactoryGirl::Syntax::Methods
|
@@ -25,7 +40,7 @@ RSpec.configure do |config|
|
|
25
40
|
#
|
26
41
|
# visit spree.admin_path
|
27
42
|
# current_path.should eql(spree.products_path)
|
28
|
-
config.include Spree::
|
43
|
+
config.include Spree::TestingSupport::UrlHelpers
|
29
44
|
|
30
45
|
# == Mock Framework
|
31
46
|
#
|
@@ -40,8 +55,27 @@ RSpec.configure do |config|
|
|
40
55
|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
41
56
|
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
42
57
|
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
config.use_transactional_fixtures =
|
58
|
+
# Capybara javascript drivers require transactional fixtures set to false, and we use DatabaseCleaner
|
59
|
+
# to cleanup after each test instead. Without transactional fixtures set to false the records created
|
60
|
+
# to setup a test will be unavailable to the browser, which runs under a seperate server instance.
|
61
|
+
config.use_transactional_fixtures = false
|
62
|
+
|
63
|
+
# Ensure Suite is set to use transactions for speed.
|
64
|
+
config.before :suite do
|
65
|
+
DatabaseCleaner.strategy = :transaction
|
66
|
+
DatabaseCleaner.clean_with :truncation
|
67
|
+
end
|
68
|
+
|
69
|
+
# Before each spec check if it is a Javascript test and switch between using database transactions or not where necessary.
|
70
|
+
config.before :each do
|
71
|
+
DatabaseCleaner.strategy = example.metadata[:js] ? :truncation : :transaction
|
72
|
+
DatabaseCleaner.start
|
73
|
+
end
|
74
|
+
|
75
|
+
# After each spec clean the database.
|
76
|
+
config.after :each do
|
77
|
+
DatabaseCleaner.clean
|
78
|
+
end
|
79
|
+
|
80
|
+
config.fail_fast = ENV['FAIL_FAST'] || false
|
47
81
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
if ENV["COVERAGE"]
|
2
|
+
# Run Coverage report
|
3
|
+
require 'simplecov'
|
4
|
+
SimpleCov.start do
|
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
|
+
end
|
13
|
+
|
1
14
|
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
|
2
15
|
# from the project root directory.
|
3
16
|
ENV["RAILS_ENV"] ||= 'test'
|
@@ -10,4 +23,5 @@ RSpec.configure do |config|
|
|
10
23
|
|
11
24
|
config.use_transactional_fixtures = false
|
12
25
|
|
26
|
+
config.fail_fast = ENV['FAIL_FAST'] || false
|
13
27
|
end
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_cmd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Mar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2013-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ! '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ! '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: thor
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 0.14.6
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 0.14.6
|
41
41
|
description: tools to create new Spree stores and extensions
|
@@ -55,6 +55,7 @@ files:
|
|
55
55
|
- lib/spree_cmd.rb
|
56
56
|
- lib/spree_cmd/extension.rb
|
57
57
|
- lib/spree_cmd/installer.rb
|
58
|
+
- lib/spree_cmd/templates/extension/CONTRIBUTING.md
|
58
59
|
- lib/spree_cmd/templates/extension/Gemfile
|
59
60
|
- lib/spree_cmd/templates/extension/LICENSE
|
60
61
|
- lib/spree_cmd/templates/extension/README.md
|
@@ -70,8 +71,8 @@ files:
|
|
70
71
|
- lib/spree_cmd/templates/extension/gitignore
|
71
72
|
- lib/spree_cmd/templates/extension/lib/%file_name%.rb.tt
|
72
73
|
- lib/spree_cmd/templates/extension/lib/%file_name%/engine.rb.tt
|
74
|
+
- lib/spree_cmd/templates/extension/lib/%file_name%/factories.rb.tt
|
73
75
|
- lib/spree_cmd/templates/extension/lib/generators/%file_name%/install/install_generator.rb.tt
|
74
|
-
- lib/spree_cmd/templates/extension/rspec
|
75
76
|
- lib/spree_cmd/templates/extension/script/rails.tt
|
76
77
|
- lib/spree_cmd/templates/extension/spec/spec_helper.rb.tt
|
77
78
|
- lib/spree_cmd/version.rb
|
@@ -87,17 +88,17 @@ require_paths:
|
|
87
88
|
- lib
|
88
89
|
required_ruby_version: !ruby/object:Gem::Requirement
|
89
90
|
requirements:
|
90
|
-
- -
|
91
|
+
- - ! '>='
|
91
92
|
- !ruby/object:Gem::Version
|
92
93
|
version: '0'
|
93
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
95
|
requirements:
|
95
|
-
- -
|
96
|
+
- - ! '>'
|
96
97
|
- !ruby/object:Gem::Version
|
97
|
-
version:
|
98
|
+
version: 1.3.1
|
98
99
|
requirements: []
|
99
100
|
rubyforge_project: spree_cmd
|
100
|
-
rubygems_version: 2.
|
101
|
+
rubygems_version: 2.0.3
|
101
102
|
signing_key:
|
102
103
|
specification_version: 4
|
103
104
|
summary: Spree Commerce command line utility
|
@@ -1 +0,0 @@
|
|
1
|
-
--color
|