Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changing README

  • Loading branch information...
commit 2cfa1e1596ad9d390f21a4631bbe7be4dafd8aca 1 parent cf2bbe1
@guedes guedes authored
Showing with 122 additions and 23 deletions.
  1. +20 −23 README.md
  2. +102 −0 Rakefile
View
43 README.md
@@ -4,9 +4,7 @@ pgxn utils
What is it?
--------
-It aims to be a set of task that aims 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's a WIP but very functional. Please use it and help me improve 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.
How to install it?
------------------
@@ -20,11 +18,11 @@ It is all about tasks. Let's see what tasks we have:
$ pgxn_utils help
Tasks:
- pgxn_utils bundle [extension_name] # Bundles an extension
- pgxn_utils change [extension_name] # Change META's attributes in current extension
+ pgxn_utils bundle [extension_name] # Bundles an extension.
+ pgxn_utils change [extension_name] # Change META's attributes in current extension.
pgxn_utils help [TASK] # Describe available tasks or one specific task
- pgxn_utils skeleton extension_name # Creates an extension skeleton in current directory
-
+ pgxn_utils release filename # Release a extension
+ pgxn_utils skeleton extension_name # Creates an extension skeleton in current directory.
# Creating a new extension
@@ -47,11 +45,9 @@ Thats it! Just start coding! ":)
Well suppose you want to change the default maintainer's name and the license, well just do:
$ pgxn_utils change my_cool_extension --maintainer "Dickson Guedes" --license bsd
- exist my_cool_extension
- identical my_cool_extension/my_cool_extension.control
- conflict my_cool_extension/META.json
- Overwrite /home/guedes/extensions/my_cool_extension/META.json? (enter "h" for help) [Ynaqdh] d
- {
+ conflict META.json
+ Overwrite /tmp/my_cool_extension/META.json? (enter "h" for help) [Ynaqdh] d
+ {
"name": "my_cool_extension",
"abstract": "A short description",
"description": "A long description",
@@ -79,12 +75,9 @@ Well suppose you want to change the default maintainer's name and the license, w
}
}
Retrying...
- Overwrite /home/guedes/extensions/my_cool_extension/META.json? (enter "h" for help) [Ynaqdh]
- force my_cool_extension/META.json
- identical my_cool_extension/Makefile
- ...
- ...
- ...
+ Overwrite /tmp/my_cool_extension/META.json? (enter "h" for help) [Ynaqdh] Y
+ force META.json
+ identical my_cool_extension.control
It will wait you decide what to do.
@@ -93,8 +86,10 @@ For all switches that you can use with *change*, type:
$ pgxn_utils help change
Usage:
pgxn_utils change [extension_name]
-
+
Options:
+ -p, [--target=TARGET] # Define the target directory
+ # Default: .
-m, [--maintainer=MAINTAINER] # Maintainer's name <maintainer@email>
-a, [--abstract=ABSTRACT] # Defines a short description to abstract
-l, [--license=LICENSE] # The extension license.
@@ -103,7 +98,8 @@ For all switches that you can use with *change*, type:
-b, [--generated-by=GENERATED_BY] # Name of extension's generator
-t, [--tags=one two three] # Defines extension's tags
-r, [--release-status=RELEASE_STATUS] # Initial extension's release status
-
+
+ Change META's attributes in current extension.
# Bundling and Releasing!
@@ -120,15 +116,16 @@ and release it:
Enter your PGXN username: guedes
Enter your PGXN password: ******
Trying to release my_cool_extension-0.0.1.zip ... released successfully!
- Visit: http://manager.pgxn.org/distributions/my_cool_extension/0.0.1
+ Visit: https://manager.pgxn.org/distributions/my_cool_extension/0.0.1
You can export `PGXN_USER` and `PGXN_PASSWORD` environment variables to avoid
type username and password everytime.
# Working in progress
-* support to [git](http://git-scm.org)
-* support to proxy
+* [git](http://git-scm.org) support
+* proxy support
+* custom templates
Copyright and License
---------------------
View
102 Rakefile
@@ -3,6 +3,10 @@ require 'bundler'
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'`
+end
+
desc "Run RSpec"
RSpec::Core::RakeTask.new do |t|
t.verbose = false
@@ -15,4 +19,102 @@ task :ctag do
system("ctags -R --exclude=.git --exclude=log *")
end
+desc "Generate README.md"
+task :generate_readme do
+ rm_r "/tmp/my_cool_extension" if File.exist?("/tmp/my_cool_extension")
+ readme = File.new("README.md.new", 'w')
+ readme.puts <<-README
+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.
+
+How to install it?
+------------------
+
+ gem install pgxn_utils
+
+How it works?
+-------------
+
+It is all about tasks. Let's see what tasks we have:
+
+ $ pgxn_utils help
+#{format_cmd_output("help")}
+
+# Creating a new extension
+
+ $ pgxn_utils skeleton my_cool_extension
+#{format_cmd_output("skeleton my_cool_extension -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:
+
+ $ 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
+#{format_cmd_output("help change")}
+
+# Bundling and Releasing!
+
+Well, since you finished your work you can bundle it to send to [PGXN](http://pgxn.org).
+
+Bundle it:
+
+ $ pgxn_utils bundle my_cool_extension
+ Extension generated at: /home/guedes/extensions/my_cool_extension-0.0.1.zip
+
+and release it:
+
+ $ 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!
+ Visit: https://manager.pgxn.org/distributions/my_cool_extension/0.0.1
+
+You can export `PGXN_USER` and `PGXN_PASSWORD` environment variables to avoid
+type username and password everytime.
+
+# Working in progress
+
+* [git](http://git-scm.org) support
+* proxy support
+* custom templates
+
+Copyright and License
+---------------------
+
+Copyright (c) 2011 Dickson S. Guedes.
+
+This module is free software; you can redistribute it and/or modify it under
+the [PostgreSQL License](http://www.opensource.org/licenses/postgresql).
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose, without fee, and without a written agreement is
+hereby granted, provided that the above copyright notice and this paragraph
+and the following two paragraphs appear in all copies.
+
+In no event shall Dickson S. Guedes be liable to any party for direct,
+indirect, special, incidental, or consequential damages, including lost
+profits, arising out of the use of this software and its documentation, even
+if Dickson S. Guedes has been advised of the possibility of such damage.
+
+Dickson S. Guedes specifically disclaims any warranties, including, but not
+limited to, the implied warranties of merchantability and fitness for a
+particular purpose. The software provided hereunder is on an "as is" basis,
+and Dickson S. Guedes has no obligations to provide maintenance, support,
+updates, enhancements, or modifications.
+ README
+end
task :default => :spec
Please sign in to comment.
Something went wrong with that request. Please try again.