Class: Lanes::Command::NamedCommand

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/lanes/command/named_command.rb

Direct Known Subclasses

App, GenerateModel, GenerateScreen, GenerateView

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name.



9
10
11
# File 'lib/lanes/command/named_command.rb', line 9

def class_name
  @class_name
end

#client_dirObject (readonly)

Returns the value of attribute client_dir.



9
10
11
# File 'lib/lanes/command/named_command.rb', line 9

def client_dir
  @client_dir
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



9
10
11
# File 'lib/lanes/command/named_command.rb', line 9

def namespace
  @namespace
end

Class Method Details

.source_rootObject



11
12
13
# File 'lib/lanes/command/named_command.rb', line 11

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

Instance Method Details

#load_namespaceObject



15
16
17
18
# File 'lib/lanes/command/named_command.rb', line 15

def load_namespace
    @namespace  = options[:namespace] || Command.load_current_extension.identifier
    raise Thor::Error("Unable to locate Lanes environment") unless @namespace
end

#set_variablesObject



20
21
22
23
# File 'lib/lanes/command/named_command.rb', line 20

def set_variables
    @class_name = name.classify
    @client_dir = "client/#{namespace}"
end