Sha256: cb7142a81f60678cab025e8668df3608717fc769a7d9e4ca8317227b615a556f

Contents?: true

Size: 1.33 KB

Versions: 2

Compression:

Stored size: 1.33 KB

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'rubigen'

require 'rubigen/scripts/generate'

def find_project_file(dir=nil)
  dir ||= Dir.pwd
  
  while dir.length > 1
    files= Dir.glob(File.join(dir, '*.jsproj'))
    if (1==files.length)
      return files.first
    end
    dir = File.dirname(dir)
  end
  
end


case ARGV[0]
when 'app'
  # pull off app "command"
  ARGV.shift
  
  source = RubiGen::PathSource.new(:application, 
    File.join(File.dirname(__FILE__), "../app_generators"))
  RubiGen::Base.reset_sources
  RubiGen::Base.append_sources source

  RubiGen::Scripts::Generate.new.run(ARGV, :generator => 'coherent')

when 'demo'
  # pull off app "command"
  ARGV.shift
  
  source = RubiGen::PathSource.new(:application, 
    File.join(File.dirname(__FILE__), "../demo_generators"))
  RubiGen::Base.reset_sources
  RubiGen::Base.append_sources source

  generator= ARGV.shift
  RubiGen::Scripts::Generate.new.run(ARGV, :generator => generator)
  
when 'plugin'
  require File.join(File.dirname(__FILE__), "../lib/plugin")
  ARGV.shift
  Coherent::Commands::Plugin.parse!
else
  PROJECT_FILE= find_project_file
  if !PROJECT_FILE
    puts "Could not determine project root."
    exit 1
  end
  
  APP_ROOT= File.dirname(PROJECT_FILE)

  RubiGen::Base.use_component_sources! [:coherent, :test_unit]
  RubiGen::Scripts::Generate.new.run(ARGV)
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
coherent-0.6.10 bin/coherent
coherent-0.6.9 bin/coherent