class Nrb::Commands::Inside

This class fires a task that checks if the following command is done inside the root of the project.

Public Instance Methods

ensure_inside_root() click to toggle source
# File lib/nrb/commands/base/inside.rb, line 6
def ensure_inside_root
  return true if Nrb.inside?
  fail_outside_root
end

Private Instance Methods

fail_outside_root() click to toggle source
# File lib/nrb/commands/base/inside.rb, line 13
def fail_outside_root
  command = self.class.to_s.split('::').last

  fail Nrb::OutsideRootError,
    'You need to be inside a NinjaRuby folder ' \
    "to run the #{command} command."
end