class RailsBestPractices::Core::Error
Error
is the violation to rails best practice.
it indicates the filenname, line number and error message for the violation.
Attributes
git_commit[RW]
git_username[RW]
hg_commit[RW]
hg_username[RW]
type[R]
url[R]
Public Class Methods
new(options = {})
click to toggle source
Calls superclass method
# File lib/rails_best_practices/core/error.rb, line 12 def initialize(options = {}) super @type = options[:type] @url = options[:url] @git_commit = options[:git_commit] @git_username = options[:git_username] @hg_commit = options[:hg_commit] @hg_username = options[:hg_username] end
Public Instance Methods
first_line_number()
click to toggle source
# File lib/rails_best_practices/core/error.rb, line 26 def first_line_number line_number.split(',').first end
short_filename()
click to toggle source
# File lib/rails_best_practices/core/error.rb, line 22 def short_filename File.expand_path(filename)[File.expand_path(Core::Runner.base_path).size..-1].sub(%r{^/}, '') end