create a default .gitignore file
authorDickson S. Guedes <[email protected]>
Mon, 19 Sep 2011 00:56:50 +0000 (21:56 -0300)
committerDickson S. Guedes <[email protected]>
Mon, 19 Sep 2011 00:56:50 +0000 (21:56 -0300)
when create a extension using skeleton it now creates a default
.gitignore file.

Fix #15.

lib/pgxn_utils/templates/root/.gitignore.tt [new file with mode: 0644]
spec/cli_spec.rb

diff --git a/lib/pgxn_utils/templates/root/.gitignore.tt b/lib/pgxn_utils/templates/root/.gitignore.tt
new file mode 100644 (file)
index 0000000..7ccbc9d
--- /dev/null
@@ -0,0 +1,8 @@
+results/
+*.so
+tmp/
+*.o
+regression.diffs
+regression.out
+/sql/<%= extension_name =>--*
+!/sql/<%= extension_name =>--*--*.sql
index aa346ed2109a238353b32ce5d34397e261eda374..590d291419b1f35f4e34eebdd85a2e8341b48add 100644 (file)
@@ -2,7 +2,12 @@ require File.expand_path('spec/spec_helper')
 
 describe PgxnUtils::CLI do
 
+  before(:all) do
+   system "mv META.json meta.json"
+  end
+
   after(:all) do
+   system "mv meta.json META.json"
     system "rm -rf /tmp/extension.*"
     system "rm -rf extension.*"
   end
@@ -62,7 +67,8 @@ describe PgxnUtils::CLI do
       extension = next_extension
       skeleton extension
 
-      Dir["#{extension}/**/*"].sort.should == [
+      Dir["#{extension}/**/{*,.gitignore}"].sort.should == [
+        "#{extension}/.gitignore",
         "#{extension}/META.json",
         "#{extension}/Makefile",
         "#{extension}/README.md",