require 'transcriptic/base_generator' module Transcriptic class ProjectGenerator < BaseGenerator argument :name class_option :package, type: :string, default: "org.autoprotocol.unclaimed" class_option :author, type: :string, default: "John Appleseed" class_option :email, type: :string, default: "author@example.edu" class_option :description, type: :string, default: false def generate empty_directory target.join('app') empty_directory target.join('project') empty_directory target.join('logs') template 'app/Main.erb', target.join('app/Main.scala') template 'project/Build.erb', target.join('project/Build.scala') copy_file 'project/build.properties', target.join('project/build.properties') copy_file 'project/plugins.sbt', target.join('project/plugins.sbt') copy_file 'README.md', target.join('README.md') template 'LICENSE.erb', target.join('LICENSE') template 'Labfile.erb', target.join('Labfile') Transcriptic::DependenciesGenerator.new([File.join(Dir.pwd, name), []], options).invoke_all end def autoprotocol_version Transcriptic::AUTOPROTOCOL_VERSION end def description options[:description] end def package options[:package] end def author options[:author] end def email options[:email] end def author? not (options[:author] == "John Appleseed") end def copyright_year Time.now.year end end end