Sha256: dc44eab03f224175de9c087d25ff5f7773a1e04d807decf7c728e0c165370a47

Contents?: true

Size: 475 Bytes

Versions: 1

Compression:

Stored size: 475 Bytes

Contents

module BeforeHook
  # The `before` hook for rake tasks. 
  # The code was taken from https://github.com/guillermo/rake-hooks/blob/master/lib/rake/hooks.rb#L2
  def before(*task_names, &new_task)
    task_names.each do |task_name|
      old_task = Rake.application.instance_variable_get('@tasks').delete(task_name.to_s)
      desc old_task.full_comment
      task task_name => old_task.prerequisites do
        new_task.call
        old_task.invoke
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bower-rails-0.7.2 lib/tasks/helpers/before_hook.rb