spree 0.30.0.beta1 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spree might be problematic. Click here for more details.
- data/README.md +16 -17
- data/lib/generators/spree/extension_generator.rb +70 -0
- data/lib/generators/spree/site_generator.rb +45 -0
- data/lib/generators/spree/test_app_generator.rb +97 -0
- data/lib/generators/templates/Gemfile +16 -0
- data/lib/generators/templates/LICENSE +23 -0
- data/lib/generators/templates/README.md +13 -0
- data/lib/generators/templates/Rakefile.tt +31 -0
- data/lib/generators/templates/config/database.yml +17 -0
- data/lib/generators/templates/config/environments/cucumber.rb +38 -0
- data/lib/generators/templates/extension.gemspec.tt +21 -0
- data/lib/generators/templates/extension/extension.rb.tt +17 -0
- data/lib/generators/templates/hooks.rb.tt +3 -0
- data/lib/generators/templates/install.rake.tt +26 -0
- data/lib/generators/templates/lib/tasks/%file_name%.rake.tt +1 -0
- data/lib/generators/templates/routes.rb +3 -0
- data/lib/generators/templates/spec_helper.rb +31 -0
- data/lib/generators/templates/spree_site.rb +8 -0
- data/lib/spree.rb +2 -2
- data/lib/tasks/install.rake +29 -0
- metadata +58 -16
- data/lib/generators/spree/install_generator.rb +0 -19
data/README.md
CHANGED
@@ -13,7 +13,7 @@ automatically require all of the necessary dependency gems. Those gems are as f
|
|
13
13
|
* spree_auth
|
14
14
|
* spree_core
|
15
15
|
* spree_dash
|
16
|
-
*
|
16
|
+
* spree_promo
|
17
17
|
* spree_sample
|
18
18
|
|
19
19
|
All of the gems are designed to work together to provide a fully functional e-commerce platform. It is also possible,
|
@@ -31,12 +31,17 @@ Update your bundle
|
|
31
31
|
|
32
32
|
bundle install
|
33
33
|
|
34
|
-
Then use the install generator to
|
34
|
+
Then use the install generator to do the basic setup (add Spree to Gemfile, etc.)
|
35
35
|
|
36
|
-
rails g spree:
|
36
|
+
rails g spree:site
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
Now its time to install all of the necessary migrations, assets, etc.
|
39
|
+
|
40
|
+
rake spree:install
|
41
|
+
|
42
|
+
If you'd like to also install sample data and images you can follow up the above command with:
|
43
|
+
|
44
|
+
rake spree_sample:install
|
40
45
|
|
41
46
|
Now you just need to run the new migrations
|
42
47
|
|
@@ -75,21 +80,13 @@ The source code is essentially a collection of gems. Spree is meant to be run w
|
|
75
80
|
|
76
81
|
bundle install
|
77
82
|
|
78
|
-
3. Create a
|
79
|
-
|
80
|
-
rails new sandbox -m sample/sandbox_template.rb
|
81
|
-
cd sandbox
|
82
|
-
|
83
|
-
4. Generate the necessary Spree files
|
84
|
-
|
85
|
-
rails g spree:install
|
86
|
-
|
87
|
-
5. Bootstrap the database (run the migrations, create seed data, optionally load sample data.)
|
83
|
+
3. Create a sandbox rails application for testing purposes (and automatically perform all necessary database setup)
|
88
84
|
|
89
|
-
rake
|
85
|
+
rake sandbox
|
90
86
|
|
91
87
|
6. Start the server
|
92
88
|
|
89
|
+
cd sandbox
|
93
90
|
rails server
|
94
91
|
|
95
92
|
Running Tests
|
@@ -118,4 +115,6 @@ you would use the following
|
|
118
115
|
Contributing
|
119
116
|
------------
|
120
117
|
|
121
|
-
Spree is an open source project. We encourage contributions. Please see the [contributors guidelines](http://spreecommerce.com/documentation/contributing_to_spree.html) before contributing.
|
118
|
+
Spree is an open source project. We encourage contributions. Please see the [contributors guidelines](http://spreecommerce.com/documentation/contributing_to_spree.html) before contributing.
|
119
|
+
|
120
|
+
The Github team has also been kind enough to write up some great [documentation](http://help.github.com/pull-requests/) on working with pull requests. Contributions should be performed on [topic branches](http://progit.org/book/ch3-4.html) in your personal forks - just issue your pull requests from there. We're also asking that you continue to log important issues for non-trivial patches in our [lighthouse repository](http://railsdog.lighthouseapp.com/projects/31096-spree). You can just link the pull request in the ticket (and link the ticket in the pull request.)
|
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Spree
|
4
|
+
module Generators
|
5
|
+
class ExtensionGenerator < Rails::Generators::NamedBase
|
6
|
+
source_root File.expand_path("../../templates", __FILE__)
|
7
|
+
|
8
|
+
desc "Creates a new extension with the name you specify."
|
9
|
+
check_class_collision
|
10
|
+
|
11
|
+
def create_root_files
|
12
|
+
empty_directory file_name
|
13
|
+
empty_directory "#{file_name}/config"
|
14
|
+
empty_directory "#{file_name}/db"
|
15
|
+
empty_directory "#{file_name}/public"
|
16
|
+
template "LICENSE", "#{file_name}/LICENSE"
|
17
|
+
template "Rakefile.tt", "#{file_name}/Rakefile"
|
18
|
+
template "README.md", "#{file_name}/README.md"
|
19
|
+
template ".gitignore", "#{file_name}/.gitignore"
|
20
|
+
template "extension.gemspec.tt", "#{file_name}/#{file_name}.gemspec"
|
21
|
+
end
|
22
|
+
|
23
|
+
def config_routes
|
24
|
+
template "routes.rb", "#{file_name}/config/routes.rb"
|
25
|
+
end
|
26
|
+
|
27
|
+
def install_rake
|
28
|
+
template "install.rake.tt", "#{file_name}/lib/tasks/install.rake"
|
29
|
+
end
|
30
|
+
|
31
|
+
def create_app_dirs
|
32
|
+
empty_directory extension_dir('app')
|
33
|
+
empty_directory extension_dir('app/controllers')
|
34
|
+
empty_directory extension_dir('app/helpers')
|
35
|
+
empty_directory extension_dir('app/models')
|
36
|
+
empty_directory extension_dir('app/views')
|
37
|
+
empty_directory extension_dir('spec')
|
38
|
+
end
|
39
|
+
|
40
|
+
def create_lib_files
|
41
|
+
directory "lib", "#{file_name}/lib"
|
42
|
+
template 'extension/extension.rb.tt', "#{file_name}/lib/#{file_name}.rb"
|
43
|
+
template 'hooks.rb.tt', "#{file_name}/lib/#{file_name}_hooks.rb"
|
44
|
+
end
|
45
|
+
|
46
|
+
def create_spec_helper
|
47
|
+
template "spec_helper.rb", "#{file_name}/spec/spec_helper.rb"
|
48
|
+
end
|
49
|
+
|
50
|
+
def update_gemfile
|
51
|
+
gem file_name, :path => file_name, :require => file_name
|
52
|
+
end
|
53
|
+
|
54
|
+
protected
|
55
|
+
|
56
|
+
def current_locale
|
57
|
+
I18n.locale.to_s
|
58
|
+
end
|
59
|
+
|
60
|
+
def extension_dir(join=nil)
|
61
|
+
if join
|
62
|
+
File.join(file_name, join)
|
63
|
+
else
|
64
|
+
file_name
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
module Spree
|
2
|
+
module Generators
|
3
|
+
class SiteGenerator < Rails::Generators::Base
|
4
|
+
source_root File.expand_path("../../templates", __FILE__)
|
5
|
+
|
6
|
+
desc "Configures an existing Rails application to use Spree."
|
7
|
+
|
8
|
+
def create_lib_files
|
9
|
+
template 'spree_site.rb', "lib/spree_site.rb"
|
10
|
+
end
|
11
|
+
|
12
|
+
def additional_tweaks
|
13
|
+
remove_file "public/index.html"
|
14
|
+
|
15
|
+
append_file "public/robots.txt", <<-ROBOTS
|
16
|
+
User-agent: *
|
17
|
+
Disallow: /checkouts
|
18
|
+
Disallow: /orders
|
19
|
+
Disallow: /countries
|
20
|
+
Disallow: /line_items
|
21
|
+
Disallow: /password_resets
|
22
|
+
Disallow: /states
|
23
|
+
Disallow: /user_sessions
|
24
|
+
Disallow: /users
|
25
|
+
ROBOTS
|
26
|
+
|
27
|
+
append_file "db/seeds.rb", <<-SEEDS
|
28
|
+
\n
|
29
|
+
Rake::Task["db:load_dir"].invoke( "default" )
|
30
|
+
puts "Default data has been loaded"
|
31
|
+
SEEDS
|
32
|
+
end
|
33
|
+
|
34
|
+
def config_middleware
|
35
|
+
application 'config.middleware.use "SeoAssist"'
|
36
|
+
application 'config.middleware.use "RedirectLegacyProductUrl"'
|
37
|
+
end
|
38
|
+
|
39
|
+
def require_site
|
40
|
+
application "require 'spree_site'"
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Spree
|
4
|
+
module Generators
|
5
|
+
class TestAppGenerator < Rails::Generators::Base
|
6
|
+
|
7
|
+
class_option :app_name, :type => :string,
|
8
|
+
:desc => "The name of the test rails app to generate. Defaults to test_app.",
|
9
|
+
:default => "test_app"
|
10
|
+
|
11
|
+
def self.source_root
|
12
|
+
File.expand_path('../../templates', __FILE__)
|
13
|
+
end
|
14
|
+
|
15
|
+
def generate_app
|
16
|
+
remove_directory_if_exists("spec/#{test_app}")
|
17
|
+
inside "spec" do
|
18
|
+
run "rails new #{test_app} -GJT --skip-gemfile"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def create_root
|
23
|
+
self.destination_root = File.expand_path("spec/#{test_app}", destination_root)
|
24
|
+
end
|
25
|
+
|
26
|
+
def remove_unneeded_files
|
27
|
+
remove_file "doc"
|
28
|
+
remove_file "lib/tasks"
|
29
|
+
remove_file "public/images/rails.png"
|
30
|
+
remove_file "public/index.html"
|
31
|
+
remove_file "README"
|
32
|
+
remove_file "vendor"
|
33
|
+
end
|
34
|
+
|
35
|
+
def replace_gemfile
|
36
|
+
template "Gemfile"
|
37
|
+
end
|
38
|
+
|
39
|
+
def setup_environments
|
40
|
+
template "config/environments/cucumber.rb"
|
41
|
+
append_file "config/environments/test.rb" do
|
42
|
+
<<-constantz
|
43
|
+
CART = "cart"
|
44
|
+
ADDRESS = "address"
|
45
|
+
DELIVERY = "delivery"
|
46
|
+
PAYMENT = "payment"
|
47
|
+
CONFIRM = "confirm"
|
48
|
+
COMPLETE = "complete"
|
49
|
+
CANCELED = "canceled"
|
50
|
+
RETURNED = "returned"
|
51
|
+
RETURN_AUTHORIZED = "awaiting_return"
|
52
|
+
|
53
|
+
ORDER_STATES = [CART, ADDRESS, DELIVERY, PAYMENT, CONFIRM, COMPLETE, CANCELED, RETURNED, RETURN_AUTHORIZED]
|
54
|
+
|
55
|
+
READY = "ready"
|
56
|
+
SHIPPED = "shipped"
|
57
|
+
PARTIAL = "partial"
|
58
|
+
PENDING = "pending"
|
59
|
+
BACKORDER = "backorder"
|
60
|
+
|
61
|
+
SHIPMENT_STATES = [READY, SHIPPED, PARTIAL, PENDING, BACKORDER]
|
62
|
+
|
63
|
+
PROCESSING = 'processing'
|
64
|
+
FAILED = 'failed'
|
65
|
+
COMPLETED = 'completed'
|
66
|
+
VOID = 'void'
|
67
|
+
CHECKOUT = 'checkout'
|
68
|
+
|
69
|
+
PAYMENT_STATES = [CHECKOUT, PROCESSING, FAILED, COMPLETED, VOID, PENDING]
|
70
|
+
constantz
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
def create_databases_yml
|
75
|
+
remove_file "config/database.yml"
|
76
|
+
template "config/database.yml"
|
77
|
+
end
|
78
|
+
|
79
|
+
private
|
80
|
+
|
81
|
+
def run_migrations
|
82
|
+
inside "" do
|
83
|
+
run "rake db:migrate db:seed RAILS_ENV=test"
|
84
|
+
run "rake db:migrate db:seed RAILS_ENV=cucumber"
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_app
|
89
|
+
options[:app_name]
|
90
|
+
end
|
91
|
+
|
92
|
+
def remove_directory_if_exists(path)
|
93
|
+
run "rm -r #{path}" if File.directory?(path)
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
source 'http://rubygems.org'
|
2
|
+
|
3
|
+
gem 'rails', '~> 3.0.1'
|
4
|
+
gem 'sqlite3-ruby', :require => 'sqlite3'
|
5
|
+
|
6
|
+
group :test do
|
7
|
+
gem 'rspec-rails', '~> 2.0.0'
|
8
|
+
gem 'fabrication'
|
9
|
+
end
|
10
|
+
|
11
|
+
group :cucumber do
|
12
|
+
gem 'cucumber-rails', '~> 0.3.2'
|
13
|
+
gem 'database_cleaner', '~> 0.5.2'
|
14
|
+
gem 'capybara', '~> 0.3.9', :require => false
|
15
|
+
end
|
16
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Redistribution and use in source and binary forms, with or without modification,
|
2
|
+
are permitted provided that the following conditions are met:
|
3
|
+
|
4
|
+
* Redistributions of source code must retain the above copyright notice,
|
5
|
+
this list of conditions and the following disclaimer.
|
6
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
7
|
+
this list of conditions and the following disclaimer in the documentation
|
8
|
+
and/or other materials provided with the distribution.
|
9
|
+
* Neither the name of the Rails Dog LLC nor the names of its
|
10
|
+
contributors may be used to endorse or promote products derived from this
|
11
|
+
software without specific prior written permission.
|
12
|
+
|
13
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
14
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
15
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
16
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
17
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
18
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
19
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
20
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
21
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
22
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
23
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.expand_path('../../config/application', __FILE__)
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'rake'
|
5
|
+
require 'rake/testtask'
|
6
|
+
require 'rake/packagetask'
|
7
|
+
require 'rake/gempackagetask'
|
8
|
+
|
9
|
+
spec = eval(File.read('<%=file_name %>.gemspec'))
|
10
|
+
|
11
|
+
Rake::GemPackageTask.new(spec) do |p|
|
12
|
+
p.gem_spec = spec
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Release to gemcutter"
|
16
|
+
task :release => :package do
|
17
|
+
require 'rake/gemcutter'
|
18
|
+
Rake::Gemcutter::Tasks.new(spec).define
|
19
|
+
Rake::Task['gem:push'].invoke
|
20
|
+
end
|
21
|
+
|
22
|
+
desc "Default Task"
|
23
|
+
task :default => [ :spec ]
|
24
|
+
|
25
|
+
require 'rspec/core/rake_task'
|
26
|
+
RSpec::Core::RakeTask.new
|
27
|
+
|
28
|
+
# require 'cucumber/rake/task'
|
29
|
+
# Cucumber::Rake::Task.new do |t|
|
30
|
+
# t.cucumber_opts = %w{--format pretty}
|
31
|
+
# end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
development:
|
2
|
+
adapter: sqlite3
|
3
|
+
database: db/cucumber.sqlite3
|
4
|
+
pool: 5
|
5
|
+
timeout: 5000
|
6
|
+
|
7
|
+
test:
|
8
|
+
adapter: sqlite3
|
9
|
+
database: db/test.sqlite3
|
10
|
+
pool: 5
|
11
|
+
timeout: 5000
|
12
|
+
|
13
|
+
cucumber:
|
14
|
+
adapter: sqlite3
|
15
|
+
database: db/cucumber.sqlite3
|
16
|
+
pool: 5
|
17
|
+
timeout: 5000
|
@@ -0,0 +1,38 @@
|
|
1
|
+
TestApp::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Log error messages when you accidentally call methods on nil.
|
11
|
+
config.whiny_nils = true
|
12
|
+
|
13
|
+
# Show full error reports and disable caching
|
14
|
+
config.consider_all_requests_local = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Raise exceptions instead of rendering exception templates
|
18
|
+
config.action_dispatch.show_exceptions = false
|
19
|
+
|
20
|
+
# Disable request forgery protection in test environment
|
21
|
+
config.action_controller.allow_forgery_protection = false
|
22
|
+
|
23
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
24
|
+
# The :test delivery method accumulates sent emails in the
|
25
|
+
# ActionMailer::Base.deliveries array.
|
26
|
+
config.action_mailer.delivery_method = :test
|
27
|
+
|
28
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
29
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
30
|
+
# like if you have constraints or database-specific column types
|
31
|
+
# config.active_record.schema_format = :sql
|
32
|
+
|
33
|
+
# Print deprecation notices to the stderr
|
34
|
+
config.active_support.deprecation = :stderr
|
35
|
+
|
36
|
+
config.action_mailer.default_url_options = { :host => 'testapp.com' }
|
37
|
+
|
38
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.platform = Gem::Platform::RUBY
|
3
|
+
s.name = '<%= file_name %>'
|
4
|
+
s.version = '1.0.0'
|
5
|
+
s.summary = 'Add gem summary here'
|
6
|
+
#s.description = 'Add (optional) gem description here'
|
7
|
+
s.required_ruby_version = '>= 1.8.7'
|
8
|
+
|
9
|
+
# s.author = 'David Heinemeier Hansson'
|
10
|
+
# s.email = 'david@loudthinking.com'
|
11
|
+
# s.homepage = 'http://www.rubyonrails.org'
|
12
|
+
# s.rubyforge_project = 'actionmailer'
|
13
|
+
|
14
|
+
s.files = Dir['CHANGELOG', 'README.md', 'LICENSE', 'lib/**/*', 'app/**/*']
|
15
|
+
s.require_path = 'lib'
|
16
|
+
s.requirements << 'none'
|
17
|
+
|
18
|
+
s.has_rdoc = true
|
19
|
+
|
20
|
+
s.add_dependency('spree_core', '>= <%= Spree.version %>')
|
21
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spree_core'
|
2
|
+
require '<%=file_name%>_hooks'
|
3
|
+
|
4
|
+
module <%=class_name%>
|
5
|
+
class Engine < Rails::Engine
|
6
|
+
|
7
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
8
|
+
|
9
|
+
def self.activate
|
10
|
+
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c|
|
11
|
+
Rails.env.production? ? require(c) : load(c)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
config.to_prepare &method(:activate).to_proc
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
namespace :<%= file_name %> do
|
2
|
+
desc "Copies all migrations and assets (NOTE: This will be obsolete with Rails 3.1)"
|
3
|
+
task :install do
|
4
|
+
Rake::Task['<%= file_name %>:install:migrations'].invoke
|
5
|
+
Rake::Task['<%= file_name %>:install:assets'].invoke
|
6
|
+
end
|
7
|
+
|
8
|
+
namespace :install do
|
9
|
+
desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
|
10
|
+
task :migrations do
|
11
|
+
source = File.join(File.dirname(__FILE__), '..', '..', 'db')
|
12
|
+
destination = File.join(Rails.root, 'db')
|
13
|
+
puts "INFO: Mirroring assets from #{source} to #{destination}"
|
14
|
+
Spree::FileUtilz.mirror_files(source, destination)
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Copies all assets (NOTE: This will be obsolete with Rails 3.1)"
|
18
|
+
task :assets do
|
19
|
+
source = File.join(File.dirname(__FILE__), '..', '..', 'public')
|
20
|
+
destination = File.join(Rails.root, 'public')
|
21
|
+
puts "INFO: Mirroring assets from #{source} to #{destination}"
|
22
|
+
Spree::FileUtilz.mirror_files(source, destination)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
# add custom rake tasks here
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# This file is copied to ~/spec when you run 'ruby script/generate rspec'
|
2
|
+
# from the project root directory.
|
3
|
+
ENV["RAILS_ENV"] ||= 'test'
|
4
|
+
require File.expand_path("../../../config/environment", __FILE__)
|
5
|
+
require 'rspec/rails'
|
6
|
+
require 'fabrication'
|
7
|
+
|
8
|
+
# Requires supporting files with custom matchers and macros, etc,
|
9
|
+
# in ./support/ and its subdirectories.
|
10
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
11
|
+
|
12
|
+
RSpec.configure do |config|
|
13
|
+
# == Mock Framework
|
14
|
+
#
|
15
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
16
|
+
#
|
17
|
+
# config.mock_with :mocha
|
18
|
+
# config.mock_with :flexmock
|
19
|
+
# config.mock_with :rr
|
20
|
+
config.mock_with :rspec
|
21
|
+
|
22
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
23
|
+
|
24
|
+
#config.include Devise::TestHelpers, :type => :controller
|
25
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
26
|
+
# examples within a transaction, comment the following line or assign false
|
27
|
+
# instead of true.
|
28
|
+
config.use_transactional_fixtures = true
|
29
|
+
end
|
30
|
+
|
31
|
+
@configuration ||= AppConfiguration.find_or_create_by_name("Default configuration")
|
data/lib/spree.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
namespace :spree do
|
2
|
+
desc "Copies all migrations and assets (NOTE: This will be obsolete with Rails 3.1)"
|
3
|
+
task :install do
|
4
|
+
Rake::Task['spree:install:migrations'].invoke
|
5
|
+
Rake::Task['spree:install:assets'].invoke
|
6
|
+
end
|
7
|
+
|
8
|
+
namespace :install do
|
9
|
+
|
10
|
+
desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
|
11
|
+
task :migrations do
|
12
|
+
Rake::Task['spree_core:install:migrations'].invoke
|
13
|
+
Rake::Task['spree_auth:install:migrations'].invoke
|
14
|
+
Rake::Task['spree_api:install:migrations'].invoke
|
15
|
+
Rake::Task['spree_dash:install:migrations'].invoke
|
16
|
+
Rake::Task['spree_promo:install:migrations'].invoke
|
17
|
+
end
|
18
|
+
|
19
|
+
desc "Copies all assets (NOTE: This will be obsolete with Rails 3.1)"
|
20
|
+
task :assets do
|
21
|
+
Rake::Task['spree_core:install:assets'].invoke
|
22
|
+
Rake::Task['spree_auth:install:assets'].invoke
|
23
|
+
Rake::Task['spree_api:install:assets'].invoke
|
24
|
+
Rake::Task['spree_dash:install:assets'].invoke
|
25
|
+
Rake::Task['spree_promo:install:assets'].invoke
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 103
|
5
|
+
prerelease: false
|
5
6
|
segments:
|
6
7
|
- 0
|
7
8
|
- 30
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.30.0.beta1
|
10
|
+
version: 0.30.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sean Schofield
|
@@ -15,84 +15,105 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-09
|
18
|
+
date: 2010-11-09 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: spree_core
|
23
23
|
prerelease: false
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
25
26
|
requirements:
|
26
27
|
- - "="
|
27
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 103
|
28
30
|
segments:
|
29
31
|
- 0
|
30
32
|
- 30
|
31
33
|
- 0
|
32
|
-
|
33
|
-
version: 0.30.0.beta1
|
34
|
+
version: 0.30.0
|
34
35
|
type: :runtime
|
35
36
|
version_requirements: *id001
|
36
37
|
- !ruby/object:Gem::Dependency
|
37
38
|
name: spree_auth
|
38
39
|
prerelease: false
|
39
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
40
42
|
requirements:
|
41
43
|
- - "="
|
42
44
|
- !ruby/object:Gem::Version
|
45
|
+
hash: 103
|
43
46
|
segments:
|
44
47
|
- 0
|
45
48
|
- 30
|
46
49
|
- 0
|
47
|
-
|
48
|
-
version: 0.30.0.beta1
|
50
|
+
version: 0.30.0
|
49
51
|
type: :runtime
|
50
52
|
version_requirements: *id002
|
51
53
|
- !ruby/object:Gem::Dependency
|
52
54
|
name: spree_api
|
53
55
|
prerelease: false
|
54
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
55
58
|
requirements:
|
56
59
|
- - "="
|
57
60
|
- !ruby/object:Gem::Version
|
61
|
+
hash: 103
|
58
62
|
segments:
|
59
63
|
- 0
|
60
64
|
- 30
|
61
65
|
- 0
|
62
|
-
|
63
|
-
version: 0.30.0.beta1
|
66
|
+
version: 0.30.0
|
64
67
|
type: :runtime
|
65
68
|
version_requirements: *id003
|
66
69
|
- !ruby/object:Gem::Dependency
|
67
70
|
name: spree_dash
|
68
71
|
prerelease: false
|
69
72
|
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
70
74
|
requirements:
|
71
75
|
- - "="
|
72
76
|
- !ruby/object:Gem::Version
|
77
|
+
hash: 103
|
73
78
|
segments:
|
74
79
|
- 0
|
75
80
|
- 30
|
76
81
|
- 0
|
77
|
-
|
78
|
-
version: 0.30.0.beta1
|
82
|
+
version: 0.30.0
|
79
83
|
type: :runtime
|
80
84
|
version_requirements: *id004
|
81
85
|
- !ruby/object:Gem::Dependency
|
82
86
|
name: spree_sample
|
83
87
|
prerelease: false
|
84
88
|
requirement: &id005 !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
85
90
|
requirements:
|
86
91
|
- - "="
|
87
92
|
- !ruby/object:Gem::Version
|
93
|
+
hash: 103
|
88
94
|
segments:
|
89
95
|
- 0
|
90
96
|
- 30
|
91
97
|
- 0
|
92
|
-
|
93
|
-
version: 0.30.0.beta1
|
98
|
+
version: 0.30.0
|
94
99
|
type: :runtime
|
95
100
|
version_requirements: *id005
|
101
|
+
- !ruby/object:Gem::Dependency
|
102
|
+
name: spree_promo
|
103
|
+
prerelease: false
|
104
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - "="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
hash: 103
|
110
|
+
segments:
|
111
|
+
- 0
|
112
|
+
- 30
|
113
|
+
- 0
|
114
|
+
version: 0.30.0
|
115
|
+
type: :runtime
|
116
|
+
version_requirements: *id006
|
96
117
|
description: "Spree is an open source e-commerce framework for Ruby on Rails. Join us on the spree-user google group or in #spree on IRC"
|
97
118
|
email: sean@railsdog.com
|
98
119
|
executables: []
|
@@ -103,8 +124,25 @@ extra_rdoc_files: []
|
|
103
124
|
|
104
125
|
files:
|
105
126
|
- README.md
|
106
|
-
- lib/generators/spree/
|
127
|
+
- lib/generators/spree/extension_generator.rb
|
128
|
+
- lib/generators/spree/site_generator.rb
|
129
|
+
- lib/generators/spree/test_app_generator.rb
|
130
|
+
- lib/generators/templates/config/database.yml
|
131
|
+
- lib/generators/templates/config/environments/cucumber.rb
|
132
|
+
- lib/generators/templates/extension/extension.rb.tt
|
133
|
+
- lib/generators/templates/extension.gemspec.tt
|
134
|
+
- lib/generators/templates/Gemfile
|
135
|
+
- lib/generators/templates/hooks.rb.tt
|
136
|
+
- lib/generators/templates/install.rake.tt
|
137
|
+
- lib/generators/templates/lib/tasks/%file_name%.rake.tt
|
138
|
+
- lib/generators/templates/LICENSE
|
139
|
+
- lib/generators/templates/Rakefile.tt
|
140
|
+
- lib/generators/templates/README.md
|
141
|
+
- lib/generators/templates/routes.rb
|
142
|
+
- lib/generators/templates/spec_helper.rb
|
143
|
+
- lib/generators/templates/spree_site.rb
|
107
144
|
- lib/spree.rb
|
145
|
+
- lib/tasks/install.rake
|
108
146
|
has_rdoc: true
|
109
147
|
homepage: http://spreecommerce.com
|
110
148
|
licenses: []
|
@@ -115,18 +153,22 @@ rdoc_options: []
|
|
115
153
|
require_paths:
|
116
154
|
- lib
|
117
155
|
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
+
none: false
|
118
157
|
requirements:
|
119
158
|
- - ">="
|
120
159
|
- !ruby/object:Gem::Version
|
160
|
+
hash: 57
|
121
161
|
segments:
|
122
162
|
- 1
|
123
163
|
- 8
|
124
164
|
- 7
|
125
165
|
version: 1.8.7
|
126
166
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
167
|
+
none: false
|
127
168
|
requirements:
|
128
169
|
- - ">="
|
129
170
|
- !ruby/object:Gem::Version
|
171
|
+
hash: 23
|
130
172
|
segments:
|
131
173
|
- 1
|
132
174
|
- 3
|
@@ -135,7 +177,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
177
|
requirements:
|
136
178
|
- none
|
137
179
|
rubyforge_project: spree
|
138
|
-
rubygems_version: 1.3.
|
180
|
+
rubygems_version: 1.3.7
|
139
181
|
signing_key:
|
140
182
|
specification_version: 3
|
141
183
|
summary: Full-stack e-commerce framework for Ruby on Rails.
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module Spree
|
2
|
-
module Generators
|
3
|
-
class InstallGenerator < Rails::Generators::Base
|
4
|
-
#source_root File.expand_path("../../templates", __FILE__)
|
5
|
-
|
6
|
-
desc "Configures an existing Rails application to use Spree."
|
7
|
-
|
8
|
-
def run_generators
|
9
|
-
generate 'spree_core:install', '-f'
|
10
|
-
generate 'spree_api:install', '-f'
|
11
|
-
generate 'spree_auth:install', '-f'
|
12
|
-
generate 'spree_dash:install', '-f'
|
13
|
-
generate 'spree_promotions:install', '-f'
|
14
|
-
generate 'spree_sample:install', '-f'
|
15
|
-
end
|
16
|
-
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|