Sha256: f706a86a042863556f30d5dc26b7115306e814e1c241f5d0e9456304ff95440f

Contents?: true

Size: 1.55 KB

Versions: 5

Compression:

Stored size: 1.55 KB

Contents

#!/usr/bin/env ruby

current_path = File.expand_path(File.dirname(__FILE__))

require "#{current_path}/../lib/ginatra"

module Ginatra::Executable
  HELP = <<HELP
Usage: ginatra [ version | server <options> <command> |
                 daemon <command> | directory <command> <args> ]

Ginatra Commands:
  version - Pretty Self explanatory. Print version number and exit

Ginatra Server Commands:
  start   - Start the Ginatra HTTP Server.
  stop    - Stop the Ginatra Server.
  status  - How's your Ginatra Server holding up?

Ginatra Daemon Commands:
  start   - Starts the Git Daemon servimg Ginatra's Repositories
  stop    - Stops the Git Daemon
  restart - Restarts the Git Daemon
  status  - Is the Git Daemon on or off?


Ginatra Directory Commands:
  add     - Adds the <globs> to the array of dirs that Ginatra
              looks in for repositories.
  remove  - Removes the <globs> from the aforementioned array.
  list    - Lists the globs Ginatra looks in for repositories

HELP

  @current_path = File.expand_path(File.dirname(__FILE__))

  def self.daemon(*args)
    system("#{@current_path}/ginatra-daemon #{args.join(" ")}")
  end

  def self.directory(*args)
    system("#{@current_path}/ginatra-directory #{args.join(" ")}")
  end

  def self.server(*args)
    system("#{@current_path}/ginatra-server #{args.join(" ")}")
  end

  def self.version(*args)
    puts Ginatra::VERSION
  end
end

command, *args = ARGV[0], ARGV[1..-1]
if command !~ /^(version|daemon|directory|server)$/
  puts Ginatra::Executable::HELP
  exit
end
Ginatra::Executable.send(command, *args)

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
lenary-ginatra-2.0.2 bin/ginatra
ginatra-2.1.1 bin/ginatra
ginatra-2.1.0 bin/ginatra
ginatra-2.0.2 bin/ginatra
ginatra-2.0.1 bin/ginatra