Class: Devformance::Configuration
- Inherits:
-
Object
- Object
- Devformance::Configuration
- Defined in:
- lib/devformance.rb
Constant Summary collapse
- VALID_FRAMEWORKS =
i[rspec minitest].freeze
Instance Attribute Summary collapse
-
#coverage_dir ⇒ Object
Returns the value of attribute coverage_dir.
-
#coverage_enabled ⇒ Object
Returns the value of attribute coverage_enabled.
-
#coverage_minimum_coverage ⇒ Object
Returns the value of attribute coverage_minimum_coverage.
-
#log_file_path ⇒ Object
Returns the value of attribute log_file_path.
-
#preferred_framework ⇒ Object
Returns the value of attribute preferred_framework.
-
#slow_query_threshold_ms ⇒ Object
Returns the value of attribute slow_query_threshold_ms.
Instance Method Summary collapse
- #coverage? ⇒ Boolean
- #framework_adapter ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
33 34 35 36 37 38 39 40 |
# File 'lib/devformance.rb', line 33 def initialize @log_file_path = "devformance.log" @slow_query_threshold_ms = 100 @preferred_framework = :rspec @coverage_enabled = true @coverage_dir = "coverage" @coverage_minimum_coverage = 80 end |
Instance Attribute Details
#coverage_dir ⇒ Object
Returns the value of attribute coverage_dir.
29 30 31 |
# File 'lib/devformance.rb', line 29 def coverage_dir @coverage_dir end |
#coverage_enabled ⇒ Object
Returns the value of attribute coverage_enabled.
28 29 30 |
# File 'lib/devformance.rb', line 28 def coverage_enabled @coverage_enabled end |
#coverage_minimum_coverage ⇒ Object
Returns the value of attribute coverage_minimum_coverage.
29 30 31 |
# File 'lib/devformance.rb', line 29 def coverage_minimum_coverage @coverage_minimum_coverage end |
#log_file_path ⇒ Object
Returns the value of attribute log_file_path.
28 29 30 |
# File 'lib/devformance.rb', line 28 def log_file_path @log_file_path end |
#preferred_framework ⇒ Object
Returns the value of attribute preferred_framework.
28 29 30 |
# File 'lib/devformance.rb', line 28 def preferred_framework @preferred_framework end |
#slow_query_threshold_ms ⇒ Object
Returns the value of attribute slow_query_threshold_ms.
28 29 30 |
# File 'lib/devformance.rb', line 28 def slow_query_threshold_ms @slow_query_threshold_ms end |
Instance Method Details
#coverage? ⇒ Boolean
59 60 61 |
# File 'lib/devformance.rb', line 59 def coverage? @coverage_enabled != false end |
#framework_adapter ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/devformance.rb', line 50 def framework_adapter return nil unless @preferred_framework framework_class = Devformance::TestFramework::Registry.for_name(@preferred_framework.to_s) return nil unless framework_class && defined?(Rails) framework_class.new(Rails.root) end |