Sha256: 1481ffba36747feaa552ae2461f43d28d01626a54cd592ddece226fd738ffe47

Contents?: true

Size: 914 Bytes

Versions: 11

Compression:

Stored size: 914 Bytes

Contents

module Lanes
    module Command

        class NamedCommand < Thor::Group
            include Thor::Actions

            argument :name

            attr_reader :namespace, :class_name, :client_dir, :spec_dir, :identifier

            def self.source_root
                Pathname.new(__FILE__).dirname.join("..","..","..","templates")
            end

            def load_namespace
                @identifier = extension.identifier
                @namespace  = options[:namespace] || @identifier.underscore.camelize
            end

            def set_variables
                @class_name = name.underscore.camelize
                @spec_dir   = "spec/#{identifier}"
                @client_dir = "client/#{identifier}"
            end

            protected

            def extension
                @extension ||= Command.load_current_extension(raise_on_fail:true)
            end
        end
    end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
lanes-0.8.3 lib/lanes/command/named_command.rb
lanes-0.7.0 lib/lanes/command/named_command.rb
lanes-0.6.1 lib/lanes/command/named_command.rb
lanes-0.6.0 lib/lanes/command/named_command.rb
lanes-0.5.6 lib/lanes/command/named_command.rb
lanes-0.5.5 lib/lanes/command/named_command.rb
lanes-0.5.0 lib/lanes/command/named_command.rb
lanes-0.4.0 lib/lanes/command/named_command.rb
lanes-0.3.0 lib/lanes/command/named_command.rb
lanes-0.1.9.5 lib/lanes/command/named_command.rb
lanes-0.1.9 lib/lanes/command/named_command.rb