forked from spree-contrib/spree_email_to_friend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Trung Lê
committed
Sep 21, 2011
1 parent
deee959
commit 1c1e6ca
Showing
13 changed files
with
114 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Copyright (c) 2011 Jorge Calás Lozano, Roman Smirnov, Trung Lê | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, | ||
are permitted provided that the following conditions are met: | ||
|
||
* Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
* Neither the name Spree nor the names of its contributors may be used to | ||
endorse or promote products derived from this software without specific | ||
prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
# Spree Email to Friend extension | ||
Spree Email to Friend | ||
===================== | ||
|
||
The Spree Email to Friend extension enables you to send the product reference to your friend via email. | ||
|
||
## Installation | ||
Installation | ||
------------ | ||
|
||
1. Add the following to your Gemfile | ||
Add the following to your <code>Gemfile</code> | ||
|
||
<pre> | ||
gem 'spree_email_to_friend', :git => 'git://github.com/spree/spree_email_to_friend.git' | ||
</pre> | ||
|
||
2. Run `bundle install` | ||
Run | ||
|
||
bundle install | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,31 @@ | ||
require 'rubygems' | ||
require 'rake' | ||
require 'rake/testtask' | ||
|
||
desc "Default Task" | ||
task :default => [ :spec ] | ||
|
||
require 'rake/packagetask' | ||
require 'rubygems/package_task' | ||
require 'rspec/core/rake_task' | ||
require 'cucumber/rake/task' | ||
require 'spree_core/testing_support/common_rake' | ||
|
||
RSpec::Core::RakeTask.new | ||
Cucumber::Rake::Task.new | ||
|
||
require 'cucumber/rake/task' | ||
Cucumber::Rake::Task.new do |t| | ||
t.cucumber_opts = %w{--format pretty} | ||
end | ||
task :default => [:spec, :cucumber ] | ||
|
||
desc "Regenerates a rails 3 app for testing" | ||
task :test_app do | ||
SPREE_PATH = ENV['SPREE_PATH'] | ||
raise "SPREE_PATH should be specified" unless SPREE_PATH | ||
require File.join(SPREE_PATH, 'lib/generators/spree/test_app_generator') | ||
class AuthTestAppGenerator < Spree::Generators::TestAppGenerator | ||
def tweak_gemfile | ||
append_file 'Gemfile' do | ||
<<-gems | ||
gem 'spree_core', :path => '#{File.join(SPREE_PATH, 'core')}' | ||
gem 'spree_auth', :path => '#{File.join(SPREE_PATH, 'auth')}' | ||
gem 'spree_email_to_friend', :path => '#{File.dirname(__FILE__)}' | ||
gems | ||
end | ||
end | ||
spec = eval(File.read('spree_email_to_friend.gemspec')) | ||
|
||
def install_gems | ||
system("cd spec/test_app && rake spree_core:install") | ||
system("cd spec/test_app && rake spree_auth:install") | ||
end | ||
Gem::PackageTask.new(spec) do |p| | ||
p.gem_spec = spec | ||
end | ||
|
||
def migrate_db | ||
run_migrations | ||
end | ||
end | ||
AuthTestAppGenerator.start | ||
desc "Release to gemcutter" | ||
task :release => :package do | ||
require 'rake/gemcutter' | ||
Rake::Gemcutter::Tasks.new(spec).define | ||
Rake::Task['gem:push'].invoke | ||
end | ||
|
||
namespace :test_app do | ||
desc 'Rebuild test and cucumber databases' | ||
task :rebuild_dbs do | ||
system("cd spec/test_app && rake db:drop db:migrate RAILS_ENV=test && rake db:drop db:migrate RAILS_ENV=cucumber") | ||
end | ||
desc "Generates a dummy app for testing" | ||
task :test_app do | ||
ENV['LIB_NAME'] = 'spree_email_to_friend' | ||
Rake::Task['common:test_app'].invoke | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
"0.70.x" => { :branch => 'master' } | ||
"0.60.x" => { :version => '1.1', :ref => '34e52d987be882f6cba783144a9ebfff30b90e15' } | ||
"0.50.x" => { :version => '1.1', :ref => '34e52d987be882f6cba783144a9ebfff30b90e15' } | ||
"0.40.x" => { :tag => "v1.0.0", :version => "1.0.0" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,2 @@ | ||
require 'spree_core' | ||
require 'recaptcha/rails' | ||
|
||
module SpreeEmailToFriend | ||
class Engine < Rails::Engine | ||
engine_name 'spree_email_to_friend' | ||
|
||
config.autoload_paths += %W(#{config.root}/lib) | ||
|
||
def self.activate | ||
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| | ||
Rails.application.config.cache_classes ? require(c) : load(c) | ||
end | ||
|
||
Dir.glob(File.join(File.dirname(__FILE__), "../app/overrides/**/*.rb")) do |c| | ||
Rails.application.config.cache_classes ? require(c) : load(c) | ||
end | ||
end | ||
|
||
config.to_prepare &method(:activate).to_proc | ||
end | ||
end | ||
require 'spree_email_to_friend/engine' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
require 'recaptcha/rails' | ||
|
||
module SpreeEmailToFriend | ||
class Engine < Rails::Engine | ||
engine_name 'spree_email_to_friend' | ||
|
||
config.autoload_paths += %W(#{config.root}/lib) | ||
|
||
def self.activate | ||
Dir.glob(File.join(File.dirname(__FILE__), "../../app/**/*_decorator*.rb")) do |c| | ||
Rails.application.config.cache_classes ? require(c) : load(c) | ||
end | ||
|
||
Dir.glob(File.join(File.dirname(__FILE__), "../../app/overrides/*.rb")) do |c| | ||
Rails.application.config.cache_classes ? require(c) : load(c) | ||
end | ||
end | ||
|
||
config.to_prepare &method(:activate).to_proc | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env ruby | ||
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. | ||
|
||
|
||
ENGINE_PATH = File.expand_path('../..', __FILE__) | ||
APP_PATH = File.expand_path('../../../config/application', __FILE__) | ||
require File.expand_path('../../../config/boot', __FILE__) | ||
require 'rails/commands' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters