README.md

THIS README IS FOR THE MASTER BRANCH OF SPREE AND REFLECTS THE WORK CURRENTLY
EXISTING ON THE MASTER BRANCH. IF YOU ARE WISHING TO USE A NON-MASTER BRANCH OF
SPREE, PLEASE CONSULT THAT BRANCH'S README AND NOT THIS ONE.

SUMMARY

Spree is a complete open source e-commerce solution built with Ruby on Rails. It
was originally developed by Sean Schofield and is now maintained by a dedicated
core team. You can find out more by
visiting the Spree e-commerce project page.

Spree actually consists of several different gems, each of which are maintained
in a single repository and documented in a single set of
online documentation. By requiring the
Spree gem you automatically require all of the necessary gem dependencies which are:

spree_api (RESTful API)

spree_frontend (User-facing components)

spree_backend (Admin area)

spree_cmd (Command-line tools)

spree_core (Models & Mailers, the basic components of Spree that it can't run without)

spree_sample (Sample data)

All of the gems are designed to work together to provide a fully functional
e-commerce platform. It is also possible, however, to use only the pieces you are
interested in. For example, you could use just the barebones spree_core gem
and perhaps combine it with your own custom backend admin instead of using
spree_api.

Installation

THIS README IS FOR THE MASTER BRANCH OF SPREE AND REFLECTS THE WORK CURRENTLY
EXISTING ON THE MASTER BRANCH. IF YOU ARE WISHING TO USE A NON-MASTER BRANCH OF
SPREE, PLEASE CONSULT THAT BRANCH'S README AND NOT THIS ONE.

The fastest way to get started is by using the spree command line tool
available in the spree gem which will add Spree to an existing Rails application.

Browse Store

http://localhost:nnnn

Browse Admin Interface

http://localhost:nnnn/admin

Working with the edge source (latest and greatest features)

The source code is essentially a collection of gems. Spree is meant to be run
within the context of Rails application. You can easily create a sandbox
application inside of your cloned source directory for testing purposes.

Performance

You may notice that your Spree store runs slowly in development mode. This is
a side-effect of how Rails works in development mode which is to continuously reload
your Ruby objects on each request. The introduction of the asset pipeline in
Rails 3.1 made default performance in development mode significantly worse. There
are, however, a few tricks to speeding up performance in development mode.

First, in your config/development.rb:

config.assets.debug =false

You can precompile your assets as follows:

RAILS_ENV=development bundle exec rake assets:precompile

If you want to remove precompiled assets (recommended before you commit to Git
and push your changes) use the following rake task:

RAILS_ENV=development bundle exec rake assets:clean

Use Dedicated Spree Devise Authentication

Add the following to your Gemfile

gem'spree_auth_devise', github:'spree/spree_auth_devise'

Then run bundle install. Authentication will then work exactly as it did in
previous versions of Spree.

This line is automatically added by the spree install command.

If you're installing this in a new Spree 1.2+ application, you'll need to install
and run the migrations with

Running Tests

Each gem contains its own series of tests, and for each directory, you need to
do a quick one-time creation of a test application and then you can use it to run
the tests. For example, to run the tests for the core project.

cd core
bundle exec rake test_app
bundle exec rspec spec

If you would like to run specs against a particular database you may specify the
dummy apps database, which defaults to sqlite3.

DB=postgres bundle exec rake test_app

If you want to run specs for only a single spec file

bundle exec rspec spec/models/spree/state_spec.rb

If you want to run a particular line of spec

bundle exec rspec spec/models/spree/state_spec.rb:7

You can also enable fail fast in order to stop tests at the first failure

FAIL_FAST=true bundle exec rspec spec/models/state_spec.rb

If you want to run the simplecov code coverage report

COVERAGE=true bundle exec rspec spec

If you're working on multiple facets of Spree to test,
please ensure that you have a postgres user: