summaryrefslogtreecommitdiff
path: root/Rakefile
diff options
context:
space:
mode:
authorDickson S. Guedes2011-10-12 22:35:19 +0000
committerDickson S. Guedes2011-10-12 22:35:19 +0000
commit91ae5ef24352af905d6c8d530fbfaa28e1e15426 (patch)
tree66440e87fe9cb7a60d6c6a9d6113292218516a97 /Rakefile
parentda852cd006cfd841fddb78fb363a0c3fb315dfe2 (diff)
parentef10e820f22f190a2a16dfc06b15a7b6f645b7d4 (diff)
Merge pull request #23 from guedes/git-supportHEADmaster
Added git support.
Diffstat (limited to 'Rakefile')
-rw-r--r--Rakefile51
1 files changed, 39 insertions, 12 deletions
diff --git a/Rakefile b/Rakefile
index ba4e00d..67f775a 100644
--- a/Rakefile
+++ b/Rakefile
@@ -4,7 +4,7 @@ Bundler::GemHelper.install_tasks
require 'rspec/core/rake_task'
def format_cmd_output(cmd)
- `./bin/pgxn_utils #{cmd} | sed 's/^/ /' | sed 's/\[[0-9]*m//g'`
+ `./bin/pgxn-utils #{cmd} | sed 's/^/ /' | sed 's/\[[0-9]*m//g'`
end
desc "Run RSpec"
@@ -22,6 +22,7 @@ end
desc "Generate README.md"
task :generate_readme do
rm_r "/tmp/my_cool_extension" if File.exist?("/tmp/my_cool_extension")
+ rm_r "/tmp/my_cool_versioned_extension" if File.exist?("/tmp/my_cool_versioned_extension")
readme = File.new("README.md.new", 'w')
readme.puts <<-README
pgxn utils
@@ -30,40 +31,53 @@ pgxn utils
What is it?
--------
-It aims to be a set of task to help PostgreSQL extension's developers to focus more on the problem that they wants to solve than in the all structure and files and control files need to PGXS to build the extension.
+It aims to be a set of task to help PostgreSQL extension's developers to focus more on the problem that they wants to solve than in all structure and files and control files need to PGXS to build the extension.
How to install it?
------------------
+If you have pgxn client installed you can do:
+
+ pgxn install pgxn_utils
+
+Or you can install it by rubygems:
+
gem install pgxn_utils
How it works?
-------------
-It is all about tasks. Let's see what tasks we have:
+It is all about tasks. Let's see them:
- $ pgxn_utils help
+ $ pgxn-utils help
#{format_cmd_output("help")}
# Creating a new extension
- $ pgxn_utils skeleton my_cool_extension
+ $ pgxn-utils skeleton my_cool_extension
#{format_cmd_output("skeleton my_cool_extension -p /tmp")}
+You can start creating an extension with or without version control. By default `pgxn-utils`
+supports [git](http://git-scm.org) but it will not create a repository unless you use `--git`
+option in the skeleton task.
+
+ $ pgxn-utils skeleton my_cool_versioned_extension --git
+#{format_cmd_output("skeleton my_cool_versioned_extension --git -p /tmp")}
+
Thats it! Just start coding! ":)
# Changing something
-Well suppose you want to change the default maintainer's name and the license, well just do:
+Well suppose you want to change the default maintainer's name and the license, just do:
- $ pgxn_utils change my_cool_extension --maintainer "Dickson Guedes" --license bsd
+ $ pgxn-utils change my_cool_extension --maintainer "Dickson Guedes" --license bsd
#{format_cmd_output("change my_cool_extension -p /tmp --maintainer 'Dickson Guedes' --license bsd")}
It will wait you decide what to do.
For all switches that you can use with *change*, type:
- $ pgxn_utils help change
+ $ pgxn-utils help change
#{format_cmd_output("help change")}
# Bundling and Releasing!
@@ -72,12 +86,12 @@ Well, since you finished your work you can bundle it to send to [PGXN](http://pg
Bundle it:
- $ pgxn_utils bundle my_cool_extension
- Extension generated at: /home/guedes/extensions/my_cool_extension-0.0.1.zip
+ $ pgxn-utils bundle my_cool_extension
+ create /home/guedes/extensions/my_cool_extension-0.0.1.zip
and release it:
- $ pgxn_utils release my_cool_extension-0.0.1.zip
+ $ pgxn-utils release my_cool_extension-0.0.1.zip
Enter your PGXN username: guedes
Enter your PGXN password: ******
Trying to release my_cool_extension-0.0.1.zip ... released successfully!
@@ -86,9 +100,22 @@ and release it:
You can export `PGXN_USER` and `PGXN_PASSWORD` environment variables to avoid
type username and password everytime.
+# Git support
+
+You can start a new extension with git support calling `skeleton` task with
+`--git` flag, then in addition to create skeleton, `pgxn-utils` will initialize
+a git repository and do a initial commit.
+
+Once you have your extension in a git repository your `bundle` will use only the
+commited files to create the archive, but if your repository is dirty then `pgxn-utils`
+will hint you to commit or stash your changes, before bundle.
+
+You must be careful with new files not added to repository, because they will NOT
+be archived.
+
# Working in progress
-* [git](http://git-scm.org) support
+* improve [git](http://git-scm.org) support
* proxy support
* custom templates