Class: Shakapacker::Doctor
- Inherits:
-
Object
- Object
- Shakapacker::Doctor
- Defined in:
- lib/shakapacker/doctor.rb
Defined Under Namespace
Classes: Reporter
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#issues ⇒ Object
readonly
Returns the value of attribute issues.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
-
#initialize(config = nil, root_path = nil) ⇒ Doctor
constructor
A new instance of Doctor.
- #run ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(config = nil, root_path = nil) ⇒ Doctor
Returns a new instance of Doctor.
10 11 12 13 14 15 16 |
# File 'lib/shakapacker/doctor.rb', line 10 def initialize(config = nil, root_path = nil) @config = config || Shakapacker.config @root_path = root_path || (defined?(Rails) ? Rails.root : Pathname.new(Dir.pwd)) @issues = [] @warnings = [] @info = [] end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/shakapacker/doctor.rb', line 8 def config @config end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
8 9 10 |
# File 'lib/shakapacker/doctor.rb', line 8 def info @info end |
#issues ⇒ Object (readonly)
Returns the value of attribute issues.
8 9 10 |
# File 'lib/shakapacker/doctor.rb', line 8 def issues @issues end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
8 9 10 |
# File 'lib/shakapacker/doctor.rb', line 8 def root_path @root_path end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
8 9 10 |
# File 'lib/shakapacker/doctor.rb', line 8 def warnings @warnings end |
Instance Method Details
#run ⇒ Object
18 19 20 21 |
# File 'lib/shakapacker/doctor.rb', line 18 def run perform_checks report_results end |
#success? ⇒ Boolean
23 24 25 |
# File 'lib/shakapacker/doctor.rb', line 23 def success? @issues.empty? end |