Class: Nrb::Commands::InsideGroup

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/nrb/commands/inside_group.rb

Direct Known Subclasses

Console, Destroy, Generate, Starter

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.desc_with_warning(description) ⇒ Object



10
11
12
# File 'lib/nrb/commands/inside_group.rb', line 10

def self.desc_with_warning(description)
  self.desc [description, warning].compact.join('. ')
end

.source_rootObject



14
15
16
# File 'lib/nrb/commands/inside_group.rb', line 14

def self.source_root
  File.expand_path('..', __dir__)
end

.warningObject



6
7
8
# File 'lib/nrb/commands/inside_group.rb', line 6

def self.warning
  'NOTE: Available inside a NinjaRuby project' unless Nrb.inside?
end

Instance Method Details

#check_inside?Boolean

Returns:

  • (Boolean)


18
19
20
21
22
23
# File 'lib/nrb/commands/inside_group.rb', line 18

def check_inside?
  return if Nrb.inside?
  klass_name = self.class.to_s.split('::').last
  say "You need to be inside a NinjaRuby folder to run the #{klass_name} command."
  exit
end