2011-08-31 18:03:48 +00:00
|
|
|
module Penchant
|
|
|
|
class DotPenchant
|
|
|
|
class << self
|
2011-10-13 14:01:18 +00:00
|
|
|
def run(env = nil, deployment = false)
|
2011-08-31 18:03:48 +00:00
|
|
|
dot_penchant = new
|
|
|
|
dot_penchant.run(env)
|
|
|
|
dot_penchant
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-10-13 14:01:18 +00:00
|
|
|
def run(env = nil, deployment = false)
|
2011-08-31 18:03:48 +00:00
|
|
|
instance_eval(File.read('.penchant'))
|
|
|
|
end
|
2011-08-31 18:11:05 +00:00
|
|
|
|
|
|
|
def rake(*tasks)
|
|
|
|
command = [ "rake", *tasks ]
|
|
|
|
command.unshift("bundle exec") if gemfile?
|
|
|
|
Kernel.system command.join(' ')
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
def gemfile?
|
|
|
|
File.file?('Gemfile')
|
|
|
|
end
|
2011-08-31 18:03:48 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|