Sha256: 8e57833f7e951a58525095f1d7c0ba4d9adcefa2b990ddbf990c40bfe1d86756

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

require_relative 'model_attribute'

module Lanes
    module Command

        class GenerateScreen < NamedCommand
            OPTIONS = {
                title:       '',
                description: '',
                icon:        '',
                group_id:    '',
                model_class: '',
                namespace: nil
            }
            class_options( OPTIONS )

            def set_defaults
                options[:title] = name.titleize if options[:title].blank?
            end

            def create_screen
                template "lib/namespace/screen.rb",      "lib/#{namespace}/#{name}_screen.rb"
                template "client/screens/index.js",      "#{client_dir}/screens/#{name}/index.js"
                template "client/screens/styles.scss",   "#{client_dir}/screens/#{name}/index.scss"
                template "client/screens/Screen.coffee", "#{client_dir}/screens/#{name}/#{name.classify}.coffee"
                template "client/screens/layout.html",   "#{client_dir}/screens/#{name}/layout.html"
            end

        end
    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lanes-0.0.5 lib/lanes/command/generate_screen.rb