done


On Mon, Feb 11, 2013 at 10:11 PM, Josh Lubaway <notifications@github.com>wrote:

> In test/integration_test.rb:
>
> > +  def install
> > +    sh "ruby -I #{Bundler.root}/lib #{Bundler.root}/bin/pre-commit install"
> > +    make_lib_available_for_hook
> > +    sh "git commit -m Initial --allow-empty" # or travis fails with: No HEAD commit to compare with
> > +  end
> > +
> > +  def make_lib_available_for_hook
> > +    hook_file = PreCommit::Cli::PRE_COMMIT_HOOK_PATH
> > +    anchor = "-r pre-commit"
> > +    content = read(hook_file)
> > +    raise unless content.include?(anchor)
> > +    write(hook_file, content.gsub(anchor, "#{anchor} -I #{Bundler.root.join("lib")}"))
> > +  end
> > +
> > +  def ensure_folder(folder)
> > +    `mkdir -p #{folder}` unless File.exist?(folder)
>
> FileUtils.mkdir_p(folder)
>
>  —
> Reply to this email directly or view it on GitHub<https://github.com/jish/pre-commit/pull/48/files#r2974110>.
>
>