penchant/lib/penchant/dot_penchant.rb
2011-10-13 10:01:18 -04:00

28 lines
520 B
Ruby

module Penchant
class DotPenchant
class << self
def run(env = nil, deployment = false)
dot_penchant = new
dot_penchant.run(env)
dot_penchant
end
end
def run(env = nil, deployment = false)
instance_eval(File.read('.penchant'))
end
def rake(*tasks)
command = [ "rake", *tasks ]
command.unshift("bundle exec") if gemfile?
Kernel.system command.join(' ')
end
private
def gemfile?
File.file?('Gemfile')
end
end
end