From a34139051089e57a1f4d270628ca46bf8935a84f Mon Sep 17 00:00:00 2001 From: Adam Sanderson Date: Sun, 14 Nov 2010 13:39:28 -0800 Subject: [PATCH] Adding templates for customizing Qwandry. --- bin/qw | 9 +++++++-- templates/README | 6 ++++++ templates/init.rb | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 templates/README create mode 100644 templates/init.rb diff --git a/bin/qw b/bin/qw index 8b832a6..6813fa4 100755 --- a/bin/qw +++ b/bin/qw @@ -22,9 +22,9 @@ opts = OptionParser.new do |opts| opts.separator "Additional Commands" - opts.on("--paths", "Prints all repositories and their paths") do |editor| + opts.on("--paths", "Prints all repositories and their paths") do @qwandry.repositories.each do |label, entries| - puts label + puts "#{label} #{"[default]" if @qwandry.active.include? label}" entries.each do |repo| puts "\t#{repo.path} (#{repo.class.to_s.split('::').last})" end @@ -33,6 +33,11 @@ opts = OptionParser.new do |opts| exit(0) end + opts.on("--customize", "Create files for customizing Qwandry") do + + exit(0) + end + opts.on_tail("-h", "--help", "Show this message") do puts opts exit diff --git a/templates/README b/templates/README new file mode 100644 index 0000000..cafc760 --- /dev/null +++ b/templates/README @@ -0,0 +1,6 @@ +These files will let you customize Qwandry to your heart's desire. +Take a look at `init.rb`, there are examples for a variety of common +languages and package systems. + +Qwandry will also run just fine without these files, so feel free to delete +them. \ No newline at end of file diff --git a/templates/init.rb b/templates/init.rb new file mode 100644 index 0000000..3fcdf4f --- /dev/null +++ b/templates/init.rb @@ -0,0 +1,49 @@ +# ~/.qwandry/init.rb +# +# This file lets you configure where and how Qwandry looks for packages to open. +# +# To learn more about Qwandry, take a look at the source with qwandry! +# qw qwandry +# +# You can uncomment the indented code to try it out. + +# == Adding Projects +# +# If you keep all your projects in the home directory under projects, +# you can tell Qwandry to search there. +# +# add :projects, "~/Projects/" + +# == Setting Defaults +# To make `projects` a default search path, activate `projects`: +# +# activate :projects +# +# If you don't use ruby, you can de-activate it: +# +# deactivate :ruby + +# == Common Repositories +# Below are some common configurations you might find useful, these may vary +# from system to system. + +# = Haskel +# Open Cabal packages: +# add :ghc, "~/.cabal/lib" +# Open Haskel system libraries: +# add :ghc, "/usr/local/lib/ghc/" + +# = Python +# Open python standard libraries: +# add :python, "/usr/lib/python2.6/", Qwandry::LibraryRepository + +# = Ruby +# Qwandry comes set up for ruby by default, however you may want to be able to +# quickly access the ruby sources. +# +# If you installed ruby with `rvm`, your path might be something like this: +# add :cruby, "~/.rvm/src/ruby-1.9.1-p378/" + +# = Javascript / Node +# Edit node.js and npm managed libraries: +# add :node, "/usr/local/lib/node/" \ No newline at end of file