Class: RuboCop::Kata::Kit

Inherits:
Object
  • Object
show all
Defined in:
lib/rubocop/kata/kit.rb

Constant Summary collapse

SOURCE =
File.expand_path("../../../skills/rubocop-kata/SKILL.md", __dir__)
MISSING =
"the gem ships no skill at %s"

Instance Method Summary collapse

Constructor Details

#initialize(_root, io: $stdout) ⇒ Kit

Returns a new instance of Kit.



7
8
9
# File 'lib/rubocop/kata/kit.rb', line 7

def initialize(_root, io: $stdout)
  @io = io
end

Instance Method Details

#runObject



11
12
13
14
15
# File 'lib/rubocop/kata/kit.rb', line 11

def run
  return missing unless File.file?(SOURCE)
  @io.print(File.read(SOURCE))
  0
end