Class: Hone::Config
- Inherits:
-
Object
- Object
- Hone::Config
- Defined in:
- lib/hone/config.rb
Constant Summary collapse
- CONFIG_FILE =
".hone/config.yml"- DEFAULTS =
{ harness: { warmup_iterations: 10, profile_iterations: 100, path: ".hone/harness.rb" }, profilers: { cpu: "auto", memory: false }, output: { dir: "tmp/hone" }, analysis: { rails: false, show_cold: false, top: nil } }.freeze
Instance Method Summary collapse
- #[](key) ⇒ Object
- #analysis ⇒ Object
- #exist? ⇒ Boolean
- #harness ⇒ Object
-
#initialize(path = CONFIG_FILE) ⇒ Config
constructor
A new instance of Config.
- #output ⇒ Object
- #profilers ⇒ Object
Constructor Details
#initialize(path = CONFIG_FILE) ⇒ Config
Returns a new instance of Config.
29 30 31 32 |
# File 'lib/hone/config.rb', line 29 def initialize(path = CONFIG_FILE) @path = path @data = load_config end |
Instance Method Details
#[](key) ⇒ Object
50 51 52 |
# File 'lib/hone/config.rb', line 50 def [](key) @data[key.to_sym] end |
#analysis ⇒ Object
46 47 48 |
# File 'lib/hone/config.rb', line 46 def analysis @data[:analysis] end |
#exist? ⇒ Boolean
54 55 56 |
# File 'lib/hone/config.rb', line 54 def exist? File.exist?(@path) end |
#harness ⇒ Object
34 35 36 |
# File 'lib/hone/config.rb', line 34 def harness @data[:harness] end |
#output ⇒ Object
42 43 44 |
# File 'lib/hone/config.rb', line 42 def output @data[:output] end |
#profilers ⇒ Object
38 39 40 |
# File 'lib/hone/config.rb', line 38 def profilers @data[:profilers] end |