Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added examples

  • Loading branch information...
commit a49b96b339c525d7fd455e0ad4f6fe7b550c9543 1 parent 8f19810
@schacon schacon authored
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
Please sign in to comment.
Something went wrong with that request. Please try again.