From a28ea56061e0e47c632f95f104473e5bc9f3aeeb Mon Sep 17 00:00:00 2001 From: Eric Davis Date: Mon, 26 Apr 2010 08:33:10 -0700 Subject: [PATCH] Added simple command to install a Redmine plugin from a common directory. --- lib/redmine_tasks/main.thor | 26 ++++++++++++++++++++++++++ setup.rb | 2 ++ 2 files changed, 28 insertions(+) create mode 100644 lib/redmine_tasks/main.thor create mode 100644 setup.rb diff --git a/lib/redmine_tasks/main.thor b/lib/redmine_tasks/main.thor new file mode 100644 index 0000000..5b61181 --- /dev/null +++ b/lib/redmine_tasks/main.thor @@ -0,0 +1,26 @@ +# module: redmine_tasks + +module RedmineTasks + class Base < Thor + include Thor::Actions + + def self.source_root + File.dirname(__FILE__) + end + end + + class PluginInstall < Base + desc "install_from_file", "Install a Redmine plugin from file" + def install_from_file(plugin_name) + + dir = "/home/edavis/dev/redmine/plugins/#{plugin_name}" + if File.exists?(dir) + directory(dir, plugin_name) + else + raise "No such file or directory - #{dir}" + end + end + end +end + + diff --git a/setup.rb b/setup.rb new file mode 100644 index 0000000..5c1fb71 --- /dev/null +++ b/setup.rb @@ -0,0 +1,2 @@ +# TODO: can't find packaging guidelines for this right now +system("thor install lib/redmine_tasks")