From 1e9cde0b7da20e6eff13ccef7fc0882c553a3dc8 Mon Sep 17 00:00:00 2001 From: Ryan Siddle Date: Sun, 8 Jul 2012 12:53:21 +0100 Subject: [PATCH 01/14] Upgrade to work with Spree 1.1.0 --- lib/spree_sitemap_generator/spree_defaults.rb | 4 ++++ spree_sitemap_generator.gemspec | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/spree_sitemap_generator/spree_defaults.rb b/lib/spree_sitemap_generator/spree_defaults.rb index d2e13c0..fcdce8a 100644 --- a/lib/spree_sitemap_generator/spree_defaults.rb +++ b/lib/spree_sitemap_generator/spree_defaults.rb @@ -1,4 +1,8 @@ module SpreeSitemapGenerator::SpreeDefaults + include ActionView::Helpers + include ActionDispatch::Routing + include Spree::Core::Engine.routes.url_helpers + def default_url_options {:host => SitemapGenerator::Sitemap.default_host} end diff --git a/spree_sitemap_generator.gemspec b/spree_sitemap_generator.gemspec index 1283221..8ff295d 100644 --- a/spree_sitemap_generator.gemspec +++ b/spree_sitemap_generator.gemspec @@ -1,7 +1,7 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = 'spree_sitemap_generator' - s.version = '3.0.3' + s.version = '1.1.0' s.summary = 'Provides a sitemap file for Spree' #s.description = 'Add (optional) gem description here' s.required_ruby_version = '>= 1.8.7' @@ -15,6 +15,6 @@ Gem::Specification.new do |s| s.require_path = 'lib' s.requirements << 'none' - s.add_dependency('spree_core', '>= 0.70.0') - s.add_dependency('sitemap_generator', '>= 2.0.1') + s.add_dependency('spree_core', '>= 1.1.0') + s.add_dependency('sitemap_generator', '~> 3.1.0') end From 16bb63a8f99ee89f111f2bea8f56e48d8d518200 Mon Sep 17 00:00:00 2001 From: Ryan Siddle Date: Sun, 8 Jul 2012 12:59:28 +0100 Subject: [PATCH 02/14] Update sitemap.rb generator --- lib/generators/templates/config/sitemap.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/generators/templates/config/sitemap.rb b/lib/generators/templates/config/sitemap.rb index 17be832..9c7ecdc 100644 --- a/lib/generators/templates/config/sitemap.rb +++ b/lib/generators/templates/config/sitemap.rb @@ -24,10 +24,10 @@ # Article.find_each do |article| # sitemap.add article_path(article), :lastmod => article.updated_at # end - sitemap.add_login - sitemap.add_signup - sitemap.add_account - sitemap.add_password_reset - sitemap.add_taxons - sitemap.add_products + sitemap.add add_login + sitemap.add add_signup + sitemap.add add_account + sitemap.add add_password_reset + sitemap.add add_taxons + sitemap.add add_sproducts end From 036b8b3affc7dd3d3a7117bf076c39e256c4cc29 Mon Sep 17 00:00:00 2001 From: Marcelo Diniz Date: Mon, 9 Jul 2012 19:37:55 +0200 Subject: [PATCH 03/14] Make it work on spree 1.1.2 --- lib/generators/templates/config/sitemap.rb | 2 +- lib/spree_sitemap_generator/spree_defaults.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/generators/templates/config/sitemap.rb b/lib/generators/templates/config/sitemap.rb index 9c7ecdc..f48ff36 100644 --- a/lib/generators/templates/config/sitemap.rb +++ b/lib/generators/templates/config/sitemap.rb @@ -29,5 +29,5 @@ sitemap.add add_account sitemap.add add_password_reset sitemap.add add_taxons - sitemap.add add_sproducts + sitemap.add add_products end diff --git a/lib/spree_sitemap_generator/spree_defaults.rb b/lib/spree_sitemap_generator/spree_defaults.rb index fcdce8a..7072056 100644 --- a/lib/spree_sitemap_generator/spree_defaults.rb +++ b/lib/spree_sitemap_generator/spree_defaults.rb @@ -25,7 +25,7 @@ def add_password_reset(options={}) end def add_products(options={}) - active_products = Product.active + active_products = Spree::Product.active add(products_path, options.merge(:lastmod => active_products.last_updated)) active_products.each do |product| @@ -34,7 +34,7 @@ def add_products(options={}) end def add_taxons(options={}) - Taxon.roots.each {|taxon| add_taxon(taxon, options) } + Spree::Taxon.roots.each {|taxon| add_taxon(taxon, options) } end def add_taxon(taxon, options={}) From 0745522efc68240ff0b2210a5f6769c91c0f7017 Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Thu, 23 Aug 2012 17:03:14 -0400 Subject: [PATCH 04/14] Code cleanup. Matching some of the code to latest spree extension conventions --- .gitignore | 1 + Gemfile.lock | 243 ------------------------- README.md | 3 +- Versionfile | 7 +- config/routes.rb | 3 - lib/spree_sitemap_generator/engine.rb | 6 +- lib/tasks/spree_sitemap_generator.rake | 5 - spec/spec_helper.rb | 31 ---- spree_sitemap_generator.gemspec | 2 +- 9 files changed, 7 insertions(+), 294 deletions(-) delete mode 100644 Gemfile.lock delete mode 100644 config/routes.rb delete mode 100644 lib/tasks/spree_sitemap_generator.rake delete mode 100644 spec/spec_helper.rb diff --git a/.gitignore b/.gitignore index a4b3c98..72c970c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ tmp *.swp spec/test_app pkg +Gemfile.lock \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index b7dd861..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,243 +0,0 @@ -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 diff --git a/README.md b/README.md index 486b337..1f54d40 100644 --- a/README.md +++ b/README.md @@ -53,9 +53,10 @@ Features - Easily add additional sitemaps for pages you add to your spree site - Supports Amazon S3 and other hosting services - Thin wrapper over battle tested sitemap generator +- Supports adding spree_essential_cms pages to the sitemap Special Thanks -===== +============== - The creators of the sitemap_generator gem - jackkinsella diff --git a/Versionfile b/Versionfile index 8e5fef5..b3ae2f6 100644 --- a/Versionfile +++ b/Versionfile @@ -1,11 +1,6 @@ # This file is used to designate compatibilty with different versions of Spree # Please see http://spreecommerce.com/documentation/extensions.html#versionfile for details -# Examples -# -# "0.70.x" => { :branch => "master"} -# "0.60.x" => { :branch => "0-60-stable" } -# "0.40.x" => { :tag => "v1.0.0", :version => "1.0.0" } - +"1.1.x" => { :branch => "master"} "0.70.x" => { :branch => "master"} "0.30.x" => { :tag => "v3.0.2"} diff --git a/config/routes.rb b/config/routes.rb deleted file mode 100644 index 1c3c3b6..0000000 --- a/config/routes.rb +++ /dev/null @@ -1,3 +0,0 @@ -Rails.application.routes.draw do - # Add your extension routes here -end diff --git a/lib/spree_sitemap_generator/engine.rb b/lib/spree_sitemap_generator/engine.rb index 0f50ea8..4c262bc 100644 --- a/lib/spree_sitemap_generator/engine.rb +++ b/lib/spree_sitemap_generator/engine.rb @@ -1,5 +1,7 @@ module SpreeSitemapGenerator class Engine < Rails::Engine + require 'spree/core' + isolate_namespace Spree engine_name 'spree_sitemap_generator' config.autoload_paths += %W(#{config.root}/lib) @@ -29,10 +31,6 @@ def self.last_updated 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 diff --git a/lib/tasks/spree_sitemap_generator.rake b/lib/tasks/spree_sitemap_generator.rake deleted file mode 100644 index ac62c85..0000000 --- a/lib/tasks/spree_sitemap_generator.rake +++ /dev/null @@ -1,5 +0,0 @@ -# add custom rake tasks here -desc 'test it' -task :foo do - puts 1 -end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb deleted file mode 100644 index 353fdcc..0000000 --- a/spec/spec_helper.rb +++ /dev/null @@ -1,31 +0,0 @@ -# This file is copied to ~/spec when you run 'ruby script/generate rspec' -# from the project root directory. -ENV["RAILS_ENV"] ||= 'test' -require File.expand_path("../../../config/environment", __FILE__) -require 'rspec/rails' -require 'fabrication' - -# Requires supporting files with custom matchers and macros, etc, -# in ./support/ and its subdirectories. -Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} - -RSpec.configure do |config| - # == Mock Framework - # - # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line: - # - # config.mock_with :mocha - # config.mock_with :flexmock - # config.mock_with :rr - config.mock_with :rspec - - config.fixture_path = "#{::Rails.root}/spec/fixtures" - - #config.include Devise::TestHelpers, :type => :controller - # If you're not using ActiveRecord, or you'd prefer not to run each of your - # examples within a transaction, comment the following line or assign false - # instead of true. - config.use_transactional_fixtures = true -end - -@configuration ||= AppConfiguration.find_or_create_by_name("Default configuration") diff --git a/spree_sitemap_generator.gemspec b/spree_sitemap_generator.gemspec index 8ff295d..abfe1c0 100644 --- a/spree_sitemap_generator.gemspec +++ b/spree_sitemap_generator.gemspec @@ -16,5 +16,5 @@ Gem::Specification.new do |s| s.requirements << 'none' s.add_dependency('spree_core', '>= 1.1.0') - s.add_dependency('sitemap_generator', '~> 3.1.0') + s.add_dependency('sitemap_generator', '~> 3.1.1') end From 71ee8d21c0def0da6c35623781b4b99c86869067 Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Thu, 23 Aug 2012 17:03:52 -0400 Subject: [PATCH 05/14] Adding support for spree_essentials_cms. Stubbing support for spree_videos --- lib/generators/templates/config/sitemap.rb | 1 + lib/spree_sitemap_generator/spree_defaults.rb | 23 ++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/generators/templates/config/sitemap.rb b/lib/generators/templates/config/sitemap.rb index f48ff36..fd235f9 100644 --- a/lib/generators/templates/config/sitemap.rb +++ b/lib/generators/templates/config/sitemap.rb @@ -30,4 +30,5 @@ sitemap.add add_password_reset sitemap.add add_taxons sitemap.add add_products + sitemap.add add_pages end diff --git a/lib/spree_sitemap_generator/spree_defaults.rb b/lib/spree_sitemap_generator/spree_defaults.rb index 7072056..24f2a44 100644 --- a/lib/spree_sitemap_generator/spree_defaults.rb +++ b/lib/spree_sitemap_generator/spree_defaults.rb @@ -2,11 +2,12 @@ module SpreeSitemapGenerator::SpreeDefaults include ActionView::Helpers include ActionDispatch::Routing include Spree::Core::Engine.routes.url_helpers + include Spree::BaseHelper # for gem_available? + include Rails.application.routes.url_helpers def default_url_options - {:host => SitemapGenerator::Sitemap.default_host} + { :host => SitemapGenerator::Sitemap.default_host } end - include ::Rails.application.routes.url_helpers def add_login(options={}) add(login_path, options) @@ -31,7 +32,16 @@ def add_products(options={}) active_products.each do |product| add(product_path(product), options.merge(:lastmod => product.updated_at)) end - end + end + + def add_pages(options={}) + # https://github.com/citrus/spree_essential_cms + if gem_available? 'spree_essential_cms' + Spree::Page.active.each do |page| + add(page.path, options.merge(:lastmod => page.updated_at)) + end + end + end def add_taxons(options={}) Spree::Taxon.roots.each {|taxon| add_taxon(taxon, options) } @@ -41,5 +51,12 @@ def add_taxon(taxon, options={}) add(nested_taxons_path(taxon.permalink), options.merge(:lastmod => taxon.products.last_updated)) taxon.children.each {|child| add_taxon(child, options) } end + + def add_videos(options={}) + # https://github.com/iloveitaly/Spree-Videos + if gem_available 'spree_videos' + # TODO add video sitemap generation + end + end end From 54e95a69ef22b5c4fd5a0a62237d393add7a984c Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Fri, 24 Aug 2012 10:34:49 -0400 Subject: [PATCH 06/14] Fix for arrays in sitemap.xml. Regression in one of the merged branches --- lib/generators/templates/config/sitemap.rb | 15 ++++++++------- lib/spree_sitemap_generator/spree_defaults.rb | 8 +++----- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/lib/generators/templates/config/sitemap.rb b/lib/generators/templates/config/sitemap.rb index fd235f9..0211b50 100644 --- a/lib/generators/templates/config/sitemap.rb +++ b/lib/generators/templates/config/sitemap.rb @@ -24,11 +24,12 @@ # Article.find_each do |article| # sitemap.add article_path(article), :lastmod => article.updated_at # end - sitemap.add add_login - sitemap.add add_signup - sitemap.add add_account - sitemap.add add_password_reset - sitemap.add add_taxons - sitemap.add add_products - sitemap.add add_pages + + sitemap.add_login + sitemap.add_signup + sitemap.add_account + sitemap.add_password_reset + sitemap.add_taxons + sitemap.add_products + sitemap.add_pages end diff --git a/lib/spree_sitemap_generator/spree_defaults.rb b/lib/spree_sitemap_generator/spree_defaults.rb index 24f2a44..e5aae5d 100644 --- a/lib/spree_sitemap_generator/spree_defaults.rb +++ b/lib/spree_sitemap_generator/spree_defaults.rb @@ -36,11 +36,9 @@ def add_products(options={}) def add_pages(options={}) # https://github.com/citrus/spree_essential_cms - if gem_available? 'spree_essential_cms' - Spree::Page.active.each do |page| - add(page.path, options.merge(:lastmod => page.updated_at)) - end - end + Spree::Page.active.each do |page| + add(page.path, options.merge(:lastmod => page.updated_at)) + end if gem_available? 'spree_essential_cms' end def add_taxons(options={}) From 5cf9a06665d65ae0e33788a0705b87a71ef45dc0 Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Fri, 24 Aug 2012 12:20:45 -0400 Subject: [PATCH 07/14] Added support for spree_taxon_splash and spree_videos --- lib/generators/templates/config/sitemap.rb | 14 ++-- lib/spree_sitemap_generator/spree_defaults.rb | 69 ++++++++++++++++--- 2 files changed, 68 insertions(+), 15 deletions(-) diff --git a/lib/generators/templates/config/sitemap.rb b/lib/generators/templates/config/sitemap.rb index 0211b50..0539ff0 100644 --- a/lib/generators/templates/config/sitemap.rb +++ b/lib/generators/templates/config/sitemap.rb @@ -25,11 +25,11 @@ # sitemap.add article_path(article), :lastmod => article.updated_at # end - sitemap.add_login - sitemap.add_signup - sitemap.add_account - sitemap.add_password_reset - sitemap.add_taxons - sitemap.add_products - sitemap.add_pages + add_login + add_signup + add_account + add_password_reset + add_taxons + add_products + add_pages end diff --git a/lib/spree_sitemap_generator/spree_defaults.rb b/lib/spree_sitemap_generator/spree_defaults.rb index e5aae5d..5365797 100644 --- a/lib/spree_sitemap_generator/spree_defaults.rb +++ b/lib/spree_sitemap_generator/spree_defaults.rb @@ -2,7 +2,7 @@ module SpreeSitemapGenerator::SpreeDefaults include ActionView::Helpers include ActionDispatch::Routing include Spree::Core::Engine.routes.url_helpers - include Spree::BaseHelper # for gem_available? + include Spree::BaseHelper # for gem_available? + meta_data include Rails.application.routes.url_helpers def default_url_options @@ -30,11 +30,30 @@ def add_products(options={}) add(products_path, options.merge(:lastmod => active_products.last_updated)) active_products.each do |product| - add(product_path(product), options.merge(:lastmod => product.updated_at)) + opts = options.merge(:lastmod => product.updated_at) + + if gem_available? 'spree_videos' and product.videos.present? + @video_exclude ||= [] + + # TODO auto creating an exclusion list should be a config option + # better to only show a video on the primary page related to the video + # https://sites.google.com/site/webmasterhelpforum/en/faq-video-sitemaps#multiple-pages + # @video_exclude += product.videos.map(&:youtube_ref) + + video_list = product.videos.select { |v| !@video_exclude.include? v.youtube_ref }.map do |v| + video_options(v.youtube_ref, product) + end + + opts.merge!(:video => video_list) if video_list.present? + end + + add(product_path(product), opts) end end def add_pages(options={}) + # TODO this should be refactored to add_pages & add_page + # https://github.com/citrus/spree_essential_cms Spree::Page.active.each do |page| add(page.path, options.merge(:lastmod => page.updated_at)) @@ -46,15 +65,49 @@ def add_taxons(options={}) end def add_taxon(taxon, options={}) - add(nested_taxons_path(taxon.permalink), options.merge(:lastmod => taxon.products.last_updated)) + opts = options.merge(:lastmod => taxon.products.last_updated) + + if gem_available? 'spree_taxon_splash' and taxon.taxon_splash.present? + @video_exclude ||= [] + + # TODO currently only supports one match... should extend to match multiple videos embedded in page + # TODO only supports URL of style http://www.youtube.com/embed/DshOrgcEKsQ + + # pattern taken from: https://github.com/iloveitaly/Spree-Videos/blob/master/app/models/spree/video.rb#L10 + + youtube_ref = taxon.taxon_splash.content.match(/youtube\.com\/embed(v=|\/)([\w-]+)(&.+)?/) { |m| m[2] } + + if youtube_ref.present? and !@video_exclude.include? youtube_ref + # taxon splash pages would always hold primacy over a product (at least in my use case) + @video_exclude << youtube_ref + + opts.merge! :video => video_options(youtube_ref, taxon) + end + end + + add(nested_taxons_path(taxon.permalink), opts) taxon.children.each {|child| add_taxon(child, options) } end - def add_videos(options={}) - # https://github.com/iloveitaly/Spree-Videos - if gem_available 'spree_videos' - # TODO add video sitemap generation + private + def video_options(youtube_id, object = false) + # https://github.com/iloveitaly/Spree-Videos + # multiple videos of the same ID can exist, but all videos linked in the sitemap should be inique + + # required video fields are outlined here: http://www.seomoz.org/blog/video-sitemap-guide-for-vimeo-and-youtube + # youtube thumbnail images: http://www.reelseo.com/youtube-thumbnail-image/ + + # NOTE title should match the page title, however the title generation isn't self-contained + # although not a future proof solution, the best (+ easiest) solution is to mimic the title for product pages + # https://github.com/spree/spree/blob/master/core/lib/spree/core/controller_helpers.rb#L38 + # https://github.com/spree/spree/blob/master/core/app/controllers/spree/products_controller.rb#L33 + + ({ :description => meta_data(object)[:description] } rescue {}).merge( + ({ :title => [Spree::Config[:site_name], object.name].join(' - ') } rescue {}) + ).merge({ + :thumbnail_loc => "http://img.youtube.com/vi/#{youtube_id}/0.jpg", + :player_loc => "http://www.youtube.com/v/#{youtube_id}", + }) end - end end From 13e1ae5905e01326da02176a91c1033cadc22384 Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Fri, 24 Aug 2012 13:24:17 -0400 Subject: [PATCH 08/14] Minor documentation update --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1f54d40..95fbd0d 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Check out the README for the sitemap_generator gem at: http://github.com/kjvarga/sitemap_generator Features -===== +======== - Notifies search engine of new sitemaps (Google, Yahoo, Ask, Bing) - Supports large huge product catalogs - Adheres to 0.9 Sitemap protocol specification @@ -53,7 +53,8 @@ Features - Easily add additional sitemaps for pages you add to your spree site - Supports Amazon S3 and other hosting services - Thin wrapper over battle tested sitemap generator -- Supports adding spree_essential_cms pages to the sitemap +- Supports adding [spree_essential_cms](https://github.com/citrus/spree_essential_cms) pages to the sitemap +- Creates video sitemap data for [spree_videos](https://github.com/iloveitaly/Spree-Videos) and youtube videos embedded in custom [spree_taxon_splash](https://github.com/iloveitaly/spree_taxon_splash) pages Special Thanks ============== From 9bbea57512e95999238bfc3d8d1074c48d89258c Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Sat, 25 Aug 2012 17:01:04 -0400 Subject: [PATCH 09/14] Cleaned up the sitemap defaults loading. Added custom priority method class_eval the priority function --- lib/spree/sitemap_generator/defaults.rb | 123 ++++++++++++++++++ lib/spree_sitemap_generator/engine.rb | 7 +- lib/spree_sitemap_generator/spree_defaults.rb | 113 ---------------- 3 files changed, 124 insertions(+), 119 deletions(-) create mode 100644 lib/spree/sitemap_generator/defaults.rb delete mode 100644 lib/spree_sitemap_generator/spree_defaults.rb diff --git a/lib/spree/sitemap_generator/defaults.rb b/lib/spree/sitemap_generator/defaults.rb new file mode 100644 index 0000000..6e63eca --- /dev/null +++ b/lib/spree/sitemap_generator/defaults.rb @@ -0,0 +1,123 @@ +module Spree + module SitemapGenerator + module Defaults + include ActionView::Helpers + include ActionDispatch::Routing + include Spree::Core::Engine.routes.url_helpers + include Spree::BaseHelper # for gem_available? + meta_data + include Rails.application.routes.url_helpers + + def default_url_options + { :host => SitemapGenerator::Sitemap.default_host } + end + + def add_login(options={}) + add(login_path, options) + end + + def add_signup(options={}) + add(signup_path, options) + end + + def add_account(options={}) + add(account_path, options) + end + + def add_password_reset(options={}) + add(new_user_password_path, options) + end + + def add_products(options={}) + active_products = Spree::Product.active + + add(products_path, options.merge(:lastmod => active_products.last_updated)) + + active_products.each do |product| + opts = options.merge(:lastmod => product.updated_at, :priority => priority(product)) + + if gem_available? 'spree_videos' and product.videos.present? + @video_exclude ||= [] + + # TODO auto creating an exclusion list should be a config option + # better to only show a video on the primary page related to the video + # https://sites.google.com/site/webmasterhelpforum/en/faq-video-sitemaps#multiple-pages + # @video_exclude += product.videos.map(&:youtube_ref) + + video_list = product.videos.select { |v| !@video_exclude.include? v.youtube_ref }.map do |v| + video_options(v.youtube_ref, product) + end + + opts.merge!(:video => video_list) if video_list.present? + end + + add(product_path(product), opts) + end + end + + def add_pages(options={}) + # TODO this should be refactored to add_pages & add_page + + # https://github.com/citrus/spree_essential_cms + Spree::Page.active.each do |page| + add(page.path, options.merge(:lastmod => page.updated_at, :priority => priority(page))) + end if gem_available? 'spree_essential_cms' + end + + def add_taxons(options={}) + Spree::Taxon.roots.each {|taxon| add_taxon(taxon, options) } + end + + def add_taxon(taxon, options={}) + opts = options.merge(:lastmod => taxon.products.last_updated, :priority => priority(taxon)) + + if gem_available? 'spree_taxon_splash' and taxon.taxon_splash.present? + @video_exclude ||= [] + + # TODO currently only supports one match... should extend to match multiple videos embedded in page + # TODO only supports URL of style http://www.youtube.com/embed/DshOrgcEKsQ + + # pattern taken from: https://github.com/iloveitaly/Spree-Videos/blob/master/app/models/spree/video.rb#L10 + + youtube_ref = taxon.taxon_splash.content.match(/youtube\.com\/embed(v=|\/)([\w-]+)(&.+)?/) { |m| m[2] } + + if youtube_ref.present? and !@video_exclude.include? youtube_ref + # taxon splash pages would always hold primacy over a product (at least in my use case) + @video_exclude << youtube_ref + + opts.merge! :video => video_options(youtube_ref, taxon) + end + end + + add(nested_taxons_path(taxon.permalink), opts) + taxon.children.each {|child| add_taxon(child, options) } + end + + private + def video_options(youtube_id, object = false) + # https://github.com/iloveitaly/Spree-Videos + # multiple videos of the same ID can exist, but all videos linked in the sitemap should be inique + + # required video fields are outlined here: http://www.seomoz.org/blog/video-sitemap-guide-for-vimeo-and-youtube + # youtube thumbnail images: http://www.reelseo.com/youtube-thumbnail-image/ + + # NOTE title should match the page title, however the title generation isn't self-contained + # although not a future proof solution, the best (+ easiest) solution is to mimic the title for product pages + # https://github.com/spree/spree/blob/master/core/lib/spree/core/controller_helpers.rb#L38 + # https://github.com/spree/spree/blob/master/core/app/controllers/spree/products_controller.rb#L33 + + ({ :description => meta_data(object)[:description] } rescue {}).merge( + ({ :title => [Spree::Config[:site_name], object.name].join(' - ') } rescue {}) + ).merge({ + :thumbnail_loc => "http://img.youtube.com/vi/#{youtube_id}/0.jpg", + :player_loc => "http://www.youtube.com/v/#{youtube_id}", + }) + end + + # override via class eval + def priority(object) + 0.5 + end + end + end +end + diff --git a/lib/spree_sitemap_generator/engine.rb b/lib/spree_sitemap_generator/engine.rb index 4c262bc..3386bb0 100644 --- a/lib/spree_sitemap_generator/engine.rb +++ b/lib/spree_sitemap_generator/engine.rb @@ -25,12 +25,7 @@ def self.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 + SitemapGenerator::Interpreter.send :include, Spree::SitemapGenerator::Defaults end config.to_prepare &method(:activate).to_proc diff --git a/lib/spree_sitemap_generator/spree_defaults.rb b/lib/spree_sitemap_generator/spree_defaults.rb deleted file mode 100644 index 5365797..0000000 --- a/lib/spree_sitemap_generator/spree_defaults.rb +++ /dev/null @@ -1,113 +0,0 @@ -module SpreeSitemapGenerator::SpreeDefaults - include ActionView::Helpers - include ActionDispatch::Routing - include Spree::Core::Engine.routes.url_helpers - include Spree::BaseHelper # for gem_available? + meta_data - include Rails.application.routes.url_helpers - - def default_url_options - { :host => SitemapGenerator::Sitemap.default_host } - end - - def add_login(options={}) - add(login_path, options) - end - - def add_signup(options={}) - add(signup_path, options) - end - - def add_account(options={}) - add(account_path, options) - end - - def add_password_reset(options={}) - add(new_user_password_path, options) - end - - def add_products(options={}) - active_products = Spree::Product.active - - add(products_path, options.merge(:lastmod => active_products.last_updated)) - active_products.each do |product| - opts = options.merge(:lastmod => product.updated_at) - - if gem_available? 'spree_videos' and product.videos.present? - @video_exclude ||= [] - - # TODO auto creating an exclusion list should be a config option - # better to only show a video on the primary page related to the video - # https://sites.google.com/site/webmasterhelpforum/en/faq-video-sitemaps#multiple-pages - # @video_exclude += product.videos.map(&:youtube_ref) - - video_list = product.videos.select { |v| !@video_exclude.include? v.youtube_ref }.map do |v| - video_options(v.youtube_ref, product) - end - - opts.merge!(:video => video_list) if video_list.present? - end - - add(product_path(product), opts) - end - end - - def add_pages(options={}) - # TODO this should be refactored to add_pages & add_page - - # https://github.com/citrus/spree_essential_cms - Spree::Page.active.each do |page| - add(page.path, options.merge(:lastmod => page.updated_at)) - end if gem_available? 'spree_essential_cms' - end - - def add_taxons(options={}) - Spree::Taxon.roots.each {|taxon| add_taxon(taxon, options) } - end - - def add_taxon(taxon, options={}) - opts = options.merge(:lastmod => taxon.products.last_updated) - - if gem_available? 'spree_taxon_splash' and taxon.taxon_splash.present? - @video_exclude ||= [] - - # TODO currently only supports one match... should extend to match multiple videos embedded in page - # TODO only supports URL of style http://www.youtube.com/embed/DshOrgcEKsQ - - # pattern taken from: https://github.com/iloveitaly/Spree-Videos/blob/master/app/models/spree/video.rb#L10 - - youtube_ref = taxon.taxon_splash.content.match(/youtube\.com\/embed(v=|\/)([\w-]+)(&.+)?/) { |m| m[2] } - - if youtube_ref.present? and !@video_exclude.include? youtube_ref - # taxon splash pages would always hold primacy over a product (at least in my use case) - @video_exclude << youtube_ref - - opts.merge! :video => video_options(youtube_ref, taxon) - end - end - - add(nested_taxons_path(taxon.permalink), opts) - taxon.children.each {|child| add_taxon(child, options) } - end - - private - def video_options(youtube_id, object = false) - # https://github.com/iloveitaly/Spree-Videos - # multiple videos of the same ID can exist, but all videos linked in the sitemap should be inique - - # required video fields are outlined here: http://www.seomoz.org/blog/video-sitemap-guide-for-vimeo-and-youtube - # youtube thumbnail images: http://www.reelseo.com/youtube-thumbnail-image/ - - # NOTE title should match the page title, however the title generation isn't self-contained - # although not a future proof solution, the best (+ easiest) solution is to mimic the title for product pages - # https://github.com/spree/spree/blob/master/core/lib/spree/core/controller_helpers.rb#L38 - # https://github.com/spree/spree/blob/master/core/app/controllers/spree/products_controller.rb#L33 - - ({ :description => meta_data(object)[:description] } rescue {}).merge( - ({ :title => [Spree::Config[:site_name], object.name].join(' - ') } rescue {}) - ).merge({ - :thumbnail_loc => "http://img.youtube.com/vi/#{youtube_id}/0.jpg", - :player_loc => "http://www.youtube.com/v/#{youtube_id}", - }) - end -end - From 8cbd5ab91afdd51e733c3164da4236707e53c85b Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Sat, 25 Aug 2012 17:14:36 -0400 Subject: [PATCH 10/14] Refactored last_updated to be a defaults method rather than an ActiveRecord class_eval --- lib/spree/sitemap_generator/defaults.rb | 16 +++++++++++++--- lib/spree_sitemap_generator/engine.rb | 13 ------------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/lib/spree/sitemap_generator/defaults.rb b/lib/spree/sitemap_generator/defaults.rb index 6e63eca..cc0a49e 100644 --- a/lib/spree/sitemap_generator/defaults.rb +++ b/lib/spree/sitemap_generator/defaults.rb @@ -30,7 +30,7 @@ def add_password_reset(options={}) def add_products(options={}) active_products = Spree::Product.active - add(products_path, options.merge(:lastmod => active_products.last_updated)) + add(products_path, options.merge(:lastmod => last_updated(active_products))) active_products.each do |product| opts = options.merge(:lastmod => product.updated_at, :priority => priority(product)) @@ -68,7 +68,7 @@ def add_taxons(options={}) end def add_taxon(taxon, options={}) - opts = options.merge(:lastmod => taxon.products.last_updated, :priority => priority(taxon)) + opts = options.merge(:lastmod => last_updated(taxon.products), :priority => priority(taxon)) if gem_available? 'spree_taxon_splash' and taxon.taxon_splash.present? @video_exclude ||= [] @@ -117,7 +117,17 @@ def video_options(youtube_id, object = false) def priority(object) 0.5 end - end + + def last_updated(object) + if object.is_a? ActiveRecord::Relation + return object.order('updated_at DESC').first.try :updated_at + elsif object.kind_of? ActiveRecord::Base + return object.last_updated + end + + Time.now + end + end end end diff --git a/lib/spree_sitemap_generator/engine.rb b/lib/spree_sitemap_generator/engine.rb index 3386bb0..375251c 100644 --- a/lib/spree_sitemap_generator/engine.rb +++ b/lib/spree_sitemap_generator/engine.rb @@ -12,19 +12,6 @@ class Engine < Rails::Engine 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 - SitemapGenerator::Interpreter.send :include, Spree::SitemapGenerator::Defaults end From 89854976ff1dfb447ed61ba5cc95eca2d8998f24 Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Sat, 25 Aug 2012 18:21:15 -0400 Subject: [PATCH 11/14] Fixing invalid attribute for video sitemap Leaving the autoplay attribute blank is invalid according to google. Couldn't find any obvious documentation stating that you should remove the attribute altogether --- lib/spree/sitemap_generator/defaults.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/spree/sitemap_generator/defaults.rb b/lib/spree/sitemap_generator/defaults.rb index cc0a49e..88fc3f6 100644 --- a/lib/spree/sitemap_generator/defaults.rb +++ b/lib/spree/sitemap_generator/defaults.rb @@ -110,6 +110,7 @@ def video_options(youtube_id, object = false) ).merge({ :thumbnail_loc => "http://img.youtube.com/vi/#{youtube_id}/0.jpg", :player_loc => "http://www.youtube.com/v/#{youtube_id}", + :autoplay => "ap=1" }) end From 5c698f670781f35b49697417c4394099545b01b2 Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Fri, 11 Jan 2013 11:07:17 -0500 Subject: [PATCH 12/14] Adding support for spree_static_content --- lib/spree_sitemap_generator/spree_defaults.rb | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 lib/spree_sitemap_generator/spree_defaults.rb diff --git a/lib/spree_sitemap_generator/spree_defaults.rb b/lib/spree_sitemap_generator/spree_defaults.rb new file mode 100644 index 0000000..6445d70 --- /dev/null +++ b/lib/spree_sitemap_generator/spree_defaults.rb @@ -0,0 +1,117 @@ +module SpreeSitemapGenerator::SpreeDefaults + include ActionView::Helpers + include ActionDispatch::Routing + include Spree::Core::Engine.routes.url_helpers + include Spree::BaseHelper # for gem_available? + meta_data + include Rails.application.routes.url_helpers + + def default_url_options + { :host => SitemapGenerator::Sitemap.default_host } + end + + def add_login(options={}) + add(login_path, options) + end + + def add_signup(options={}) + add(signup_path, options) + end + + def add_account(options={}) + add(account_path, options) + end + + def add_password_reset(options={}) + add(new_user_password_path, options) + end + + def add_products(options={}) + active_products = Spree::Product.active + + add(products_path, options.merge(:lastmod => active_products.last_updated)) + active_products.each do |product| + opts = options.merge(:lastmod => product.updated_at) + + if gem_available? 'spree_videos' and product.videos.present? + @video_exclude ||= [] + + # TODO auto creating an exclusion list should be a config option + # better to only show a video on the primary page related to the video + # https://sites.google.com/site/webmasterhelpforum/en/faq-video-sitemaps#multiple-pages + # @video_exclude += product.videos.map(&:youtube_ref) + + video_list = product.videos.select { |v| !@video_exclude.include? v.youtube_ref }.map do |v| + video_options(v.youtube_ref, product) + end + + opts.merge!(:video => video_list) if video_list.present? + end + + add(product_path(product), opts) + end + end + + def add_pages(options={}) + # TODO this should be refactored to add_pages & add_page + + # https://github.com/citrus/spree_essential_cms + Spree::Page.active.each do |page| + add(page.path, options.merge(:lastmod => page.updated_at)) + end if gem_available? 'spree_essential_cms' + + Spree::Page.visible.each do |page| + add(page.slug, options.merge(:lastmod => page.updated_at)) + end if gem_available? 'spree_static_content' + end + + def add_taxons(options={}) + Spree::Taxon.roots.each {|taxon| add_taxon(taxon, options) } + end + + def add_taxon(taxon, options={}) + opts = options.merge(:lastmod => taxon.products.last_updated) + + if gem_available? 'spree_taxon_splash' and taxon.taxon_splash.present? + @video_exclude ||= [] + + # TODO currently only supports one match... should extend to match multiple videos embedded in page + # TODO only supports URL of style http://www.youtube.com/embed/DshOrgcEKsQ + + # pattern taken from: https://github.com/iloveitaly/Spree-Videos/blob/master/app/models/spree/video.rb#L10 + + youtube_ref = taxon.taxon_splash.content.match(/youtube\.com\/embed(v=|\/)([\w-]+)(&.+)?/) { |m| m[2] } + + if youtube_ref.present? and !@video_exclude.include? youtube_ref + # taxon splash pages would always hold primacy over a product (at least in my use case) + @video_exclude << youtube_ref + + opts.merge! :video => video_options(youtube_ref, taxon) + end + end + + add(nested_taxons_path(taxon.permalink), opts) + taxon.children.each {|child| add_taxon(child, options) } + end + + private + def video_options(youtube_id, object = false) + # https://github.com/iloveitaly/Spree-Videos + # multiple videos of the same ID can exist, but all videos linked in the sitemap should be unique + + # required video fields are outlined here: http://www.seomoz.org/blog/video-sitemap-guide-for-vimeo-and-youtube + # youtube thumbnail images: http://www.reelseo.com/youtube-thumbnail-image/ + + # NOTE title should match the page title, however the title generation isn't self-contained + # although not a future proof solution, the best (+ easiest) solution is to mimic the title for product pages + # https://github.com/spree/spree/blob/master/core/lib/spree/core/controller_helpers.rb#L38 + # https://github.com/spree/spree/blob/master/core/app/controllers/spree/products_controller.rb#L33 + + ({ :description => meta_data(object)[:description] } rescue {}).merge( + ({ :title => [Spree::Config[:site_name], object.name].join(' - ') } rescue {}) + ).merge({ + :thumbnail_loc => "http://img.youtube.com/vi/#{youtube_id}/0.jpg", + :player_loc => "http://www.youtube.com/v/#{youtube_id}", + }) + end +end + From b853ca4f5633a29405fb09eaa3765307bc6f2bbb Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Fri, 11 Jan 2013 11:26:56 -0500 Subject: [PATCH 13/14] Restricting product page video output to one per page If you have multiple videos on the same page with the same title you'll get a webmaster warning --- lib/spree_sitemap_generator/spree_defaults.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/spree_sitemap_generator/spree_defaults.rb b/lib/spree_sitemap_generator/spree_defaults.rb index 6445d70..ea25846 100644 --- a/lib/spree_sitemap_generator/spree_defaults.rb +++ b/lib/spree_sitemap_generator/spree_defaults.rb @@ -40,11 +40,9 @@ def add_products(options={}) # https://sites.google.com/site/webmasterhelpforum/en/faq-video-sitemaps#multiple-pages # @video_exclude += product.videos.map(&:youtube_ref) - video_list = product.videos.select { |v| !@video_exclude.include? v.youtube_ref }.map do |v| - video_options(v.youtube_ref, product) - end - - opts.merge!(:video => video_list) if video_list.present? + # don't include all the videos on the page otherwise you'll need duplicate title warnings + primary_video = product.videos.select { |v| !@video_exclude.include? v.youtube_ref }.first + opts.merge!(:video => [video_options(primary_video.youtube_ref, product)]) if primary_video.present? end add(product_path(product), opts) From cdcbc3e02c85baccab2e6a37c29fcb9e5e7dfa80 Mon Sep 17 00:00:00 2001 From: Michael Bianco Date: Fri, 11 Jan 2013 11:33:24 -0500 Subject: [PATCH 14/14] Updated to latest version of sitemap generator --- spree_sitemap_generator.gemspec | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/spree_sitemap_generator.gemspec b/spree_sitemap_generator.gemspec index abfe1c0..f03679f 100644 --- a/spree_sitemap_generator.gemspec +++ b/spree_sitemap_generator.gemspec @@ -1,20 +1,18 @@ Gem::Specification.new do |s| s.platform = Gem::Platform::RUBY s.name = 'spree_sitemap_generator' - s.version = '1.1.0' + s.version = '1.1.1' s.summary = 'Provides a sitemap file for Spree' - #s.description = 'Add (optional) gem description here' s.required_ruby_version = '>= 1.8.7' - s.author = 'Joshua Nussbaum' - s.email = 'joshnuss@gmail.com' - # s.homepage = 'http://www.rubyonrails.org' - # s.rubyforge_project = 'actionmailer' + s.authors = ['Joshua Nussbaum', 'Michael Bianco'] + s.email = ['joshnuss@gmail.com', 'info@cliffsidedev.com'] + s.homepage = 'https://github.com/iloveitaly/spree-sitemap-generator' s.files = Dir['CHANGELOG', 'README.md', 'LICENSE', 'lib/**/*', 'app/**/*'] s.require_path = 'lib' s.requirements << 'none' - s.add_dependency('spree_core', '>= 1.1.0') - s.add_dependency('sitemap_generator', '~> 3.1.1') + s.add_dependency 'spree_core', '~> 1.1' + s.add_dependency 'sitemap_generator', '~> 3.4' end