Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 31 lines (21 sloc) 1.025 kB
56a91e7 @bkeepers Initial implementation of git adapter
authored
1 = adapter-git
2
3 Git adapter for adapter gem.
4
5 require 'adapter/git'
6
7 repo = Grit::Repo.init('path/to/repo')
decf810 @bkeepers Add :path option to use as a key prefix
authored
8 adapter = Adapter[:git].new(repo, :branch => 'data', :path => 'db/records')
56a91e7 @bkeepers Initial implementation of git adapter
authored
9 adapter.clear
10
11 adapter.write('foo', 'bar')
12 puts 'Should be bar: ' + adapter.read('foo').inspect
13
14 adapter.delete('foo')
15 puts 'Should be nil: ' + adapter.read('foo').inspect
16
17 adapter.write('foo', 'bar')
18 adapter.clear
19 puts 'Should be nil: ' + adapter.read('foo').inspect
20
21 puts 'Should be bar: ' + adapter.fetch('foo', 'bar')
22
23 See examples/ or specs/ for more usage.
24
25 == Note on Patches/Pull Requests
26
27 * Fork the project.
28 * Make your feature addition or bug fix.
29 * Add tests for it. This is important so we don't break it in a future version unintentionally.
30 * Commit, do not mess with Rakefile, version, or history. (if you want to have your own version, that is fine, but bump version in a commit by itself so we can ignore when we pull)
31 * Send us a pull request. Bonus points for topic branches.
Something went wrong with that request. Please try again.