Sha256: 54efa815455024cab70c615e3401c5b06f798ad88b837711eeee471414bf205d

Contents?: true

Size: 1.25 KB

Versions: 5

Compression:

Stored size: 1.25 KB

Contents

#! /usr/bin/env ruby

require 'bundler'

path_to_praxis = File.expand_path(File.dirname(File.dirname(__FILE__)))
path_to_loader = '%s/tasks/loader.thor' % path_to_praxis

load path_to_loader

class PraxisGenerator < Thor

  # Simple helper to go get the existing description for the real action
  # Usage must still be provided rather than retrieved (since it is not a 
  # straight "usage" from the remote action when arguments are defined )
  def self.desc_for( usage_string, klass, action_name, description_prefix="")
    action_name = action_name.to_s
    cmd = klass.commands[action_name]
    raise "Error, could not find description for #{klass.name}##{action_name}" if cmd.nil?
    desc usage_string, "#{description_prefix}#{cmd.description}"
  end

  desc_for "new APP_NAME", ::PraxisGen::App, :new
  def new(app_name)
    ::PraxisGen::App.start(['new' , app_name])
  end

  desc_for "example APP_NAME", ::PraxisGen::Example, :new
  def example(app_name)
    ::PraxisGen::Example.start(['new', app_name])
  end
  
  desc_for "generate APP_NAME", ::PraxisGen::Example, :new, "DEPRECATED!: "
  def generate(app_name)
    warn "This is a deprecated method.\nTo generate a hello world example, please use:\n  praxis example #{app_name} "
  end
end


PraxisGenerator.start(ARGV)

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
praxis-0.13.0 bin/praxis
praxis-0.11.2 bin/praxis
praxis-0.11.1 bin/praxis
praxis-0.11 bin/praxis
praxis-0.11pre bin/praxis