forked from pmisters/dynamic-spree-sitemaps
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
81 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
map.resources :sitemap | ||
Rails.application.routes.draw do | ||
|
||
resources :sitemap | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 not shown.