
13 changed files with 380 additions and 76 deletions
@ -0,0 +1,25 @@
|
||||
source 'http://rubygems.org' |
||||
|
||||
gem 'sqlite3' |
||||
|
||||
group :test do |
||||
gem 'autotest' |
||||
gem 'rspec-rails', '= 2.6.1' |
||||
gem 'factory_girl' |
||||
gem 'faker' |
||||
end |
||||
|
||||
group :cucumber do |
||||
gem 'cucumber-rails', '1.0.0' |
||||
gem 'database_cleaner', '= 0.6.7' |
||||
gem 'nokogiri' |
||||
gem 'capybara', '1.0.1' |
||||
end |
||||
|
||||
if RUBY_VERSION < "1.9" |
||||
gem "ruby-debug" |
||||
else |
||||
gem "ruby-debug19" |
||||
end |
||||
|
||||
gemspec |
@ -0,0 +1,243 @@
|
||||
PATH |
||||
remote: . |
||||
specs: |
||||
spree_logins (0.70.0) |
||||
spree_auth (>= 0.70.0) |
||||
spree_core (>= 0.70.0) |
||||
|
||||
GEM |
||||
remote: http://rubygems.org/ |
||||
specs: |
||||
ZenTest (4.6.2) |
||||
actionmailer (3.1.1) |
||||
actionpack (= 3.1.1) |
||||
mail (~> 2.3.0) |
||||
actionpack (3.1.1) |
||||
activemodel (= 3.1.1) |
||||
activesupport (= 3.1.1) |
||||
builder (~> 3.0.0) |
||||
erubis (~> 2.7.0) |
||||
i18n (~> 0.6) |
||||
rack (~> 1.3.2) |
||||
rack-cache (~> 1.1) |
||||
rack-mount (~> 0.8.2) |
||||
rack-test (~> 0.6.1) |
||||
sprockets (~> 2.0.2) |
||||
activemerchant (1.17.0) |
||||
activesupport (>= 2.3.11) |
||||
braintree (>= 2.0.0) |
||||
builder (>= 2.0.0) |
||||
json (>= 1.5.1) |
||||
activemodel (3.1.1) |
||||
activesupport (= 3.1.1) |
||||
builder (~> 3.0.0) |
||||
i18n (~> 0.6) |
||||
activerecord (3.1.1) |
||||
activemodel (= 3.1.1) |
||||
activesupport (= 3.1.1) |
||||
arel (~> 2.2.1) |
||||
tzinfo (~> 0.3.29) |
||||
activeresource (3.1.1) |
||||
activemodel (= 3.1.1) |
||||
activesupport (= 3.1.1) |
||||
activesupport (3.1.1) |
||||
multi_json (~> 1.0) |
||||
acts_as_list (0.1.4) |
||||
archive-tar-minitar (0.5.2) |
||||
arel (2.2.1) |
||||
autotest (4.4.6) |
||||
ZenTest (>= 4.4.1) |
||||
bcrypt-ruby (3.0.1) |
||||
braintree (2.12.0) |
||||
builder (>= 2.0.0) |
||||
builder (3.0.0) |
||||
cancan (1.6.5) |
||||
capybara (1.0.1) |
||||
mime-types (>= 1.16) |
||||
nokogiri (>= 1.3.3) |
||||
rack (>= 1.0.0) |
||||
rack-test (>= 0.5.4) |
||||
selenium-webdriver (~> 2.0) |
||||
xpath (~> 0.1.4) |
||||
childprocess (0.2.2) |
||||
ffi (~> 1.0.6) |
||||
cocaine (0.2.0) |
||||
columnize (0.3.4) |
||||
cucumber (1.0.6) |
||||
builder (>= 2.1.2) |
||||
diff-lcs (>= 1.1.2) |
||||
gherkin (~> 2.4.18) |
||||
json (>= 1.4.6) |
||||
term-ansicolor (>= 1.0.6) |
||||
cucumber-rails (1.0.0) |
||||
capybara (>= 1.0.0) |
||||
cucumber (~> 1.0.0) |
||||
nokogiri (>= 1.4.4) |
||||
rack-test (>= 0.5.7) |
||||
database_cleaner (0.6.7) |
||||
deface (0.7.0) |
||||
nokogiri (~> 1.5.0) |
||||
rails (>= 3.0.9) |
||||
devise (1.4.7) |
||||
bcrypt-ruby (~> 3.0) |
||||
orm_adapter (~> 0.0.3) |
||||
warden (~> 1.0.3) |
||||
diff-lcs (1.1.3) |
||||
erubis (2.7.0) |
||||
factory_girl (2.1.2) |
||||
activesupport |
||||
faker (1.0.0) |
||||
i18n (~> 0.4) |
||||
ffi (1.0.9) |
||||
gherkin (2.4.21) |
||||
json (>= 1.4.6) |
||||
highline (1.5.1) |
||||
hike (1.2.1) |
||||
i18n (0.6.0) |
||||
jquery-rails (1.0.14) |
||||
railties (~> 3.0) |
||||
thor (~> 0.14) |
||||
json (1.6.1) |
||||
json_pure (1.6.1) |
||||
kaminari (0.12.4) |
||||
rails (>= 3.0.0) |
||||
linecache19 (0.5.12) |
||||
ruby_core_source (>= 0.1.4) |
||||
mail (2.3.0) |
||||
i18n (>= 0.4.0) |
||||
mime-types (~> 1.16) |
||||
treetop (~> 1.4.8) |
||||
meta_search (1.1.1) |
||||
actionpack (~> 3.1.0) |
||||
activerecord (~> 3.1.0) |
||||
activesupport (~> 3.1.0) |
||||
polyamorous (~> 0.5.0) |
||||
mime-types (1.16) |
||||
multi_json (1.0.3) |
||||
nested_set (1.6.8) |
||||
activerecord (>= 3.0.0) |
||||
railties (>= 3.0.0) |
||||
nokogiri (1.5.0) |
||||
orm_adapter (0.0.5) |
||||
paperclip (2.4.1) |
||||
activerecord (>= 2.3.0) |
||||
activesupport (>= 2.3.2) |
||||
cocaine (>= 0.0.2) |
||||
mime-types |
||||
polyamorous (0.5.0) |
||||
activerecord (~> 3.0) |
||||
polyglot (0.3.2) |
||||
rack (1.3.4) |
||||
rack-cache (1.1) |
||||
rack (>= 0.4) |
||||
rack-mount (0.8.3) |
||||
rack (>= 1.0.0) |
||||
rack-ssl (1.3.2) |
||||
rack |
||||
rack-test (0.6.1) |
||||
rack (>= 1.0) |
||||
rails (3.1.1) |
||||
actionmailer (= 3.1.1) |
||||
actionpack (= 3.1.1) |
||||
activerecord (= 3.1.1) |
||||
activeresource (= 3.1.1) |
||||
activesupport (= 3.1.1) |
||||
bundler (~> 1.0) |
||||
railties (= 3.1.1) |
||||
railties (3.1.1) |
||||
actionpack (= 3.1.1) |
||||
activesupport (= 3.1.1) |
||||
rack-ssl (~> 1.3.2) |
||||
rake (>= 0.8.7) |
||||
rdoc (~> 3.4) |
||||
thor (~> 0.14.6) |
||||
rake (0.9.2) |
||||
rd_find_by_param (0.1.1) |
||||
activerecord (~> 3.0) |
||||
activesupport (~> 3.0) |
||||
rd_resource_controller (1.0.1) |
||||
rdoc (3.10) |
||||
json (~> 1.4) |
||||
rspec (2.6.0) |
||||
rspec-core (~> 2.6.0) |
||||
rspec-expectations (~> 2.6.0) |
||||
rspec-mocks (~> 2.6.0) |
||||
rspec-core (2.6.4) |
||||
rspec-expectations (2.6.0) |
||||
diff-lcs (~> 1.1.2) |
||||
rspec-mocks (2.6.0) |
||||
rspec-rails (2.6.1) |
||||
actionpack (~> 3.0) |
||||
activesupport (~> 3.0) |
||||
railties (~> 3.0) |
||||
rspec (~> 2.6.0) |
||||
ruby-debug-base19 (0.11.25) |
||||
columnize (>= 0.3.1) |
||||
linecache19 (>= 0.5.11) |
||||
ruby_core_source (>= 0.1.4) |
||||
ruby-debug19 (0.11.6) |
||||
columnize (>= 0.3.1) |
||||
linecache19 (>= 0.5.11) |
||||
ruby-debug-base19 (>= 0.11.19) |
||||
ruby_core_source (0.1.5) |
||||
archive-tar-minitar (>= 0.5.2) |
||||
rubyzip (0.9.4) |
||||
selenium-webdriver (2.8.0) |
||||
childprocess (>= 0.2.1) |
||||
ffi (>= 1.0.7) |
||||
json_pure |
||||
rubyzip |
||||
spree_auth (0.70.0) |
||||
cancan (= 1.6.5) |
||||
devise (= 1.4.7) |
||||
spree_core (= 0.70.0) |
||||
spree_core (0.70.0) |
||||
activemerchant (= 1.17.0) |
||||
acts_as_list (= 0.1.4) |
||||
deface (>= 0.6.1) |
||||
faker (= 1.0.0) |
||||
highline (= 1.5.1) |
||||
jquery-rails (>= 1.0.14) |
||||
kaminari (>= 0.12.4) |
||||
meta_search (= 1.1.1) |
||||
nested_set (= 1.6.8) |
||||
paperclip (= 2.4.1) |
||||
rails (= 3.1.1) |
||||
rd_find_by_param (= 0.1.1) |
||||
rd_resource_controller |
||||
state_machine (= 1.0.1) |
||||
stringex (= 1.0.3) |
||||
sprockets (2.0.2) |
||||
hike (~> 1.2) |
||||
rack (~> 1.0) |
||||
tilt (!= 1.3.0, ~> 1.1) |
||||
sqlite3 (1.3.4) |
||||
state_machine (1.0.1) |
||||
stringex (1.0.3) |
||||
term-ansicolor (1.0.6) |
||||
thor (0.14.6) |
||||
tilt (1.3.3) |
||||
treetop (1.4.10) |
||||
polyglot |
||||
polyglot (>= 0.3.1) |
||||
tzinfo (0.3.30) |
||||
warden (1.0.6) |
||||
rack (>= 1.0) |
||||
xpath (0.1.4) |
||||
nokogiri (~> 1.3) |
||||
|
||||
PLATFORMS |
||||
ruby |
||||
|
||||
DEPENDENCIES |
||||
autotest |
||||
capybara (= 1.0.1) |
||||
cucumber-rails (= 1.0.0) |
||||
database_cleaner (= 0.6.7) |
||||
factory_girl |
||||
faker |
||||
nokogiri |
||||
rspec-rails (= 2.6.1) |
||||
ruby-debug19 |
||||
spree_logins! |
||||
sqlite3 |
@ -1,37 +1,3 @@
|
||||
require 'spree_core' |
||||
require 'spree_sitemap_generator_hooks' |
||||
require 'sitemap_generator' |
||||
|
||||
module SpreeSitemapGenerator |
||||
class Engine < Rails::Engine |
||||
|
||||
config.autoload_paths += %W(#{config.root}/lib) |
||||
|
||||
def self.activate |
||||
|
||||
ActiveRecord::Relation.class_eval do |
||||
def last_updated |
||||
last_update = order('updated_at DESC').first |
||||
last_update.try(:updated_at) |
||||
end |
||||
end |
||||
|
||||
ActiveRecord::Base.class_eval do |
||||
def self.last_updated |
||||
scoped.last_updated |
||||
end |
||||
end |
||||
|
||||
SitemapGenerator::Sitemap.default_host = "http://#{Spree::Config[:site_url]}" |
||||
|
||||
require 'spree_sitemap_generator/spree_defaults' |
||||
SitemapGenerator::Interpreter.send :include, SpreeSitemapGenerator::SpreeDefaults |
||||
|
||||
Dir.glob(File.join(File.dirname(__FILE__), "../app/**/*_decorator*.rb")) do |c| |
||||
Rails.env.production? ? require(c) : load(c) |
||||
end |
||||
end |
||||
|
||||
config.to_prepare &method(:activate).to_proc |
||||
end |
||||
end |
||||
require 'spree_sitemap_generator/engine' |
||||
|
@ -0,0 +1,40 @@
|
||||
module SpreeSitemapGenerator |
||||
class Engine < Rails::Engine |
||||
engine_name 'spree_sitemap_generator' |
||||
|
||||
config.autoload_paths += %W(#{config.root}/lib) |
||||
|
||||
# use rspec for tests |
||||
config.generators do |g| |
||||
g.test_framework :rspec |
||||
end |
||||
|
||||
def self.activate |
||||
ActiveRecord::Relation.class_eval do |
||||
def last_updated |
||||
last_update = order('updated_at DESC').first |
||||
last_update.try(:updated_at) |
||||
end |
||||
end |
||||
|
||||
ActiveRecord::Base.class_eval do |
||||
def self.last_updated |
||||
scoped.last_updated |
||||
end |
||||
end |
||||
|
||||
require 'spree_sitemap_generator/spree_defaults' |
||||
SitemapGenerator::Interpreter.send :include, SpreeSitemapGenerator::SpreeDefaults |
||||
|
||||
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 |
@ -1,3 +0,0 @@
|
||||
class SpreeSitemapGeneratorHooks < Spree::ThemeSupport::HookListener |
||||
# custom hooks go here |
||||
end |
Binary file not shown.
Loading…
Reference in new issue