Sha256: a56b09b4d28cf3cab5a974686e2c96c6851f43b08603c39628e616b82b0b2d2b

Contents?: true

Size: 744 Bytes

Versions: 2

Compression:

Stored size: 744 Bytes

Contents

rule /\#.*/ do |t|
  env = t.name.match(/\#.*/).to_s.gsub("#", "")
  ENV["MACK_ENV"] = env
  name = t.name.gsub("##{env}", "")
  Rake::Task[name].invoke
end

rule /^cachetastic:/ do |t|
  x = t.name.gsub("cachetastic:", '')
  x = x.split(":")
  cache_name = x.first
  cache_action = x.last
  puts "cache_name: #{cache_name}"
  puts "cache_action: #{cache_action}"
  ENV['cache_name'] = cache_name
  ENV['cache_action'] = cache_action
  Rake::Task["cachetastic:manipulate_caches"].invoke
end

rule /^generate:/ do |t|
  klass = t.name.gsub("generate:", '')
  Rake::Task["environment"].invoke
  klass = "#{klass.camelcase}Generator"
  gen = klass.constantize.run(ENV.to_hash)
end

rule /^test:rspec/ do |t|
  raise "i'm running a test task!"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mack-0.6.0 lib/tasks/rake_rules.rake
mack-0.6.0.1 lib/tasks/rake_rules.rake