module Hoe::Travis

def define_travis_tasks

def define_travis_tasks
  desc "Runs your tests for travis"
  task :travis => %w[test]
  namespace :travis do
    desc "Run by travis-ci after running the default checks"
    task :after => %w[
      travis:fake_config
      check_manifest
    ]
    desc "Run by travis-ci before running the default checks"
    task :before => %w[
      install_plugins
      check_extra_deps
    ]
    desc "Runs travis-lint on your .travis.yml"
    task :check do
      abort unless check_travis_yml '.travis.yml'
    end
    desc "Disables the travis-ci hook"
    task :disable do
      travis_disable
    end
    desc "Brings .travis.yml up in your EDITOR then checks it on save"
    task :edit do
      Tempfile.open 'travis.yml' do |io|
        io.write File.read '.travis.yml'
        io.rewind
        ok = travis_yml_edit io.path
        travis_yml_write io.path if ok
      end
    end
    desc "Enables the travis-ci hook"
    task :enable do
      travis_enable
    end
    desc "Triggers the travis-ci hook"
    task :force do
      travis_force
    end
    task :fake_config do
      travis_fake_config
    end
    desc "Generates a new .travis.yml and allows you to customize it with your EDITOR"
    task :generate do
      Tempfile.open 'travis.yml' do |io|
        io.write travis_yml_generate
        io.rewind
        ok = travis_yml_edit io.path
        travis_yml_write io.path if ok
      end
    end
  end
end