Sha256: 16c9e5472e1a0c557b600063eae01bf7bab49b5cde4674c5232b6e3911e1c246

Contents?: true

Size: 1.22 KB

Versions: 4

Compression:

Stored size: 1.22 KB

Contents

require 'thor/group'
module Nakor
  module Generators
    class App < Thor::Group
      ASSET_FILES = %W{
        bk_default.png
        btn_about.png
        btn_about_over.png
        btn_help.png
        btn_help_over.png
        btn_play.png
        btn_play_over.png
        btn_settings.png
        btn_settings_over.png
        splash_screen.png
      }

      TEMPLATE_FILES = %W{
        about.lua
        build.settings
        config.lua
        director.lua
        help.lua
        init_buttons.lua
        loadmenu.lua
        main.lua
        menu.lua
        play.lua
        radlib.lua
        README
        settings.lua
        ui.lua
      }

      include Thor::Actions

      argument :app_name, :type => :string

      def self.source_root
        File.dirname(__FILE__) + "/corona-game-template"
      end

      def create_group
        empty_directory(app_name)
      end

      def copy_source_files
        TEMPLATE_FILES.each do |f|
          template f, "#{app_name}/#{f}"
        end
      end

      def copy_asset_files
        ASSET_FILES.each do |f|
          copy_file f, "#{app_name}/#{f}"
        end
      end

      def done
        puts "Successfully generated '#{app_name}'"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nakor-0.0.4 lib/nakor/generators/app.rb
nakor-0.0.3 lib/nakor/generators/app.rb
nakor-0.0.2 lib/nakor/generators/app.rb
nakor-0.0.1 lib/nakor/generators/app.rb