Sha256: 8617dd385785df4802d44f231dae803c25e377bbf618fe4d1e15d7f7cb915730

Contents?: true

Size: 1012 Bytes

Versions: 1

Compression:

Stored size: 1012 Bytes

Contents

#!/usr/bin/env ruby

$: << File.expand_path(File.join(File.dirname(__FILE__), "../lib"))

begin
  require 'rubikon'
  require 'ninjs'
rescue LoadError
  require 'rubygems'
  require 'rubikon'
  require 'ninjs'
end

class NinjsConsole < Rubikon::Application::Base
  def initialize
    @directory = '/'
  end
  
  option :version
  option :v => :version
  default do
    if version.given?
      time = Time.now
      copyright_year = time.year == 2010 ? '2010' : '2010-' << time.year
      puts 'ninjs ' << Ninjs.version
      puts "Copyright (c) #{copyright_year} Dayton Nolan"
      puts "Released under the MIT License"
    else
      Ninjs::Command.help
    end
  end
  
  command :compile do
    Ninjs::Command.compile
  end
  
  command :watch do
    Ninjs::Command.watch
  end
  
  command :import do
    Ninjs::Command.import
  end
  
  option :directory, :dir do
    @directory = dir
  end
  option :p => :directory
  command :create, :app_name do
    Ninjs::Command.create(app_name, @directory)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ninjs-0.10.2 bin/ninjs