Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
rstacruz committed Sep 4, 2011
1 parent 486df78 commit eb7fbff
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ extend LogHelpers
Dir['./lib/tasks/**/*.rake'].each { |f| load f }
task :default => :help

# You may want to remove this crap, it has no use in production.
# You may want to remove this crap, these have no use in production.

desc "Starts the server [Development]"
task(:start) {
Expand All @@ -17,20 +17,20 @@ task(:irb) {
system "#{irb} -r./init.rb"
}

desc "Lists available recipes [Recipe]"
task(:recipes) {
puts "Available recipes:"
list = Dir['./**/*.example'].map { |f| File.basename(f).match(/([^\.]+)(.[^\.]+){2}$/) && $1 }.uniq
list.each { |item| puts " * rake recipes:load[#{item}]" }
}
namespace :example do
desc "Lists available recipes [Examples]"
task :list do
puts "Available recipes:"
list = Dir['./**/*.example'].map { |f| File.basename(f).match(/([^\.]+)(.[^\.]+){2}$/) && $1 }.uniq
list.each { |item| puts " * rake recipes:load[#{item}]" }
end

namespace :recipes do
desc "Clears all example files [Recipe]"
desc "Clears all example files [Examples]"
task :clear do
Dir['./**/*.example'].each { |f| FileUtils.rm f }
end

desc "Loads a given recipe [Recipe]"
desc "Loads a given recipe [Examples]"
task :load, :recipe do |t, args|
recipe = args[:recipe]
Dir["./**/*#{recipe}.*.example"].each { |from|
Expand All @@ -41,3 +41,5 @@ namespace :recipes do
puts "Okay, now add the appropriate gems to your gemfile."
end
end

task :examples => :'example:list'

0 comments on commit eb7fbff

Please sign in to comment.