Skip to content

Commit

Permalink
Rake tasks: Update to work with edge Spree. Fix references to outdate…
Browse files Browse the repository at this point in the history
…d extension name.
  • Loading branch information
Jay Mendoza committed Jan 19, 2010
1 parent 76a6c0f commit dc74036
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
6 changes: 3 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,17 @@ namespace :spec do
end
end

desc 'Generate documentation for the blog extension.'
desc 'Generate documentation for the blogging_spree extension.'
Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'BlogExtension'
rdoc.title = 'BloggingSpreeExtension'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README')
rdoc.rdoc_files.include('lib/**/*.rb')
end

# For extensions that are in transition
desc 'Test the blog extension.'
desc 'Test the blogging_spree extension.'
Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.pattern = 'test/**/*_test.rb'
Expand Down
23 changes: 5 additions & 18 deletions lib/tasks/blog_extension_tasks.rake
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
require 'active_record'

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(BlogExtension.root, "db", 'sample', '*.{yml,csv}')).each do |fixture_file|
Fixtures.create_fixtures("#{BlogExtension.root}/db/sample", File.basename(fixture_file, '.*'))
end
end
end

namespace :spree do
namespace :extensions do
namespace :blog do
desc "Copies public assets of the Blog to the instance public/ directory."
namespace :blogging_spree do
desc "Copies public assets of BloggingSpree to the instance public/ directory."
task :update => :environment do
is_svn_or_dir = proc {|path| path =~ /\.svn/ || File.directory?(path) }
Dir[BlogExtension.root + "/public/**/*"].reject(&is_svn_or_dir).each do |file|
path = file.sub(BlogExtension.root, '')
is_svn_git_or_dir = proc {|path| path =~ /\.svn/ || path =~ /\.git/ || File.directory?(path) }
Dir[BloggingSpreeExtension.root + "/public/**/*"].reject(&is_svn_git_or_dir).each do |file|
path = file.sub(BloggingSpreeExtension.root, '')
directory = File.dirname(path)
puts "Copying #{path}..."
mkdir_p RAILS_ROOT + directory
Expand Down

0 comments on commit dc74036

Please sign in to comment.