Class: Rubycritic::BaseGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycritic/report_generators/base_generator.rb

Direct Known Subclasses

FileGenerator, IndexGenerator, LineGenerator

Constant Summary collapse

REPORT_DIR =
File.expand_path("tmp/rubycritic", Dir.getwd)
TEMPLATES_DIR =
File.expand_path("../templates", __FILE__)

Instance Method Summary collapse

Instance Method Details

#file_directoryObject

Raises:

  • (NotImplementedError)


11
12
13
# File 'lib/rubycritic/report_generators/base_generator.rb', line 11

def file_directory
  raise NotImplementedError.new("You must implement the file_directory method.")
end

#file_nameObject

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/rubycritic/report_generators/base_generator.rb', line 15

def file_name
  raise NotImplementedError.new("You must implement the file_name method.")
end

#file_pathnameObject



7
8
9
# File 'lib/rubycritic/report_generators/base_generator.rb', line 7

def file_pathname
  File.join(file_directory, file_name)
end

#get_bindingObject



31
32
33
# File 'lib/rubycritic/report_generators/base_generator.rb', line 31

def get_binding
  binding
end

#index_pathObject



27
28
29
# File 'lib/rubycritic/report_generators/base_generator.rb', line 27

def index_path
  File.join(REPORT_DIR, "index.html")
end

#renderObject

Raises:

  • (NotImplementedError)


19
20
21
# File 'lib/rubycritic/report_generators/base_generator.rb', line 19

def render
  raise NotImplementedError.new("You must implement the render file_name method.")
end

#stylesheet_pathObject



23
24
25
# File 'lib/rubycritic/report_generators/base_generator.rb', line 23

def stylesheet_path
  File.join(REPORT_DIR, "assets/stylesheets/application.css")
end