Class: BestPracticeProject::RailsBestPracticesHandler

Inherits:
BaseHandler
  • Object
show all
Defined in:
lib/best_practice_project/rails_best_practices_handler.rb

Instance Method Summary collapse

Methods inherited from BaseHandler

#initialize, #rails?

Constructor Details

This class inherits a constructor from BestPracticeProject::BaseHandler

Instance Method Details

#commandObject



2
3
4
# File 'lib/best_practice_project/rails_best_practices_handler.rb', line 2

def command
  "bundle exec rails_best_practices"
end

#executeObject



10
11
12
# File 'lib/best_practice_project/rails_best_practices_handler.rb', line 10

def execute
  system(command)
end

#generate_configObject



6
7
8
# File 'lib/best_practice_project/rails_best_practices_handler.rb', line 6

def generate_config
  system("bundle exec rails_best_practices -g")
end

#installed?Boolean



14
15
16
17
18
19
20
21
# File 'lib/best_practice_project/rails_best_practices_handler.rb', line 14

def installed?
  return false unless rails?

  require "rails_best_practices"
  true
rescue LoadError
  false
end