From 0aa715dd363d2f5c6b1c5ef9283267891bd8d5b4 Mon Sep 17 00:00:00 2001 From: bzt Date: Sat, 4 Dec 2010 20:30:35 +0100 Subject: [PATCH] spree_dynamic_sitemaps --- .DS_Store | Bin 0 -> 6148 bytes README.markdown | 13 +++++++------ app/.DS_Store | Bin 0 -> 6148 bytes app/views/.DS_Store | Bin 0 -> 6148 bytes config/routes.rb | 6 +++++- dynamic_sitemaps.gemspec | 20 ++++++++++++++++++++ lib/.DS_Store | Bin 0 -> 6148 bytes lib/dynamic_sitemaps.rb | 13 +++++++++++++ lib/tasks/dynamic_sitemaps.rake | 10 ++++++++++ lib/tasks/install.rake | 26 ++++++++++++++++++++++++++ spec/.DS_Store | Bin 0 -> 6148 bytes 11 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 .DS_Store create mode 100644 app/.DS_Store create mode 100644 app/views/.DS_Store create mode 100644 dynamic_sitemaps.gemspec create mode 100644 lib/.DS_Store create mode 100644 lib/dynamic_sitemaps.rb create mode 100644 lib/tasks/dynamic_sitemaps.rake create mode 100644 lib/tasks/install.rake create mode 100644 spec/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..73a78b6301bea36477e7cfcdb58d143e7f5f73dc GIT binary patch literal 6148 zcmeHK%TB{U3>=dPRpQbk$NdHVU{#eb;0K^7Af$*?s(R0j-)8&(Z55&3IDjqLll6MC z${gY~0NI@OcfcCJimr$c4NKE~^@UwUrYDNNV;FbSG-~!bwl0ElJ3Qfl!~WRv2TXX! z3*PYBZgd!#+O?@3N7A1$w8@JHXF)2E3Zw$5Kq~N06=2U+TirNjOa)SbRNz|y{XZ1C zVhx-f?bpFzBLGpa@n(FsS%O$JL9BtZBQrE{D$%JDBZfGg`4V+CaCUS$B!&-(lO-k; zvD5kfV&#zPm@ySd1Diuft{*(gJZy&ZBep2+-#m8x{E%ZnF qm$BB$8LSl(trc^jt@yU7EBeg+8aO)|oq3}Z^CF= 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' %>` diff --git a/app/.DS_Store b/app/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b5cab1f6e84de9bcb6133c3691f29ebb0c0ccc50 GIT binary patch literal 6148 zcmeH~I|@QU3`G+^AlO)1PU8aH!63Qq+X#TU>6a&*}7cJPpw7M{m010#m^kYA<`+o)hH2-&6xFrD+ z_%i}JSgw}~JXGGTZ;xmBO=fM~;7~6|c=-sx#;)Qi+zsc&7SNj7LXm;-L%=aGkib_7 FJOF)`6QuwE literal 0 HcmV?d00001 diff --git a/app/views/.DS_Store b/app/views/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..57e7541511c0cb99702c343b98228a4a6dcc3f8b GIT binary patch literal 6148 zcmeHKOG-mQ5Uh@Y1hUD}gx&T&Tzyl-tqFC zf7o3oC@Te|fE17dQa}p)N&)Y^wD}@YQ3^-_De$F$e;*p%u@?@B@#$cQ5r8;lI*jX> zC5X)v#9lZgGDEYZ5|e5*Vp!6dZ&lX|hs31AYWT1^*=j#BJt8*j(A dQIvJf*L>a!hs2;WA9SLA23!}J6!>ceJ^=!#6^{S_ literal 0 HcmV?d00001 diff --git a/config/routes.rb b/config/routes.rb index b30db01..fa5bcd2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1 +1,5 @@ -map.resources :sitemap +Rails.application.routes.draw do + + resources :sitemap + +end \ No newline at end of file diff --git a/dynamic_sitemaps.gemspec b/dynamic_sitemaps.gemspec new file mode 100644 index 0000000..ecf8eb2 --- /dev/null +++ b/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 \ No newline at end of file diff --git a/lib/.DS_Store b/lib/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..7b237c9c18a74fc2bf6585a76f326c9791ace5a8 GIT binary patch literal 6148 zcmeH~I|>3p42BaQAlO)1PU8W*!6149FW{?FuvqQq=>B;ixLS+IA4vY0Orq>p>}*6t zSNGFWWF{gLxT!2G^h~iI%T4yu$yvHncf1^~*NayTves(g_>I@|Jf@HU36KB@kN^q% z5COZlVUuYnBMFcI2|Nkd`=P*1YibMiR|kTR0MHTAZdm&)0WFq**3=e?3{0aH8m;PM zh~>Q5Jj?GgYwHGwdO5<&M*uc<70=;rI4`z<*3=e?42&NFj)8#$zDnQ$ DzYi0g literal 0 HcmV?d00001 diff --git a/lib/dynamic_sitemaps.rb b/lib/dynamic_sitemaps.rb new file mode 100644 index 0000000..481d147 --- /dev/null +++ b/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 diff --git a/lib/tasks/dynamic_sitemaps.rake b/lib/tasks/dynamic_sitemaps.rake new file mode 100644 index 0000000..1c98343 --- /dev/null +++ b/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 diff --git a/lib/tasks/install.rake b/lib/tasks/install.rake new file mode 100644 index 0000000..d3ca56b --- /dev/null +++ b/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 \ No newline at end of file diff --git a/spec/.DS_Store b/spec/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f8de7f5ab2b6a657ef66b15727a5ad3982b86853 GIT binary patch literal 6148 zcmeHKyH3ME5S)cbL`svA@_vCou%hq<`~V_BqOdSZpm)b_GyC9S*|ZdBHrgBC-p-yp zg*OYpc5lZUU<+VPcf`9dbMtfenO#)G(W1r)1A6`*ahhc>2b{aXfxKtDlJ(6$AJ2#W zVHkQRUg3#Fd%Q&H$)Zf-|csNrRuG-m-AlR==bzbV{W8# miB?RER?LmJ;_DxI&7XPR6^@BPXFTXc{Sk0oWK!TS6!-v-NE^Wb literal 0 HcmV?d00001