Skip to content

Commit

Permalink
spree_dynamic_sitemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
bzt committed Dec 4, 2010
1 parent f412321 commit 0aa715d
Show file tree
Hide file tree
Showing 11 changed files with 81 additions and 7 deletions.
Binary file added .DS_Store
Binary file not shown.
13 changes: 7 additions & 6 deletions README.markdown
Expand Up @@ -7,18 +7,19 @@ This extension is compatible with the [static_content][1] extension and will che

In order to avoid an seo penalty for duplicate content, products are only listed once at /product/_productName_

for rails 3 and spree >= 0.30.0

INSTALLATION
------------

1. Install the extension

`script/extension install git://github.com/pmisters/dynamic-spree-sitemaps.git`

2. Rename the directory to sitemaps

`mv vendor/extensions/dynamic_spree_sitemaps vendor/extensions/sitemaps`
gem 'dynamic_sitemaps', :git => 'git://github.com/bzt/spree_dynamic_sitemaps.git'
bundle install

(rake dynamic_sitemaps:install)

3. Add link to sitemap to a view
2. Add link to sitemap to a view

`<%= link_to 'Sitemap', '/sitemap' %>`

Expand Down
Binary file added app/.DS_Store
Binary file not shown.
Binary file added app/views/.DS_Store
Binary file not shown.
6 changes: 5 additions & 1 deletion config/routes.rb
@@ -1 +1,5 @@
map.resources :sitemap
Rails.application.routes.draw do

resources :sitemap

end
20 changes: 20 additions & 0 deletions dynamic_sitemaps.gemspec
@@ -0,0 +1,20 @@
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'dynamic_sitemaps'
s.version = '0.0.1'
s.summary = 'Add gem summary here'
#s.description = 'Add (optional) gem description here'
s.required_ruby_version = '>= 1.8.7'

s.author = 'bzt'
# s.email = ''
# s.homepage = ''
# s.rubyforge_project = ''

s.files = Dir['README.textile', 'LICENSE', 'lib/**/*', 'app/**/*']
s.require_path = 'lib'
s.requirements << 'none'

s.has_rdoc = true

end
Binary file added lib/.DS_Store
Binary file not shown.
13 changes: 13 additions & 0 deletions lib/dynamic_sitemaps.rb
@@ -0,0 +1,13 @@
require 'spree_core'

module DynamicSitemaps
class Engine < Rails::Engine
def self.activate
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
config.autoload_paths += %W(#{config.root}/lib)
end
end
10 changes: 10 additions & 0 deletions lib/tasks/dynamic_sitemaps.rake
@@ -0,0 +1,10 @@
namespace :db do
desc "Bootstrap your database for Spree."
task :bootstrap => :environment do
# load initial database fixtures (in db/sample/*.yml) into the current environment's database
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
Dir.glob(File.join(DynamicSitemaps.root, "db", 'sample', '*.{yml,csv}')).each do |fixture_file|
Fixtures.create_fixtures("#{DynamicSitemaps.root}/db/sample", File.basename(fixture_file, '.*'))
end
end
end
26 changes: 26 additions & 0 deletions lib/tasks/install.rake
@@ -0,0 +1,26 @@
namespace :dynamic_sitemaps do
desc "Copies all migrations and assets (NOTE: This will be obsolete with Rails 3.1)"
task :install do
Rake::Task['dynamic_sitemaps:install:migrations'].invoke
Rake::Task['dynamic_sitemaps:install:assets'].invoke
end

namespace :install do
desc "Copies all migrations (NOTE: This will be obsolete with Rails 3.1)"
task :migrations do
source = File.join(File.dirname(__FILE__), '..', '..', 'db')
destination = File.join(Rails.root, 'db')
puts "INFO: Mirroring assets from #{source} to #{destination}"
Spree::FileUtilz.mirror_files(source, destination)
end

desc "Copies all assets (NOTE: This will be obsolete with Rails 3.1)"
task :assets do
source = File.join(File.dirname(__FILE__), '..', '..', 'public')
destination = File.join(Rails.root, 'public')
puts "INFO: Mirroring assets from #{source} to #{destination}"
Spree::FileUtilz.mirror_files(source, destination)
end
end

end
Binary file added spec/.DS_Store
Binary file not shown.

0 comments on commit 0aa715d

Please sign in to comment.