spree_power_reviews 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +14 -0
- data/.rspec +1 -0
- data/Gemfile +7 -0
- data/LICENSE +26 -0
- data/README.md +46 -0
- data/Rakefile +21 -0
- data/app/assets/javascripts/spree/backend/spree_power_reviews.js +2 -0
- data/app/assets/javascripts/spree/frontend/spree_power_reviews.js +2 -0
- data/app/assets/stylesheets/spree/backend/spree_power_reviews.css +4 -0
- data/app/assets/stylesheets/spree/frontend/spree_power_reviews.css +4 -0
- data/app/controllers/spree/products_controller_decorator.rb +17 -0
- data/app/db/migrate/20150618105326_create_review_set.spree_power_reviews.rb +19 -0
- data/app/db/seeds.rb +2 -0
- data/app/models/spree/power_reviews_configuration.rb +12 -0
- data/app/models/spree/review_set.rb +4 -0
- data/app/overrides/add_power_reviews_js_to_product.rb +4 -0
- data/app/overrides/add_power_reviews_snippet_to_product.rb +4 -0
- data/app/overrides/add_power_reviews_to_product.rb +4 -0
- data/app/overrides/add_qa_to_product.rb +4 -0
- data/app/views/spree/products/question.html.erb +58 -0
- data/app/views/spree/products/review.html.erb +46 -0
- data/app/views/spree/shared/_powerreviews_engine_js.html.erb +14 -0
- data/app/views/spree/shared/_powerreviews_product_qas.html.erb +19 -0
- data/app/views/spree/shared/_powerreviews_product_qasnippet.html.erb +6 -0
- data/app/views/spree/shared/_powerreviews_product_reviews.html.erb +36 -0
- data/app/views/spree/shared/_powerreviews_product_snippet.html.erb +15 -0
- data/bin/rails +7 -0
- data/config/locales/en.yml +5 -0
- data/config/power_reviews.yml +26 -0
- data/config/routes.rb +10 -0
- data/lib/generators/spree_power_reviews/install/install_generator.rb +31 -0
- data/lib/spree_power_reviews.rb +2 -0
- data/lib/spree_power_reviews/engine.rb +20 -0
- data/lib/spree_power_reviews/factories.rb +6 -0
- data/lib/tasks/power_reviews_extension_tasks.rake +203 -0
- data/spec/spec_helper.rb +87 -0
- data/spree_power_reviews.gemspec +33 -0
- metadata +279 -0
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
Copyright (c) 2014 [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.
|
data/README.md
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
SpreePowerReviews
|
2
|
+
=================
|
3
|
+
|
4
|
+
Integrate with power reviews into spree, download review source and show reviews on product page.
|
5
|
+
It also adds the questions and answer into product page.
|
6
|
+
|
7
|
+
You need run the rake task to update your reviews from powerreviews.com server.
|
8
|
+
|
9
|
+
You are welcome to inform me any bugs or issues.
|
10
|
+
|
11
|
+
Installation
|
12
|
+
------------
|
13
|
+
|
14
|
+
Add spree_power_reviews to your Gemfile:
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
gem 'spree_power_reviews'
|
18
|
+
```
|
19
|
+
|
20
|
+
Bundle your dependencies and run the installation generator:
|
21
|
+
|
22
|
+
```shell
|
23
|
+
bundle
|
24
|
+
bundle exec rails g spree_power_reviews:install
|
25
|
+
```
|
26
|
+
|
27
|
+
Testing
|
28
|
+
-------
|
29
|
+
|
30
|
+
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`.
|
31
|
+
|
32
|
+
```shell
|
33
|
+
bundle
|
34
|
+
bundle exec rake
|
35
|
+
```
|
36
|
+
|
37
|
+
When testing your applications integration with this extension you may use it's factories.
|
38
|
+
Simply add this require statement to your spec_helper:
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
require 'spree_power_reviews/factories'
|
42
|
+
```
|
43
|
+
|
44
|
+
Contact albertliu at naturalwellbieng.com for bugs, issues.
|
45
|
+
|
46
|
+
Copyright (c) 2014 naturalwellbeing.com, released under the New BSD License
|
data/Rakefile
ADDED
@@ -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'] = 'spree_power_reviews'
|
20
|
+
Rake::Task['extension:test_app'].invoke
|
21
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class CreateSpreeReviewSet < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :spree_review_sets do |t|
|
4
|
+
t.column :inline_path, :string
|
5
|
+
t.column :full_review_count, :int
|
6
|
+
t.column :average_rating, :decimal
|
7
|
+
t.column :bottom_line_yes_votes, :int
|
8
|
+
t.column :bottom_line_no_votes, :int
|
9
|
+
t.column :qa_inline_path, :string
|
10
|
+
end
|
11
|
+
change_table :spree_products do |t|
|
12
|
+
t.references :review_set
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def self.down
|
17
|
+
drop_table :product_power_reviews
|
18
|
+
end
|
19
|
+
end
|
data/app/db/seeds.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
module Spree
|
2
|
+
class PowerReviewsConfiguration
|
3
|
+
|
4
|
+
def self.account
|
5
|
+
power_reviews_yml=File.join(Rails.root,'config/power_reviews.yml')
|
6
|
+
if File.exist? power_reviews_yml
|
7
|
+
power_reviews_yml=File.join(Rails.root,'config/power_reviews.yml')
|
8
|
+
YAML.load(File.read(power_reviews_yml))
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<% content_for :head do -%>
|
2
|
+
<%= canonical_tag %>
|
3
|
+
<% end -%>
|
4
|
+
<% content_for :breadcrumbs do %>
|
5
|
+
<%#= render "shared/pwb_banner" %>
|
6
|
+
<%= breadcrumbs(@taxon, @product) %>
|
7
|
+
<% end
|
8
|
+
additional = nil
|
9
|
+
email = nil
|
10
|
+
user_id = nil
|
11
|
+
|
12
|
+
prefix = current_store
|
13
|
+
|
14
|
+
unless params[ :number ].nil?
|
15
|
+
additional = { :order_number => params[ :number ] }
|
16
|
+
end
|
17
|
+
unless params[ :email ].nil?
|
18
|
+
email = params[ :email ]
|
19
|
+
end
|
20
|
+
unless params[ :uid ].nil?
|
21
|
+
user_id = params[ :uid ]
|
22
|
+
end
|
23
|
+
%>
|
24
|
+
|
25
|
+
<% if params[:appName]=='askQuestion'%>
|
26
|
+
<div class="product_description" style="padding-top:0px">
|
27
|
+
<h2><%= @product.name %></h2>
|
28
|
+
</br>
|
29
|
+
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<%end%>
|
33
|
+
|
34
|
+
|
35
|
+
<script type="text/javascript">
|
36
|
+
//<![CDATA[
|
37
|
+
var pr_locale = 'en_US';
|
38
|
+
var pr_page_id = <%= @product.id.to_s%>;
|
39
|
+
var pr_style_sheet = '/powerreviews.css';
|
40
|
+
var pr_merchant_group_id = <%= Spree::PowerReviewsConfiguration.account[current_store.code]["merchant_group_id"] %>;
|
41
|
+
var pr_promo_code = <%= Spree::PowerReviewsConfiguration.account[current_store.code]["pr_promo_code"] %>
|
42
|
+
var pr_site_id = <%= Spree::PowerReviewsConfiguration.account[current_store.code]["site_id"] %>;
|
43
|
+
//]]>
|
44
|
+
</script><script src="/pwr/engine/js/appLaunch.js" type="text/javascript"></script>
|
45
|
+
|
46
|
+
<script type="text/javascript">
|
47
|
+
|
48
|
+
jQuery(document).ready(function(){
|
49
|
+
$("#submitReviewIframe").load(function(){
|
50
|
+
location.href='#';
|
51
|
+
$('#submitReviewIframe').css('height','800px');
|
52
|
+
return false;
|
53
|
+
});
|
54
|
+
});
|
55
|
+
</script>
|
56
|
+
|
57
|
+
|
58
|
+
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<% content_for :head do -%>
|
2
|
+
<%= canonical_tag %>
|
3
|
+
<% end -%>
|
4
|
+
<% content_for :breadcrumbs do %>
|
5
|
+
<%#= render "shared/pwb_banner" %>
|
6
|
+
<%= breadcrumbs(@taxon, @product) %>
|
7
|
+
<% end %>
|
8
|
+
|
9
|
+
|
10
|
+
<div class="product_description" style="padding-top:0px">
|
11
|
+
<h2><%= @product.name %></h2>
|
12
|
+
</div>
|
13
|
+
|
14
|
+
|
15
|
+
<%
|
16
|
+
#for the products sharing reviews
|
17
|
+
review_product=@product
|
18
|
+
|
19
|
+
%>
|
20
|
+
|
21
|
+
<script type="text/javascript">
|
22
|
+
//<![CDATA[
|
23
|
+
var pr_locale = 'en_US';
|
24
|
+
var pr_page_id = <%= @product.id.to_s%>;
|
25
|
+
var pr_style_sheet = '/powerreviews.css';
|
26
|
+
var pr_merchant_group_id = <%= Spree::PowerReviewsConfiguration.account[current_store.code]["merchant_group_id"] %>;
|
27
|
+
var pr_promo_code = <%= Spree::PowerReviewsConfiguration.account[current_store.code]["pr_promo_code"] %>
|
28
|
+
var pr_site_id = <%= Spree::PowerReviewsConfiguration.account[current_store.code]["site_id"] %>;
|
29
|
+
//]]>
|
30
|
+
</script>
|
31
|
+
<script src="/pwr/engine/js/appLaunch.js" type="text/javascript"></script>
|
32
|
+
|
33
|
+
|
34
|
+
<script type="text/javascript">
|
35
|
+
|
36
|
+
jQuery(document).ready(function(){
|
37
|
+
$("#submitReviewIframe").load(function(){
|
38
|
+
location.href='#';
|
39
|
+
$('#submitReviewIframe').css('height','2800px');
|
40
|
+
return false;
|
41
|
+
});
|
42
|
+
});
|
43
|
+
</script>
|
44
|
+
|
45
|
+
|
46
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<%
|
2
|
+
content_for :head do %>
|
3
|
+
<link href="/pwr/engine/pr_styles_review.css?1418029260" media="screen" rel="stylesheet" type="text/css" />
|
4
|
+
<script src="/pwr/engine/js/full.js" type="text/javascript"></script>
|
5
|
+
<script type="text/javascript">
|
6
|
+
//<![CDATA[
|
7
|
+
var pr_style_sheet = '/';
|
8
|
+
var pr_locale = 'en_US';
|
9
|
+
var pr_zip_location = '/';
|
10
|
+
var pr_site_id = '2';
|
11
|
+
//]]>
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<% end -%>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
|
2
|
+
<div class="pr_review_summary" id="qa_summary_<%=@product.id.to_s%>">
|
3
|
+
<% #if ( pwr_config( :enterprise, product ) && product.review_set && !product.review_set_qa_inline_path.blank? && File.exists?( product.review_set_qa_inline_path ) )%>
|
4
|
+
<%#= File.read( product.review_set_qa_inline_path )%>
|
5
|
+
<%# end %>
|
6
|
+
</div>
|
7
|
+
<script>
|
8
|
+
var q<%=@product.id.to_s%>=$("#qa_summary_<%=@product.id.to_s%>")
|
9
|
+
q<%=@product.id.to_s%>.write=function(d){q<%=@product.id.to_s%>.html(d)}
|
10
|
+
</script>
|
11
|
+
<script type="text/javascript">
|
12
|
+
POWERREVIEWS.display.productAnswers(q<%= @product.id.to_s %>, {
|
13
|
+
'pr_page_id': "<%= @product.id.to_s %>",
|
14
|
+
'pr_ask_question':"/products/<%=@product.slug%>/question?appName=askQuestion",
|
15
|
+
'pr_answer_question':'/products/<%=@product.slug%>/answer?appName=answerQuestion&questionId=@@@QUESTION_ID@@@',
|
16
|
+
'pr_style_sheet':'/'
|
17
|
+
}
|
18
|
+
);
|
19
|
+
</script>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<%
|
2
|
+
content_for :head do %>
|
3
|
+
<link href="/pwr/engine/pr_styles_review.css?1418029260" media="screen" rel="stylesheet" type="text/css" />
|
4
|
+
<script src="/pwr/engine/js/full.js" type="text/javascript"></script>
|
5
|
+
<script type="text/javascript">
|
6
|
+
//<![CDATA[
|
7
|
+
var pr_style_sheet = '/';
|
8
|
+
var pr_locale = 'en_US';
|
9
|
+
var pr_zip_location = '/';
|
10
|
+
var pr_site_id = '2';
|
11
|
+
//]]>
|
12
|
+
</script>
|
13
|
+
|
14
|
+
<% end -%>
|
15
|
+
|
16
|
+
|
17
|
+
<div itemprop="aggregateRating" class="forschema" style="display:none;"
|
18
|
+
itemscope itemtype="http://schema.org/AggregateRating">
|
19
|
+
Rated <span itemprop="ratingValue">4</span>/5
|
20
|
+
based on <span itemprop="reviewCount">2000</span> customer reviews
|
21
|
+
</div>
|
22
|
+
<div class="pr_review_summary" id="review_<%=@product.id.to_s%>">
|
23
|
+
<%#= File.read( product.review_set_inline_path ) if (product.review_set && !product.review_set_inline_path.blank? && File.exists?( product.review_set_inline_path ) )%>
|
24
|
+
</div>
|
25
|
+
<script>
|
26
|
+
var r<%=@product.id.to_s%>=$("#review_<%=@product.id.to_s%>")
|
27
|
+
r<%=@product.id.to_s%>.html('')
|
28
|
+
r<%=@product.id.to_s%>.write=function(d){r<%=@product.id.to_s%>.html(d)}
|
29
|
+
</script>
|
30
|
+
|
31
|
+
<script type="text/javascript">
|
32
|
+
//<![CDATA[
|
33
|
+
POWERREVIEWS.display.engine(r<%=@product.id.to_s%>, {"pr_snippet_min_reviews":1,"pr_write_review":"/products/<%=@product.slug%>/review","pr_style_sheet":"/","pr_page_id":"<%=@product.id.to_s%>"});
|
34
|
+
//]]>
|
35
|
+
</script>
|
36
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div class="pr_review_summary" id="review_summary_<%=@product.id.to_s%>">
|
2
|
+
<%#= File.read( product.review_set_inline_path ) if (product.review_set && !product.review_set_inline_path.blank? && File.exists?( product.review_set_inline_path ) )%>
|
3
|
+
</div>
|
4
|
+
<script>
|
5
|
+
var rs<%=@product.id.to_s%>=$("#review_summary_<%=@product.id.to_s%>")
|
6
|
+
rs<%=@product.id.to_s%>.html('')
|
7
|
+
rs<%=@product.id.to_s%>.write=function(d){rs<%=@product.id.to_s%>.html(d)}
|
8
|
+
</script>
|
9
|
+
|
10
|
+
<script type="text/javascript">
|
11
|
+
//<![CDATA[
|
12
|
+
POWERREVIEWS.display.snippet( rs<%=@product.id.to_s%>, {"pr_snippet_min_reviews":1,"pr_read_review":"<%=@product.slug%>h#reviews","pr_write_review":"<%=@product.slug%>/review","pr_style_sheet":"http://www.naturalwellbeing.com","pr_page_id":"<%=@product.id.to_s%>"});
|
13
|
+
//]]>
|
14
|
+
</script>
|
15
|
+
|
data/bin/rails
ADDED
@@ -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/spree_power_reviews/engine', __FILE__)
|
5
|
+
|
6
|
+
require 'rails/all'
|
7
|
+
require 'rails/engine/commands'
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
# your real file should be at your_app/config folder
|
3
|
+
|
4
|
+
# power review account info
|
5
|
+
|
6
|
+
default: &default
|
7
|
+
delete: 1
|
8
|
+
delete_file: done.txt
|
9
|
+
file: zipfilename.zip
|
10
|
+
ftp_host: partners.powerreviews.com
|
11
|
+
ftp_pass: you_pass
|
12
|
+
ftp_passive: 1
|
13
|
+
ftp_user: your_user_name
|
14
|
+
review_content_names: cotent names
|
15
|
+
appLaunch_js_url : /pwr/engine/js/appLaunch.js
|
16
|
+
custom_style_url :
|
17
|
+
engine_base : /pwr/engine/js
|
18
|
+
engine_js_url : /pwr/engine/js/full.js
|
19
|
+
enterprise : 1
|
20
|
+
locale : en_US
|
21
|
+
merchant_group_id : your_merchant_group_id
|
22
|
+
review_style_url :
|
23
|
+
site_id : your_site_id
|
24
|
+
write_style_url : /stylesheets/powerreviews.css
|
25
|
+
zip_location_url : /
|
26
|
+
pr_promo_code : promotion_coupon
|
data/config/routes.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
module SpreePowerReviews
|
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/spree_power_reviews\n"
|
9
|
+
append_file 'vendor/assets/javascripts/spree/backend/all.js', "//= require spree/backend/spree_power_reviews\n"
|
10
|
+
end
|
11
|
+
|
12
|
+
def add_stylesheets
|
13
|
+
inject_into_file 'vendor/assets/stylesheets/spree/frontend/all.css', " *= require spree/frontend/spree_power_reviews\n", :before => /\*\//, :verbose => true
|
14
|
+
inject_into_file 'vendor/assets/stylesheets/spree/backend/all.css', " *= require spree/backend/spree_power_reviews\n", :before => /\*\//, :verbose => true
|
15
|
+
end
|
16
|
+
|
17
|
+
def add_migrations
|
18
|
+
run 'bundle exec rake railties:install:migrations FROM=spree_power_reviews'
|
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,20 @@
|
|
1
|
+
module SpreePowerReviews
|
2
|
+
class Engine < Rails::Engine
|
3
|
+
require 'spree/core'
|
4
|
+
isolate_namespace Spree
|
5
|
+
engine_name 'spree_power_reviews'
|
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 'spree_power_reviews/factories'
|
6
|
+
end
|
@@ -0,0 +1,203 @@
|
|
1
|
+
require 'pp'
|
2
|
+
require 'net/ftp'
|
3
|
+
require 'tempfile'
|
4
|
+
require 'nokogiri'
|
5
|
+
require 'rubygems'
|
6
|
+
require 'zip/zip'
|
7
|
+
|
8
|
+
|
9
|
+
desc "Set the environment variable RAILS_ENV='staging'."
|
10
|
+
task :staging do
|
11
|
+
ENV["RAILS_ENV"] = 'staging'
|
12
|
+
Rake::Task[:environment].invoke
|
13
|
+
end
|
14
|
+
|
15
|
+
namespace :spree do
|
16
|
+
namespace :extensions do
|
17
|
+
namespace :power_reviews do
|
18
|
+
desc "Fetch Review Data"
|
19
|
+
|
20
|
+
task :load_data => :environment do |t|
|
21
|
+
start_time = Time.now
|
22
|
+
report_str = [ "Loading Power Review Data: #{start_time.strftime( "%Y-%m-%d %H:%M:%S" )}"]
|
23
|
+
success = true
|
24
|
+
report_str << "Loading Data"
|
25
|
+
complete, report = load_data( start_time )
|
26
|
+
report_str << report
|
27
|
+
end_time = Time.now
|
28
|
+
report_str << "Finished Loading Power Reviews Data: #{start_time.strftime( "%Y-%m-%d %H:%M:%S" )}"
|
29
|
+
report_str << "Elapsed time: #{(end_time - start_time) rescue 'unknown'} seconds"
|
30
|
+
puts report_str
|
31
|
+
end
|
32
|
+
|
33
|
+
def load_data timestamp
|
34
|
+
loaded, extracted, report = get_new_data( timestamp )
|
35
|
+
pr_dir = File.join( Rails.root, "tmp", "powerreviews" )
|
36
|
+
current = File.join( pr_dir, "pwr" )
|
37
|
+
link_source = File.join( extracted, "pwr" )
|
38
|
+
the_directories = ["content", "engine"]
|
39
|
+
result = true
|
40
|
+
case loaded
|
41
|
+
when :complete
|
42
|
+
is_linked = true
|
43
|
+
load_reviews = true
|
44
|
+
|
45
|
+
if File.exist?( current ) && !File.symlink?( current )
|
46
|
+
report << "#{current} exists and is not a symlink, deleting"
|
47
|
+
remove_entry_secure(current, true)
|
48
|
+
elsif File.exist?( current ) && File.symlink?( current )
|
49
|
+
report << "Unlinking #{current}"
|
50
|
+
File.unlink( current )
|
51
|
+
end
|
52
|
+
report << "Linking #{link_source} to #{current}"
|
53
|
+
File.symlink( link_source, current )
|
54
|
+
|
55
|
+
if load_reviews
|
56
|
+
# Find the review data
|
57
|
+
rds = Dir.glob( File.join( extracted,"**/review_data_summary.xml" ) )
|
58
|
+
prods = []
|
59
|
+
summary_doc = Nokogiri::XML( open(rds.first) )
|
60
|
+
summary_doc.css( "product" ).each do | prod |
|
61
|
+
page_id = prod.css( "pageid" ).inner_text
|
62
|
+
if Product.exists?( page_id )
|
63
|
+
product = Product.find( page_id )
|
64
|
+
unless product.review_set
|
65
|
+
product.create_review_set
|
66
|
+
product.save
|
67
|
+
product.reload
|
68
|
+
end
|
69
|
+
review_set = product.review_set
|
70
|
+
thefile =prod.css( 'inlinefile[reviewpage="1"]' ).inner_text || ''
|
71
|
+
review_set.inline_path = "/data/nwbsite/current/tmp/powerreviews/" + thefile unless thefile.blank?
|
72
|
+
|
73
|
+
thefile =prod.css( 'inlinefile[questionpage="1"]' ).inner_text || ''
|
74
|
+
review_set.qa_inline_path = "/data/nwbsite/current/tmp/powerreviews/" + thefile unless thefile.blank?
|
75
|
+
review_set.full_review_count = prod.css( "fullreviews" ).inner_text.to_i
|
76
|
+
review_set.average_rating = prod.css( "average_rating_decimal" ).inner_text.to_f
|
77
|
+
review_set.bottom_line_yes_votes = prod.css( "bottom_line_yes_votes" ).inner_text.to_i
|
78
|
+
review_set.bottom_line_no_votes = prod.css( "bottom_line_no_votes" ).inner_text.to_i
|
79
|
+
review_set.save
|
80
|
+
prods << { :store => product.store.code, :permalink => product.permalink}
|
81
|
+
report << "Updating reviews for #{product.sku} (#{review_set.full_review_count} reviews)"
|
82
|
+
end
|
83
|
+
end
|
84
|
+
expire_cache( prods )
|
85
|
+
|
86
|
+
# clean up old directories
|
87
|
+
excludes = [ ".", "..", 'pwr', File.basename(extracted) ]
|
88
|
+
Dir.entries( File.expand_path( File.dirname( extracted ) ) ).reject{ |dir|
|
89
|
+
excludes.include?( dir )
|
90
|
+
}.each{ |dir|
|
91
|
+
report << "Deleting #{File.join( pr_dir, dir)}"
|
92
|
+
remove_entry_secure File.join( pr_dir, dir)
|
93
|
+
}
|
94
|
+
end
|
95
|
+
when :error
|
96
|
+
result = false
|
97
|
+
end
|
98
|
+
[result, report]
|
99
|
+
end
|
100
|
+
|
101
|
+
def expire_cache prods
|
102
|
+
return unless File.exist?(File.join(Rails.root, "public", "cache"))
|
103
|
+
controller = ProductsController.new
|
104
|
+
prods.each do |prod|
|
105
|
+
Dir.entries(File.join(Rails.root, "public", "cache")).each do |path|
|
106
|
+
next if [".", ".."].include?(path)
|
107
|
+
begin
|
108
|
+
controller.expire_page( "/cache/#{path}/products/#{prod[:permalink]}" )
|
109
|
+
rescue Exception => e
|
110
|
+
# submerge errors since its possible that the page isn't cached.
|
111
|
+
end
|
112
|
+
|
113
|
+
end
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
def get_new_data timestamp
|
118
|
+
|
119
|
+
report = []
|
120
|
+
pr_dir = File.join( Rails.root, "tmp", "powerreviews")
|
121
|
+
dest = File.join( pr_dir, timestamp.strftime( "%Y%m%d%H%M%S" ))
|
122
|
+
success = :unknown
|
123
|
+
begin
|
124
|
+
ftp = Net::FTP.new( Spree::PowerReviewsConfiguration.account["default"]["ftp_host"])
|
125
|
+
ftp.passive = Spree::PowerReviewsConfiguration.account["default"]["ftp_passive"]
|
126
|
+
ftp.login( Spree::PowerReviewsConfiguration.account["default"]["ftp_user"], Spree::PowerReviewsConfiguration.account["default"]["ftp_pass"])
|
127
|
+
|
128
|
+
# we are going to process the
|
129
|
+
if ftp.nlst.include?( Spree::PowerReviewsConfiguration.account["default"]["delete_file"]) || !Spree::PowerReviewsConfiguration.account["default"]["delete"]
|
130
|
+
report << "Downloading zipfile #{Spree::PowerReviewsConfiguration.account["default"]["file"] } and extracting to #{dest}"
|
131
|
+
tmpzip = Tempfile.new( 'zip' )
|
132
|
+
file_count = 0
|
133
|
+
ftp.getbinaryfile( Spree::PowerReviewsConfiguration.account["default"]["file"], tmpzip.path)
|
134
|
+
Zip::ZipFile.open( tmpzip.path ) { |zip_file|
|
135
|
+
zip_file.each { |f|
|
136
|
+
file_count +=1
|
137
|
+
f_path=File.join(dest, f.name)
|
138
|
+
FileUtils.mkdir_p(File.dirname(f_path))
|
139
|
+
zip_file.extract(f, f_path) unless File.exist?(f_path)
|
140
|
+
}
|
141
|
+
}
|
142
|
+
report << "Extracted #{file_count} files to #{dest}"
|
143
|
+
# verify contents
|
144
|
+
if ["content", "engine", "**/review_data_summary.xml" ].inject(true){ |result, the_dir| result && ( Dir.glob( File.join( dest, "pwr", the_dir ) ).count > 0 ) }
|
145
|
+
success = :complete
|
146
|
+
if Spree::PowerReviewsConfiguration.account["default"]["delete"]
|
147
|
+
report << "Deleting #{Spree::PowerReviewsConfiguration.account["default"]["delete_file"]}"
|
148
|
+
ftp.delete(Spree::PowerReviewsConfiguration.account["default"]["delete_file"])
|
149
|
+
end
|
150
|
+
else
|
151
|
+
success = :error
|
152
|
+
report << "Zip does not include required files."
|
153
|
+
end
|
154
|
+
else
|
155
|
+
success = :nochange
|
156
|
+
end
|
157
|
+
rescue Exception => e
|
158
|
+
report << e
|
159
|
+
success = :error
|
160
|
+
ensure
|
161
|
+
tmpzip.close if tmpzip
|
162
|
+
ftp.close if ftp
|
163
|
+
end
|
164
|
+
[success,dest,report]
|
165
|
+
end
|
166
|
+
|
167
|
+
desc "Get the directories setup"
|
168
|
+
task :directories => :environment do
|
169
|
+
|
170
|
+
pr_dir = File.join( Rails.root, "tmp", 'powerreviews' )
|
171
|
+
pub = File.join( Rails.root, "public", 'pwr' )
|
172
|
+
dst = File.join( pr_dir, 'pwr' )
|
173
|
+
|
174
|
+
unless File.exists?( dst )
|
175
|
+
boot = File.join( pr_dir, "bootstrap", "pwr" )
|
176
|
+
mkdir_p boot
|
177
|
+
File.symlink( boot, dst )
|
178
|
+
end
|
179
|
+
|
180
|
+
raise "#{pub} exists and is not a symlink" if File.exist?( pub ) && !File.symlink?( pub )
|
181
|
+
|
182
|
+
if File.exist?( pub ) && File.symlink?( pub )
|
183
|
+
File.unlink( pub )
|
184
|
+
end
|
185
|
+
File.symlink( dst, pub )
|
186
|
+
|
187
|
+
end
|
188
|
+
|
189
|
+
desc "Copies public assets of the Power Reviews to the instance public/ directory."
|
190
|
+
task :update => :environment do
|
191
|
+
is_svn_git_or_dir = proc {|path| path =~ /\.svn/ || path =~ /\.git/ || File.directory?(path) }
|
192
|
+
Dir[PowerReviewsExtension.root + "/public/**/*"].reject(&is_svn_git_or_dir).each do |file|
|
193
|
+
path = file.sub(PowerReviewsExtension.root, '')
|
194
|
+
directory = File.dirname(path)
|
195
|
+
puts "Copying #{path}..."
|
196
|
+
mkdir_p Rails.root + directory
|
197
|
+
cp file, Rails.root + path
|
198
|
+
end
|
199
|
+
# todo create RSA crypto keys.
|
200
|
+
end
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -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/spree_power_reviews/factories.rb
|
34
|
+
require 'spree_power_reviews/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
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# encoding: UTF-8
|
2
|
+
Gem::Specification.new do |s|
|
3
|
+
s.platform = Gem::Platform::RUBY
|
4
|
+
s.name = 'spree_power_reviews'
|
5
|
+
s.version = '3.0.0'
|
6
|
+
s.summary = 'integrate with power reviews into spree, download review source and show reviews on product page'
|
7
|
+
s.description = 'integrate with power reviews into spree, download review source and show reviews on product page'
|
8
|
+
s.required_ruby_version = '>= 1.9.3'
|
9
|
+
|
10
|
+
s.author = 'Albert Liu'
|
11
|
+
s.email = 'albertliu@naturalwellbeing.com'
|
12
|
+
s.homepage = 'http://www.naturalwellbeing.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
|
+
version = '3.0.0'
|
20
|
+
s.add_dependency 'spree_core', version
|
21
|
+
s.add_dependency 'zip-zip'
|
22
|
+
|
23
|
+
s.add_development_dependency 'capybara', '~> 2.4'
|
24
|
+
s.add_development_dependency 'coffee-rails'
|
25
|
+
s.add_development_dependency 'database_cleaner'
|
26
|
+
s.add_development_dependency 'factory_girl', '~> 4.4'
|
27
|
+
s.add_development_dependency 'ffaker'
|
28
|
+
s.add_development_dependency 'rspec-rails', '~> 3.1'
|
29
|
+
s.add_development_dependency 'sass-rails', '~> 4.0.2'
|
30
|
+
s.add_development_dependency 'selenium-webdriver'
|
31
|
+
s.add_development_dependency 'simplecov'
|
32
|
+
s.add_development_dependency 'sqlite3'
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,279 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: spree_power_reviews
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 7
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
version: 3.0.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Albert Liu
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2015-06-22 00:00:00 -07:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: spree_core
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - "="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 7
|
30
|
+
segments:
|
31
|
+
- 3
|
32
|
+
- 0
|
33
|
+
- 0
|
34
|
+
version: 3.0.0
|
35
|
+
type: :runtime
|
36
|
+
version_requirements: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: zip-zip
|
39
|
+
prerelease: false
|
40
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
hash: 3
|
46
|
+
segments:
|
47
|
+
- 0
|
48
|
+
version: "0"
|
49
|
+
type: :runtime
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: capybara
|
53
|
+
prerelease: false
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ~>
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 11
|
60
|
+
segments:
|
61
|
+
- 2
|
62
|
+
- 4
|
63
|
+
version: "2.4"
|
64
|
+
type: :development
|
65
|
+
version_requirements: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
name: coffee-rails
|
68
|
+
prerelease: false
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
hash: 3
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
version: "0"
|
78
|
+
type: :development
|
79
|
+
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: database_cleaner
|
82
|
+
prerelease: false
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
hash: 3
|
89
|
+
segments:
|
90
|
+
- 0
|
91
|
+
version: "0"
|
92
|
+
type: :development
|
93
|
+
version_requirements: *id005
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: factory_girl
|
96
|
+
prerelease: false
|
97
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
98
|
+
none: false
|
99
|
+
requirements:
|
100
|
+
- - ~>
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
hash: 19
|
103
|
+
segments:
|
104
|
+
- 4
|
105
|
+
- 4
|
106
|
+
version: "4.4"
|
107
|
+
type: :development
|
108
|
+
version_requirements: *id006
|
109
|
+
- !ruby/object:Gem::Dependency
|
110
|
+
name: ffaker
|
111
|
+
prerelease: false
|
112
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
hash: 3
|
118
|
+
segments:
|
119
|
+
- 0
|
120
|
+
version: "0"
|
121
|
+
type: :development
|
122
|
+
version_requirements: *id007
|
123
|
+
- !ruby/object:Gem::Dependency
|
124
|
+
name: rspec-rails
|
125
|
+
prerelease: false
|
126
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
127
|
+
none: false
|
128
|
+
requirements:
|
129
|
+
- - ~>
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
hash: 5
|
132
|
+
segments:
|
133
|
+
- 3
|
134
|
+
- 1
|
135
|
+
version: "3.1"
|
136
|
+
type: :development
|
137
|
+
version_requirements: *id008
|
138
|
+
- !ruby/object:Gem::Dependency
|
139
|
+
name: sass-rails
|
140
|
+
prerelease: false
|
141
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
142
|
+
none: false
|
143
|
+
requirements:
|
144
|
+
- - ~>
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
hash: 59
|
147
|
+
segments:
|
148
|
+
- 4
|
149
|
+
- 0
|
150
|
+
- 2
|
151
|
+
version: 4.0.2
|
152
|
+
type: :development
|
153
|
+
version_requirements: *id009
|
154
|
+
- !ruby/object:Gem::Dependency
|
155
|
+
name: selenium-webdriver
|
156
|
+
prerelease: false
|
157
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
158
|
+
none: false
|
159
|
+
requirements:
|
160
|
+
- - ">="
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
hash: 3
|
163
|
+
segments:
|
164
|
+
- 0
|
165
|
+
version: "0"
|
166
|
+
type: :development
|
167
|
+
version_requirements: *id010
|
168
|
+
- !ruby/object:Gem::Dependency
|
169
|
+
name: simplecov
|
170
|
+
prerelease: false
|
171
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
172
|
+
none: false
|
173
|
+
requirements:
|
174
|
+
- - ">="
|
175
|
+
- !ruby/object:Gem::Version
|
176
|
+
hash: 3
|
177
|
+
segments:
|
178
|
+
- 0
|
179
|
+
version: "0"
|
180
|
+
type: :development
|
181
|
+
version_requirements: *id011
|
182
|
+
- !ruby/object:Gem::Dependency
|
183
|
+
name: sqlite3
|
184
|
+
prerelease: false
|
185
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
186
|
+
none: false
|
187
|
+
requirements:
|
188
|
+
- - ">="
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
hash: 3
|
191
|
+
segments:
|
192
|
+
- 0
|
193
|
+
version: "0"
|
194
|
+
type: :development
|
195
|
+
version_requirements: *id012
|
196
|
+
description: integrate with power reviews into spree, download review source and show reviews on product page
|
197
|
+
email: albertliu@naturalwellbeing.com
|
198
|
+
executables: []
|
199
|
+
|
200
|
+
extensions: []
|
201
|
+
|
202
|
+
extra_rdoc_files: []
|
203
|
+
|
204
|
+
files:
|
205
|
+
- .gitignore
|
206
|
+
- .rspec
|
207
|
+
- Gemfile
|
208
|
+
- LICENSE
|
209
|
+
- README.md
|
210
|
+
- Rakefile
|
211
|
+
- app/assets/javascripts/spree/backend/spree_power_reviews.js
|
212
|
+
- app/assets/javascripts/spree/frontend/spree_power_reviews.js
|
213
|
+
- app/assets/stylesheets/spree/backend/spree_power_reviews.css
|
214
|
+
- app/assets/stylesheets/spree/frontend/spree_power_reviews.css
|
215
|
+
- app/controllers/spree/products_controller_decorator.rb
|
216
|
+
- app/db/migrate/20150618105326_create_review_set.spree_power_reviews.rb
|
217
|
+
- app/db/seeds.rb
|
218
|
+
- app/models/spree/power_reviews_configuration.rb
|
219
|
+
- app/models/spree/review_set.rb
|
220
|
+
- app/overrides/add_power_reviews_js_to_product.rb
|
221
|
+
- app/overrides/add_power_reviews_snippet_to_product.rb
|
222
|
+
- app/overrides/add_power_reviews_to_product.rb
|
223
|
+
- app/overrides/add_qa_to_product.rb
|
224
|
+
- app/views/spree/products/question.html.erb
|
225
|
+
- app/views/spree/products/review.html.erb
|
226
|
+
- app/views/spree/shared/_powerreviews_engine_js.html.erb
|
227
|
+
- app/views/spree/shared/_powerreviews_product_qas.html.erb
|
228
|
+
- app/views/spree/shared/_powerreviews_product_qasnippet.html.erb
|
229
|
+
- app/views/spree/shared/_powerreviews_product_reviews.html.erb
|
230
|
+
- app/views/spree/shared/_powerreviews_product_snippet.html.erb
|
231
|
+
- bin/rails
|
232
|
+
- config/locales/en.yml
|
233
|
+
- config/power_reviews.yml
|
234
|
+
- config/routes.rb
|
235
|
+
- lib/generators/spree_power_reviews/install/install_generator.rb
|
236
|
+
- lib/spree_power_reviews.rb
|
237
|
+
- lib/spree_power_reviews/engine.rb
|
238
|
+
- lib/spree_power_reviews/factories.rb
|
239
|
+
- lib/tasks/power_reviews_extension_tasks.rake
|
240
|
+
- spec/spec_helper.rb
|
241
|
+
- spree_power_reviews.gemspec
|
242
|
+
has_rdoc: true
|
243
|
+
homepage: http://www.naturalwellbeing.com
|
244
|
+
licenses: []
|
245
|
+
|
246
|
+
post_install_message:
|
247
|
+
rdoc_options: []
|
248
|
+
|
249
|
+
require_paths:
|
250
|
+
- lib
|
251
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
252
|
+
none: false
|
253
|
+
requirements:
|
254
|
+
- - ">="
|
255
|
+
- !ruby/object:Gem::Version
|
256
|
+
hash: 53
|
257
|
+
segments:
|
258
|
+
- 1
|
259
|
+
- 9
|
260
|
+
- 3
|
261
|
+
version: 1.9.3
|
262
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
263
|
+
none: false
|
264
|
+
requirements:
|
265
|
+
- - ">="
|
266
|
+
- !ruby/object:Gem::Version
|
267
|
+
hash: 3
|
268
|
+
segments:
|
269
|
+
- 0
|
270
|
+
version: "0"
|
271
|
+
requirements:
|
272
|
+
- none
|
273
|
+
rubyforge_project:
|
274
|
+
rubygems_version: 1.5.2
|
275
|
+
signing_key:
|
276
|
+
specification_version: 3
|
277
|
+
summary: integrate with power reviews into spree, download review source and show reviews on product page
|
278
|
+
test_files:
|
279
|
+
- spec/spec_helper.rb
|