Class: RailsERD::Config
- Inherits:
-
Object
- Object
- RailsERD::Config
- Defined in:
- lib/rails_erd/config.rb
Constant Summary collapse
- USER_WIDE_CONFIG_FILE =
File.(".erdconfig", ENV["HOME"])
- CURRENT_CONFIG_FILE =
File.(".erdconfig", Dir.pwd)
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #load(extra_config_file = nil) ⇒ Object
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
14 15 16 |
# File 'lib/rails_erd/config.rb', line 14 def initialize @options = {} end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/rails_erd/config.rb', line 8 def @options end |
Class Method Details
.font_names_based_on_os ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/rails_erd/config.rb', line 29 def self.font_names_based_on_os if use_os_x_fonts? { normal: "ArialMT", bold: "Arial BoldMT", italic: "Arial ItalicMT" } else { normal: "Arial", bold: "Arial Bold", italic: "Arial Italic" } end end |
.load(extra_config_file = nil) ⇒ Object
10 11 12 |
# File 'lib/rails_erd/config.rb', line 10 def self.load(extra_config_file=nil) new.load extra_config_file end |
Instance Method Details
#load(extra_config_file = nil) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/rails_erd/config.rb', line 18 def load(extra_config_file=nil) load_file(USER_WIDE_CONFIG_FILE) load_file(CURRENT_CONFIG_FILE) if extra_config_file extra_config_path = File.(extra_config_file, Dir.pwd) load_file(extra_config_path) if File.exist?(extra_config_path) end @options end |