Sha256: 3adb0d33a5be83b0061111fb73cb86f68bc8da9728ceadc4e67781e43428c9fa

Contents?: true

Size: 1.27 KB

Versions: 2

Compression:

Stored size: 1.27 KB

Contents

# Git

TODO: Write a gem description

## Installation

Add this line to your application's Gemfile:

    gem 'git'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install git

## Usage

Create a file `pre-receive` at `.git/hooks` with the following content:

```ruby
#!/usr/bin/env ruby

require 'git_hook-pre_receive'
parser = Git::PreReceiveHookParser.new($stdin.read)
parser.files
```

And do with it whatever you want.

## Example file

Create a file `pre-receive` at `.git/hooks` with the following content:

```ruby
#!/usr/bin/env ruby

require 'git_hook-pre_receive'
require 'pac'

class PacFileSyntaxChecker
  def check(files)
    files.each do |f|
      begin
        PAC.load f.content
      rescue
        $stderr.puts "Syntax error found in #{f.name}. Please check files locally again, fix the error and send update via git."
        exit 1
      end
    end
  end
end

parser = Git::PreReceiveHookParser.new($stdin.read)
PacFileSyntaxChecker.new.check(parser.files)
```

## Contributing

1. Fork it ( http://github.com/<my-github-username>/git/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
git_hook-pre_receive-0.1.0 README.md
git_hook-pre_receive-0.0.2 README.md