Skip to content

Commit

Permalink
added examples
Browse files Browse the repository at this point in the history
  • Loading branch information
schacon committed May 29, 2008
1 parent 8f19810 commit a49b96b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions examples/ex_add_commit.rb
@@ -0,0 +1,13 @@
require '../lib/grit'

count = 1
Dir.chdir("/Users/schacon/projects/atest") do
r = Grit::Repo.new('.')
while(count < 10) do
fname = Time.now.to_i.to_s + count.to_s
File.open(fname, 'w') { |f| f.write('hellor ' + fname) }
r.add(fname)
count += 1
end
r.commit_index('my commit')
end
2 changes: 1 addition & 1 deletion examples/ex_index.rb
@@ -1,4 +1,4 @@
require 'lib/grit'
require '../lib/grit'

count = 1
Dir.chdir("/Users/schacon/projects/atest") do
Expand Down

0 comments on commit a49b96b

Please sign in to comment.