Module: Codeqa
- Defined in:
- lib/codeqa/utils/erb_sanitizer.rb,
lib/codeqa.rb,
lib/codeqa/runner.rb,
lib/codeqa/checker.rb,
lib/codeqa/version.rb,
lib/codeqa/installer.rb,
lib/codeqa/sourcefile.rb,
lib/codeqa/configuration.rb,
lib/codeqa/runner_decorator.rb,
lib/codeqa/checkers/check_erb.rb,
lib/codeqa/checkers/check_pry.rb,
lib/codeqa/utils/check_errors.rb,
lib/codeqa/checkers/check_yard.rb,
lib/codeqa/checkers/check_linkto.rb,
lib/codeqa/checkers/rubocop_full.rb,
lib/codeqa/checkers/rubocop_lint.rb,
lib/codeqa/checkers/check_conflict.rb,
lib/codeqa/checkers/check_erb_html.rb,
lib/codeqa/checkers/html_validator.rb,
lib/codeqa/checkers/pattern_checker.rb,
lib/codeqa/checkers/check_rspec_focus.rb,
lib/codeqa/checkers/check_ruby_syntax.rb,
lib/codeqa/checkers/rubocop_formatter.rb,
lib/codeqa/checkers/check_strange_chars.rb,
lib/codeqa/checkers/check_utf8_encoding.rb
Overview
Defined Under Namespace
Modules: Checkers
Classes: CheckErrors, Checker, Configuration, ErbSanitizer, Installer, Runner, RunnerDecorator, Sourcefile
Constant Summary
collapse
- CODEQA_HOME =
Pathname.new(File.join(File.dirname(__FILE__), '..')).realpath
- VERSION =
'0.5.0'
Class Method Summary
collapse
Class Method Details
.check(filename, options = {}) ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/codeqa.rb', line 15
def check(filename, options={})
options = { :silent_success => false, :silent => false }.merge(options)
runner = runner(filename)
if runner.success?
$stdout.puts(runner.display_result) unless options[:silent_success] || options[:silent]
true
else
$stderr.puts runner.display_result unless options[:silent]
false
end
end
|
.configuration ⇒ Object
81
82
83
|
# File 'lib/codeqa/configuration.rb', line 81
def configuration
@configuration ||= Configuration.new
end
|
85
86
87
88
|
# File 'lib/codeqa/configuration.rb', line 85
def configure
yield(configuration) if block_given?
Codeqa.register_checkers
end
|
.install(root = '.') ⇒ Object
.register_checkers ⇒ Object
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/codeqa.rb', line 32
def register_checkers
Codeqa::Runner.reset_checkers
configuration.enabled_checker.each do |checker|
begin
checker_klass = Codeqa::Checkers.const_get(checker)
next unless checker_klass.available?
Codeqa::Runner.register_checker checker_klass
rescue
"checker <#{checker}> not known"
end
end
end
|
.runner(filename) ⇒ Object