Class: Rucola::Configuration
Instance Attribute Summary collapse
-
#application_support_path ⇒ Object
The path to the applications support directory
~/Library/Application Support/AppName
. -
#load_paths ⇒ Object
An array of additional paths to prepend to the load path.
-
#objc_frameworks ⇒ Object
List of Objective-C frameworks that should be required.
-
#root_path ⇒ Object
readonly
The applications base directory.
Instance Method Summary collapse
-
#environment ⇒ Object
Returns the value of RUBYCOCOA_ENV.
-
#environment_path ⇒ Object
The path to the current environment’s file (development.rb, etc.).
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #set_application_support_path! ⇒ Object
- #set_root_path! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
218 219 220 221 222 223 224 |
# File 'lib/rucola/initializer.rb', line 218 def initialize set_root_path! set_application_support_path! self.objc_frameworks = [] self.load_paths = default_load_paths end |
Instance Attribute Details
#application_support_path ⇒ Object
The path to the applications support directory ~/Library/Application Support/AppName
209 210 211 |
# File 'lib/rucola/initializer.rb', line 209 def application_support_path @application_support_path end |
#load_paths ⇒ Object
An array of additional paths to prepend to the load path. By default, all models
, config
, controllers
and db
paths are included in this list.
216 217 218 |
# File 'lib/rucola/initializer.rb', line 216 def load_paths @load_paths end |
#objc_frameworks ⇒ Object
List of Objective-C frameworks that should be required
212 213 214 |
# File 'lib/rucola/initializer.rb', line 212 def objc_frameworks @objc_frameworks end |
#root_path ⇒ Object (readonly)
The applications base directory
205 206 207 |
# File 'lib/rucola/initializer.rb', line 205 def root_path @root_path end |
Instance Method Details
#environment ⇒ Object
Returns the value of RUBYCOCOA_ENV
239 240 241 |
# File 'lib/rucola/initializer.rb', line 239 def environment ::RUBYCOCOA_ENV end |
#environment_path ⇒ Object
The path to the current environment’s file (development.rb, etc.). By default the file is at config/environments/#{environment}.rb
.
245 246 247 |
# File 'lib/rucola/initializer.rb', line 245 def environment_path "#{root_path}/config/environments/#{environment}.rb" end |
#set_application_support_path! ⇒ Object
230 231 232 233 234 235 236 |
# File 'lib/rucola/initializer.rb', line 230 def set_application_support_path! # TODO: we might want to set this to something in test mode. return if RUBYCOCOA_ENV == 'test' user_app_support_path = File.join(OSX::NSSearchPathForDirectoriesInDomains(OSX::NSLibraryDirectory, OSX::NSUserDomainMask, true)[0].to_s, "Application Support") @application_support_path = File.join(user_app_support_path, Rucola::RCApp.app_name) end |
#set_root_path! ⇒ Object
226 227 228 |
# File 'lib/rucola/initializer.rb', line 226 def set_root_path! @root_path = Pathname.new(::RUBYCOCOA_ROOT).realpath.to_s end |