Skip to content
This repository
Browse code

added examples

  • Loading branch information...
commit a49b96b339c525d7fd455e0ad4f6fe7b550c9543 1 parent 8f19810
Scott Chacon authored May 29, 2008
13  examples/ex_add_commit.rb
... ...
@@ -0,0 +1,13 @@
  1
+require '../lib/grit'
  2
+
  3
+count = 1
  4
+Dir.chdir("/Users/schacon/projects/atest") do
  5
+  r = Grit::Repo.new('.')
  6
+  while(count < 10) do
  7
+    fname = Time.now.to_i.to_s + count.to_s
  8
+    File.open(fname, 'w') { |f| f.write('hellor ' + fname) }
  9
+    r.add(fname)
  10
+    count += 1
  11
+  end
  12
+  r.commit_index('my commit')
  13
+end
2  examples/ex_index.rb
... ...
@@ -1,4 +1,4 @@
1  
-require 'lib/grit'
  1
+require '../lib/grit'
2 2
 
3 3
 count = 1
4 4
 Dir.chdir("/Users/schacon/projects/atest") do

0 notes on commit a49b96b

Please sign in to comment.
Something went wrong with that request. Please try again.