Browse files

added examples

  • Loading branch information...
1 parent 8f19810 commit a49b96b339c525d7fd455e0ad4f6fe7b550c9543 @schacon committed May 29, 2008
Showing with 14 additions and 1 deletion.
  1. +13 −0 examples/ex_add_commit.rb
  2. +1 −1 examples/ex_index.rb
View
13 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
View
2 examples/ex_index.rb
@@ -1,4 +1,4 @@
-require 'lib/grit'
+require '../lib/grit'
count = 1
Dir.chdir("/Users/schacon/projects/atest") do

0 comments on commit a49b96b

Please sign in to comment.