Class: Yap::Configuration
- Inherits:
-
Object
- Object
- Yap::Configuration
- Defined in:
- lib/yap/configuration.rb
Instance Attribute Summary collapse
-
#addon_paths ⇒ Object
Returns the value of attribute addon_paths.
-
#rcfiles ⇒ Object
Returns the value of attribute rcfiles.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #path_for(part) ⇒ Object
- #preferred_yaprc_path ⇒ Object
- #yap_path ⇒ Object
- #yaprc_template_path ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/yap/configuration.rb', line 14 def initialize @addon_paths = [ "#{File.dirname(__FILE__)}/../../addons", "#{ENV['HOME']}/.yap/addons" ] @rcfiles = [ "#{ENV['HOME']}/.yaprc", preferred_yaprc_path ] end |
Instance Attribute Details
#addon_paths ⇒ Object
Returns the value of attribute addon_paths.
11 12 13 |
# File 'lib/yap/configuration.rb', line 11 def addon_paths @addon_paths end |
#rcfiles ⇒ Object
Returns the value of attribute rcfiles.
12 13 14 |
# File 'lib/yap/configuration.rb', line 12 def rcfiles @rcfiles end |
Instance Method Details
#path_for(part) ⇒ Object
26 27 28 |
# File 'lib/yap/configuration.rb', line 26 def path_for(part) yap_path.join(part) end |
#preferred_yaprc_path ⇒ Object
30 31 32 |
# File 'lib/yap/configuration.rb', line 30 def preferred_yaprc_path yap_path.join("yaprc") end |
#yap_path ⇒ Object
38 39 40 |
# File 'lib/yap/configuration.rb', line 38 def yap_path Pathname.new "#{ENV['HOME']}/.yap" end |
#yaprc_template_path ⇒ Object
34 35 36 |
# File 'lib/yap/configuration.rb', line 34 def yaprc_template_path Pathname.new(File.dirname(__FILE__)).join('../../rcfiles/yaprc') end |