Class: Lanes::Command::NamedCommand

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

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

#identifierObject (readonly)

Returns the value of attribute identifier.



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

def identifier
  @identifier
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

#spec_dirObject (readonly)

Returns the value of attribute spec_dir.



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

def spec_dir
  @spec_dir
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
19
20
# File 'lib/lanes/command/named_command.rb', line 15

def load_namespace
    @namespace  = options[:namespace] ||
      Command.load_current_extension(raise_on_fail:true)
        .identifier.underscore.camelize
    @identifier = @namespace.underscore.dasherize
end

#set_variablesObject



22
23
24
25
26
# File 'lib/lanes/command/named_command.rb', line 22

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