spree_product_feed 0.70.0
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.
- data/.gitignore +10 -0
- data/.rspec +1 -0
- data/Gemfile +25 -0
- data/Gemfile.lock +229 -0
- data/LICENSE +26 -0
- data/README.md +38 -0
- data/Rakefile +31 -0
- data/Versionfile +10 -0
- data/app/assets/javascripts/admin/spree_product_feed.js +1 -0
- data/app/assets/javascripts/store/spree_product_feed.js +1 -0
- data/app/assets/stylesheets/admin/spree_product_feed.css +3 -0
- data/app/assets/stylesheets/store/spree_product_feed.css +3 -0
- data/app/controllers/products_controller_decorator.rb +5 -0
- data/app/overrides/rss_link.rb +4 -0
- data/app/views/products/index.rss.builder +27 -0
- data/config/routes.rb +3 -0
- data/lib/generators/spree_product_feed/install/install_generator.rb +29 -0
- data/lib/spree_product_feed.rb +2 -0
- data/lib/spree_product_feed/engine.rb +24 -0
- data/script/rails +7 -0
- data/spec/controllers/products_controller_spec.rb +10 -0
- data/spec/spec_helper.rb +29 -0
- data/spree_product_feed.gemspec +21 -0
- metadata +91 -0
data/.gitignore
ADDED
data/.rspec
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
--colour
|
data/Gemfile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
source 'http://rubygems.org'
|
|
2
|
+
|
|
3
|
+
gem 'sqlite3'
|
|
4
|
+
|
|
5
|
+
group :test do
|
|
6
|
+
gem 'autotest'
|
|
7
|
+
gem 'rspec-rails', '= 2.6.1'
|
|
8
|
+
gem 'factory_girl'
|
|
9
|
+
gem 'faker'
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
group :cucumber do
|
|
13
|
+
gem 'cucumber-rails', '1.0.0'
|
|
14
|
+
gem 'database_cleaner', '= 0.6.7'
|
|
15
|
+
gem 'nokogiri'
|
|
16
|
+
gem 'capybara', '1.0.1'
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
if RUBY_VERSION < "1.9"
|
|
20
|
+
gem "ruby-debug"
|
|
21
|
+
else
|
|
22
|
+
gem "ruby-debug19"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
gemspec
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
spree_product_feed (0.70.0)
|
|
5
|
+
spree_core (>= 0.70.0)
|
|
6
|
+
|
|
7
|
+
GEM
|
|
8
|
+
remote: http://rubygems.org/
|
|
9
|
+
specs:
|
|
10
|
+
ZenTest (4.6.2)
|
|
11
|
+
actionmailer (3.1.1)
|
|
12
|
+
actionpack (= 3.1.1)
|
|
13
|
+
mail (~> 2.3.0)
|
|
14
|
+
actionpack (3.1.1)
|
|
15
|
+
activemodel (= 3.1.1)
|
|
16
|
+
activesupport (= 3.1.1)
|
|
17
|
+
builder (~> 3.0.0)
|
|
18
|
+
erubis (~> 2.7.0)
|
|
19
|
+
i18n (~> 0.6)
|
|
20
|
+
rack (~> 1.3.2)
|
|
21
|
+
rack-cache (~> 1.1)
|
|
22
|
+
rack-mount (~> 0.8.2)
|
|
23
|
+
rack-test (~> 0.6.1)
|
|
24
|
+
sprockets (~> 2.0.2)
|
|
25
|
+
activemerchant (1.17.0)
|
|
26
|
+
activesupport (>= 2.3.11)
|
|
27
|
+
braintree (>= 2.0.0)
|
|
28
|
+
builder (>= 2.0.0)
|
|
29
|
+
json (>= 1.5.1)
|
|
30
|
+
activemodel (3.1.1)
|
|
31
|
+
activesupport (= 3.1.1)
|
|
32
|
+
builder (~> 3.0.0)
|
|
33
|
+
i18n (~> 0.6)
|
|
34
|
+
activerecord (3.1.1)
|
|
35
|
+
activemodel (= 3.1.1)
|
|
36
|
+
activesupport (= 3.1.1)
|
|
37
|
+
arel (~> 2.2.1)
|
|
38
|
+
tzinfo (~> 0.3.29)
|
|
39
|
+
activeresource (3.1.1)
|
|
40
|
+
activemodel (= 3.1.1)
|
|
41
|
+
activesupport (= 3.1.1)
|
|
42
|
+
activesupport (3.1.1)
|
|
43
|
+
multi_json (~> 1.0)
|
|
44
|
+
acts_as_list (0.1.4)
|
|
45
|
+
archive-tar-minitar (0.5.2)
|
|
46
|
+
arel (2.2.1)
|
|
47
|
+
autotest (4.4.6)
|
|
48
|
+
ZenTest (>= 4.4.1)
|
|
49
|
+
braintree (2.12.0)
|
|
50
|
+
builder (>= 2.0.0)
|
|
51
|
+
builder (3.0.0)
|
|
52
|
+
capybara (1.0.1)
|
|
53
|
+
mime-types (>= 1.16)
|
|
54
|
+
nokogiri (>= 1.3.3)
|
|
55
|
+
rack (>= 1.0.0)
|
|
56
|
+
rack-test (>= 0.5.4)
|
|
57
|
+
selenium-webdriver (~> 2.0)
|
|
58
|
+
xpath (~> 0.1.4)
|
|
59
|
+
childprocess (0.2.2)
|
|
60
|
+
ffi (~> 1.0.6)
|
|
61
|
+
cocaine (0.2.0)
|
|
62
|
+
columnize (0.3.4)
|
|
63
|
+
cucumber (1.0.6)
|
|
64
|
+
builder (>= 2.1.2)
|
|
65
|
+
diff-lcs (>= 1.1.2)
|
|
66
|
+
gherkin (~> 2.4.18)
|
|
67
|
+
json (>= 1.4.6)
|
|
68
|
+
term-ansicolor (>= 1.0.6)
|
|
69
|
+
cucumber-rails (1.0.0)
|
|
70
|
+
capybara (>= 1.0.0)
|
|
71
|
+
cucumber (~> 1.0.0)
|
|
72
|
+
nokogiri (>= 1.4.4)
|
|
73
|
+
rack-test (>= 0.5.7)
|
|
74
|
+
database_cleaner (0.6.7)
|
|
75
|
+
deface (0.7.0)
|
|
76
|
+
nokogiri (~> 1.5.0)
|
|
77
|
+
rails (>= 3.0.9)
|
|
78
|
+
diff-lcs (1.1.3)
|
|
79
|
+
erubis (2.7.0)
|
|
80
|
+
factory_girl (2.2.0)
|
|
81
|
+
activesupport
|
|
82
|
+
faker (1.0.0)
|
|
83
|
+
i18n (~> 0.4)
|
|
84
|
+
ffi (1.0.9)
|
|
85
|
+
gherkin (2.4.21)
|
|
86
|
+
json (>= 1.4.6)
|
|
87
|
+
highline (1.5.1)
|
|
88
|
+
hike (1.2.1)
|
|
89
|
+
i18n (0.6.0)
|
|
90
|
+
jquery-rails (1.0.16)
|
|
91
|
+
railties (~> 3.0)
|
|
92
|
+
thor (~> 0.14)
|
|
93
|
+
json (1.6.1)
|
|
94
|
+
json_pure (1.6.1)
|
|
95
|
+
kaminari (0.12.4)
|
|
96
|
+
rails (>= 3.0.0)
|
|
97
|
+
linecache19 (0.5.12)
|
|
98
|
+
ruby_core_source (>= 0.1.4)
|
|
99
|
+
mail (2.3.0)
|
|
100
|
+
i18n (>= 0.4.0)
|
|
101
|
+
mime-types (~> 1.16)
|
|
102
|
+
treetop (~> 1.4.8)
|
|
103
|
+
meta_search (1.1.1)
|
|
104
|
+
actionpack (~> 3.1.0)
|
|
105
|
+
activerecord (~> 3.1.0)
|
|
106
|
+
activesupport (~> 3.1.0)
|
|
107
|
+
polyamorous (~> 0.5.0)
|
|
108
|
+
mime-types (1.16)
|
|
109
|
+
multi_json (1.0.3)
|
|
110
|
+
nested_set (1.6.8)
|
|
111
|
+
activerecord (>= 3.0.0)
|
|
112
|
+
railties (>= 3.0.0)
|
|
113
|
+
nokogiri (1.5.0)
|
|
114
|
+
paperclip (2.4.1)
|
|
115
|
+
activerecord (>= 2.3.0)
|
|
116
|
+
activesupport (>= 2.3.2)
|
|
117
|
+
cocaine (>= 0.0.2)
|
|
118
|
+
mime-types
|
|
119
|
+
polyamorous (0.5.0)
|
|
120
|
+
activerecord (~> 3.0)
|
|
121
|
+
polyglot (0.3.2)
|
|
122
|
+
rack (1.3.4)
|
|
123
|
+
rack-cache (1.1)
|
|
124
|
+
rack (>= 0.4)
|
|
125
|
+
rack-mount (0.8.3)
|
|
126
|
+
rack (>= 1.0.0)
|
|
127
|
+
rack-ssl (1.3.2)
|
|
128
|
+
rack
|
|
129
|
+
rack-test (0.6.1)
|
|
130
|
+
rack (>= 1.0)
|
|
131
|
+
rails (3.1.1)
|
|
132
|
+
actionmailer (= 3.1.1)
|
|
133
|
+
actionpack (= 3.1.1)
|
|
134
|
+
activerecord (= 3.1.1)
|
|
135
|
+
activeresource (= 3.1.1)
|
|
136
|
+
activesupport (= 3.1.1)
|
|
137
|
+
bundler (~> 1.0)
|
|
138
|
+
railties (= 3.1.1)
|
|
139
|
+
railties (3.1.1)
|
|
140
|
+
actionpack (= 3.1.1)
|
|
141
|
+
activesupport (= 3.1.1)
|
|
142
|
+
rack-ssl (~> 1.3.2)
|
|
143
|
+
rake (>= 0.8.7)
|
|
144
|
+
rdoc (~> 3.4)
|
|
145
|
+
thor (~> 0.14.6)
|
|
146
|
+
rake (0.9.2)
|
|
147
|
+
rd_find_by_param (0.1.1)
|
|
148
|
+
activerecord (~> 3.0)
|
|
149
|
+
activesupport (~> 3.0)
|
|
150
|
+
rd_resource_controller (1.0.1)
|
|
151
|
+
rdoc (3.10)
|
|
152
|
+
json (~> 1.4)
|
|
153
|
+
rspec (2.6.0)
|
|
154
|
+
rspec-core (~> 2.6.0)
|
|
155
|
+
rspec-expectations (~> 2.6.0)
|
|
156
|
+
rspec-mocks (~> 2.6.0)
|
|
157
|
+
rspec-core (2.6.4)
|
|
158
|
+
rspec-expectations (2.6.0)
|
|
159
|
+
diff-lcs (~> 1.1.2)
|
|
160
|
+
rspec-mocks (2.6.0)
|
|
161
|
+
rspec-rails (2.6.1)
|
|
162
|
+
actionpack (~> 3.0)
|
|
163
|
+
activesupport (~> 3.0)
|
|
164
|
+
railties (~> 3.0)
|
|
165
|
+
rspec (~> 2.6.0)
|
|
166
|
+
ruby-debug-base19 (0.11.25)
|
|
167
|
+
columnize (>= 0.3.1)
|
|
168
|
+
linecache19 (>= 0.5.11)
|
|
169
|
+
ruby_core_source (>= 0.1.4)
|
|
170
|
+
ruby-debug19 (0.11.6)
|
|
171
|
+
columnize (>= 0.3.1)
|
|
172
|
+
linecache19 (>= 0.5.11)
|
|
173
|
+
ruby-debug-base19 (>= 0.11.19)
|
|
174
|
+
ruby_core_source (0.1.5)
|
|
175
|
+
archive-tar-minitar (>= 0.5.2)
|
|
176
|
+
rubyzip (0.9.4)
|
|
177
|
+
selenium-webdriver (2.8.0)
|
|
178
|
+
childprocess (>= 0.2.1)
|
|
179
|
+
ffi (>= 1.0.7)
|
|
180
|
+
json_pure
|
|
181
|
+
rubyzip
|
|
182
|
+
spree_core (0.70.0)
|
|
183
|
+
activemerchant (= 1.17.0)
|
|
184
|
+
acts_as_list (= 0.1.4)
|
|
185
|
+
deface (>= 0.6.1)
|
|
186
|
+
faker (= 1.0.0)
|
|
187
|
+
highline (= 1.5.1)
|
|
188
|
+
jquery-rails (>= 1.0.14)
|
|
189
|
+
kaminari (>= 0.12.4)
|
|
190
|
+
meta_search (= 1.1.1)
|
|
191
|
+
nested_set (= 1.6.8)
|
|
192
|
+
paperclip (= 2.4.1)
|
|
193
|
+
rails (= 3.1.1)
|
|
194
|
+
rd_find_by_param (= 0.1.1)
|
|
195
|
+
rd_resource_controller
|
|
196
|
+
state_machine (= 1.0.1)
|
|
197
|
+
stringex (= 1.0.3)
|
|
198
|
+
sprockets (2.0.3)
|
|
199
|
+
hike (~> 1.2)
|
|
200
|
+
rack (~> 1.0)
|
|
201
|
+
tilt (~> 1.1, != 1.3.0)
|
|
202
|
+
sqlite3 (1.3.4)
|
|
203
|
+
state_machine (1.0.1)
|
|
204
|
+
stringex (1.0.3)
|
|
205
|
+
term-ansicolor (1.0.7)
|
|
206
|
+
thor (0.14.6)
|
|
207
|
+
tilt (1.3.3)
|
|
208
|
+
treetop (1.4.10)
|
|
209
|
+
polyglot
|
|
210
|
+
polyglot (>= 0.3.1)
|
|
211
|
+
tzinfo (0.3.30)
|
|
212
|
+
xpath (0.1.4)
|
|
213
|
+
nokogiri (~> 1.3)
|
|
214
|
+
|
|
215
|
+
PLATFORMS
|
|
216
|
+
ruby
|
|
217
|
+
|
|
218
|
+
DEPENDENCIES
|
|
219
|
+
autotest
|
|
220
|
+
capybara (= 1.0.1)
|
|
221
|
+
cucumber-rails (= 1.0.0)
|
|
222
|
+
database_cleaner (= 0.6.7)
|
|
223
|
+
factory_girl
|
|
224
|
+
faker
|
|
225
|
+
nokogiri
|
|
226
|
+
rspec-rails (= 2.6.1)
|
|
227
|
+
ruby-debug19
|
|
228
|
+
spree_product_feed!
|
|
229
|
+
sqlite3
|
data/LICENSE
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
Copyright (c) 2011 [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,38 @@
|
|
|
1
|
+
Spree Product Feed
|
|
2
|
+
================
|
|
3
|
+
|
|
4
|
+
An extension that provides an RSS feed for products. Google Shopper attributes are also implemented.
|
|
5
|
+
An RSS link is automatically appended to the `<head>` tag in the `layouts/spree_application` file.
|
|
6
|
+
|
|
7
|
+
Supported versions of Spree
|
|
8
|
+
=========
|
|
9
|
+
|
|
10
|
+
any version of Spree higher than 0.70.x
|
|
11
|
+
|
|
12
|
+
Installation
|
|
13
|
+
===============
|
|
14
|
+
|
|
15
|
+
1) add the gem to your `Gemfile`:
|
|
16
|
+
|
|
17
|
+
`gem 'spree_product_feed'`
|
|
18
|
+
|
|
19
|
+
2) run bundler:
|
|
20
|
+
|
|
21
|
+
`bundle install`
|
|
22
|
+
|
|
23
|
+
3) BOOOM, you're done
|
|
24
|
+
|
|
25
|
+
Viewing Product RSS
|
|
26
|
+
============
|
|
27
|
+
|
|
28
|
+
`http://yourdomain.tld/products.rss`
|
|
29
|
+
|
|
30
|
+
Testing
|
|
31
|
+
=======
|
|
32
|
+
|
|
33
|
+
Be sure to add the rspec-rails gem to your Gemfile and then create a dummy test app for the specs to run against.
|
|
34
|
+
|
|
35
|
+
$ bundle exec rake test app
|
|
36
|
+
$ bundle exec rspec spec
|
|
37
|
+
|
|
38
|
+
Copyright (c) 2011 Joshua Nussbaum, released under the New BSD License
|
data/Rakefile
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
require 'rake'
|
|
2
|
+
require 'rake/testtask'
|
|
3
|
+
require 'rake/packagetask'
|
|
4
|
+
require 'rubygems/package_task'
|
|
5
|
+
require 'rspec/core/rake_task'
|
|
6
|
+
require 'cucumber/rake/task'
|
|
7
|
+
require 'spree_core/testing_support/common_rake'
|
|
8
|
+
|
|
9
|
+
RSpec::Core::RakeTask.new
|
|
10
|
+
Cucumber::Rake::Task.new
|
|
11
|
+
|
|
12
|
+
task :default => [:spec, :cucumber ]
|
|
13
|
+
|
|
14
|
+
spec = eval(File.read('spree_product_feed.gemspec'))
|
|
15
|
+
|
|
16
|
+
Gem::PackageTask.new(spec) do |p|
|
|
17
|
+
p.gem_spec = spec
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
desc "Release to gemcutter"
|
|
21
|
+
task :release => :package do
|
|
22
|
+
require 'rake/gemcutter'
|
|
23
|
+
Rake::Gemcutter::Tasks.new(spec).define
|
|
24
|
+
Rake::Task['gem:push'].invoke
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
desc "Generates a dummy app for testing"
|
|
28
|
+
task :test_app do
|
|
29
|
+
ENV['LIB_NAME'] = 'spree_product_feed'
|
|
30
|
+
Rake::Task['common:test_app'].invoke
|
|
31
|
+
end
|
data/Versionfile
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# This file is used to designate compatibilty with different versions of Spree
|
|
2
|
+
# Please see http://spreecommerce.com/documentation/extensions.html#versionfile for details
|
|
3
|
+
|
|
4
|
+
# Examples
|
|
5
|
+
#
|
|
6
|
+
# "0.70.x" => { :branch => "master"}
|
|
7
|
+
# "0.60.x" => { :branch => "0-60-stable" }
|
|
8
|
+
# "0.40.x" => { :tag => "v1.0.0", :version => "1.0.0" }
|
|
9
|
+
|
|
10
|
+
"0.70.x" => { :branch => "master"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//= require admin/spree_core
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//= require store/spree_core
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
Deface::Override.new(:virtual_path => 'layouts/spree_application',
|
|
2
|
+
:name => 'product_rss_link',
|
|
3
|
+
:insert_bottom => "[data-hook='inside_head']",
|
|
4
|
+
:text => '<%= auto_discovery_link_tag(:rss, products_path(:format => :rss), {:title => "#{Spree::Config[:site_title]} Products"}) %>')
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
xml.instruct! :xml, :version=>"1.0"
|
|
2
|
+
xml.rss(:version=>"2.0", "xmlns:g" => "http://base.google.com/ns/1.0"){
|
|
3
|
+
xml.channel{
|
|
4
|
+
xml.title("#{Spree::Config[:site_name]}")
|
|
5
|
+
xml.link("http://#{Spree::Config[:site_url]}")
|
|
6
|
+
xml.description("Find out about new products first! You'll always be in the know when new products become available")
|
|
7
|
+
xml.language('en-us')
|
|
8
|
+
@products.each do |product|
|
|
9
|
+
xml.item do
|
|
10
|
+
xml.title(product.name)
|
|
11
|
+
xml.description((product.images.count > 0 ? link_to(image_tag(product.images.first.attachment.url(:product)), product_url(product)) : '') + simple_format(product.description))
|
|
12
|
+
xml.author(Spree::Config[:site_url])
|
|
13
|
+
xml.pubDate((product.available_on || product.created_at).strftime("%a, %d %b %Y %H:%M:%S %z"))
|
|
14
|
+
xml.link(product_url(product))
|
|
15
|
+
xml.guid(product.id)
|
|
16
|
+
|
|
17
|
+
if product.images.count > 0
|
|
18
|
+
xml.tag!('g:image_link', product.images.first.attachment.url(:large))
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
xml.tag!('g:price', product.price)
|
|
22
|
+
xml.tag!('g:condition', 'retail')
|
|
23
|
+
xml.tag!('g:id', product.id)
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
}
|
|
27
|
+
}
|
data/config/routes.rb
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
module SpreeProductFeed
|
|
2
|
+
module Generators
|
|
3
|
+
class InstallGenerator < Rails::Generators::Base
|
|
4
|
+
|
|
5
|
+
def add_javascripts
|
|
6
|
+
append_file "app/assets/javascripts/store/all.js", "//= require store/spree_product_feed\n"
|
|
7
|
+
append_file "app/assets/javascripts/admin/all.js", "//= require admin/spree_product_feed\n"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def add_stylesheets
|
|
11
|
+
inject_into_file "app/assets/stylesheets/store/all.css", " *= require store/spree_product_feed\n", :before => /\*\//, :verbose => true
|
|
12
|
+
inject_into_file "app/assets/stylesheets/admin/all.css", " *= require admin/spree_product_feed\n", :before => /\*\//, :verbose => true
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def add_migrations
|
|
16
|
+
run 'bundle exec rake railties:install:migrations FROM=spree_product_feed'
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def run_migrations
|
|
20
|
+
res = ask "Would you like to run the migrations now? [Y/n]"
|
|
21
|
+
if res == "" || res.downcase == "y"
|
|
22
|
+
run 'bundle exec rake db:migrate'
|
|
23
|
+
else
|
|
24
|
+
puts "Skiping rake db:migrate, don't forget to run it!"
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module SpreeProductFeed
|
|
2
|
+
class Engine < Rails::Engine
|
|
3
|
+
engine_name 'spree_product_feed'
|
|
4
|
+
|
|
5
|
+
config.autoload_paths += %W(#{config.root}/lib)
|
|
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.application.config.cache_classes ? require(c) : load(c)
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
Dir.glob(File.join(File.dirname(__FILE__), "../../app/overrides/*.rb")) do |c|
|
|
18
|
+
Rails.application.config.cache_classes ? require(c) : load(c)
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
config.to_prepare &method(:activate).to_proc
|
|
23
|
+
end
|
|
24
|
+
end
|
data/script/rails
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
ENGINE_PATH = File.expand_path('../..', __FILE__)
|
|
6
|
+
load File.expand_path('../../spec/dummy/script/rails', __FILE__)
|
|
7
|
+
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Configure Rails Environment
|
|
2
|
+
ENV["RAILS_ENV"] = "test"
|
|
3
|
+
require File.expand_path("../dummy/config/environment.rb", __FILE__)
|
|
4
|
+
require 'rspec/rails'
|
|
5
|
+
|
|
6
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
|
7
|
+
# in spec/support/ and its subdirectories.
|
|
8
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
|
9
|
+
|
|
10
|
+
require 'spree_core/testing_support/factories'
|
|
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
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
|
23
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
|
24
|
+
|
|
25
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
|
26
|
+
# examples within a transaction, remove the following line or assign false
|
|
27
|
+
# instead of true.
|
|
28
|
+
config.use_transactional_fixtures = true
|
|
29
|
+
end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
Gem::Specification.new do |s|
|
|
3
|
+
s.platform = Gem::Platform::RUBY
|
|
4
|
+
s.name = 'spree_product_feed'
|
|
5
|
+
s.version = '0.70.0'
|
|
6
|
+
s.summary = 'Spree extension that provides an RSS feed for products'
|
|
7
|
+
s.description = 'A Spree extension that provides an RSS feed for products, with Google Shopper extensions'
|
|
8
|
+
s.required_ruby_version = '>= 1.8.7'
|
|
9
|
+
|
|
10
|
+
s.author = 'Joshua Nussbaum'
|
|
11
|
+
s.email = 'joshnuss@gmail.com'
|
|
12
|
+
|
|
13
|
+
s.files = `git ls-files`.split("\n")
|
|
14
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
15
|
+
s.require_path = 'lib'
|
|
16
|
+
s.requirements << 'none'
|
|
17
|
+
|
|
18
|
+
s.add_dependency 'spree_core', '>= 0.70.0'
|
|
19
|
+
s.add_development_dependency 'rspec-rails'
|
|
20
|
+
end
|
|
21
|
+
|
metadata
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: spree_product_feed
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.70.0
|
|
5
|
+
prerelease:
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- Joshua Nussbaum
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
date: 2011-10-24 00:00:00.000000000Z
|
|
13
|
+
dependencies:
|
|
14
|
+
- !ruby/object:Gem::Dependency
|
|
15
|
+
name: spree_core
|
|
16
|
+
requirement: &82819850 !ruby/object:Gem::Requirement
|
|
17
|
+
none: false
|
|
18
|
+
requirements:
|
|
19
|
+
- - ! '>='
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: 0.70.0
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: *82819850
|
|
25
|
+
- !ruby/object:Gem::Dependency
|
|
26
|
+
name: rspec-rails
|
|
27
|
+
requirement: &82819470 !ruby/object:Gem::Requirement
|
|
28
|
+
none: false
|
|
29
|
+
requirements:
|
|
30
|
+
- - ! '>='
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :development
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: *82819470
|
|
36
|
+
description: A Spree extension that provides an RSS feed for products, with Google
|
|
37
|
+
Shopper extensions
|
|
38
|
+
email: joshnuss@gmail.com
|
|
39
|
+
executables: []
|
|
40
|
+
extensions: []
|
|
41
|
+
extra_rdoc_files: []
|
|
42
|
+
files:
|
|
43
|
+
- .gitignore
|
|
44
|
+
- .rspec
|
|
45
|
+
- Gemfile
|
|
46
|
+
- Gemfile.lock
|
|
47
|
+
- LICENSE
|
|
48
|
+
- README.md
|
|
49
|
+
- Rakefile
|
|
50
|
+
- Versionfile
|
|
51
|
+
- app/assets/javascripts/admin/spree_product_feed.js
|
|
52
|
+
- app/assets/javascripts/store/spree_product_feed.js
|
|
53
|
+
- app/assets/stylesheets/admin/spree_product_feed.css
|
|
54
|
+
- app/assets/stylesheets/store/spree_product_feed.css
|
|
55
|
+
- app/controllers/products_controller_decorator.rb
|
|
56
|
+
- app/overrides/rss_link.rb
|
|
57
|
+
- app/views/products/index.rss.builder
|
|
58
|
+
- config/routes.rb
|
|
59
|
+
- lib/generators/spree_product_feed/install/install_generator.rb
|
|
60
|
+
- lib/spree_product_feed.rb
|
|
61
|
+
- lib/spree_product_feed/engine.rb
|
|
62
|
+
- script/rails
|
|
63
|
+
- spec/controllers/products_controller_spec.rb
|
|
64
|
+
- spec/spec_helper.rb
|
|
65
|
+
- spree_product_feed.gemspec
|
|
66
|
+
homepage:
|
|
67
|
+
licenses: []
|
|
68
|
+
post_install_message:
|
|
69
|
+
rdoc_options: []
|
|
70
|
+
require_paths:
|
|
71
|
+
- lib
|
|
72
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
73
|
+
none: false
|
|
74
|
+
requirements:
|
|
75
|
+
- - ! '>='
|
|
76
|
+
- !ruby/object:Gem::Version
|
|
77
|
+
version: 1.8.7
|
|
78
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
|
+
none: false
|
|
80
|
+
requirements:
|
|
81
|
+
- - ! '>='
|
|
82
|
+
- !ruby/object:Gem::Version
|
|
83
|
+
version: '0'
|
|
84
|
+
requirements:
|
|
85
|
+
- none
|
|
86
|
+
rubyforge_project:
|
|
87
|
+
rubygems_version: 1.8.6
|
|
88
|
+
signing_key:
|
|
89
|
+
specification_version: 3
|
|
90
|
+
summary: Spree extension that provides an RSS feed for products
|
|
91
|
+
test_files: []
|