Sha256: 7e220a44b5a982485b3b67768a3c61669b2932d465febc70ac05ab3f33d4b5b4

Contents?: true

Size: 899 Bytes

Versions: 1

Compression:

Stored size: 899 Bytes

Contents

require_relative 'model_attribute'

module Lanes
    module Command

        class GenerateView < NamedCommand
            OPTIONS ||= {
              namespace: nil,
              screen: 'global'
            }
            class_options( OPTIONS )

            # desc "foo bar"
            # option :from, :required => true

            def create_screen
                template "client/views/View.coffee",   "#{client_dir}/#{name.classify}.coffee"
                template "spec/client/views/ViewSpec.coffee", \
                  "#{spec_dir}/views/#{class_name}Spec.coffee"
            end

          private

            def client_dir
                if options[:screen] == 'global'
                    "client/#{namespace}/views"
                else
                    "client/#{namespace}/screens/#{options[:screen].dasherize}"
                end
            end
        end

    end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lanes-0.1.2 lib/lanes/command/generate_view.rb