Class: Rucola::Configuration
Instance Attribute Summary collapse
-
#application_support_path ⇒ Object
The path to the applications support directory
~/Library/Application Support/AppName
. -
#dependency_types ⇒ Object
Declare which dependency types should be bundled with a release build.
-
#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.
-
#use_debugger ⇒ Object
Defines wether or not you want to use the
debugger
. -
#use_reloader ⇒ Object
Defines wether or not you want to use the
Reloader
. -
#use_rubygems ⇒ Object
Defines wether or not you want to allow the use of RubyGems.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#load_environment_configuration! ⇒ Object
Loads the current environment’s file (debug.rb, release.rb, test.rb).
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
267 268 269 270 271 272 |
# File 'lib/rucola/initializer.rb', line 267 def initialize @objc_frameworks = [] @load_paths = default_load_paths @dependency_types = [] @use_reloader = @use_debugger = @use_debugger = false end |
Instance Attribute Details
#application_support_path ⇒ Object
The path to the applications support directory ~/Library/Application Support/AppName
219 220 221 |
# File 'lib/rucola/initializer.rb', line 219 def application_support_path @application_support_path end |
#dependency_types ⇒ Object
Declare which dependency types should be bundled with a release build. Most of the times you would probably only bundle gems if you’re targeting a ruby which is compatible and contains the right site libs.
# Only bundles gems
config.dependency_types = :gem
# Bundles gems and site libs
config.dependency_types = :gem, :site
# Bundles site and other libs, where other are libs outside any of the default load paths.
config.dependency_types = :site, :other
265 266 267 |
# File 'lib/rucola/initializer.rb', line 265 def dependency_types @dependency_types 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.
226 227 228 |
# File 'lib/rucola/initializer.rb', line 226 def load_paths @load_paths end |
#objc_frameworks ⇒ Object
List of Objective-C frameworks that should be required
222 223 224 |
# File 'lib/rucola/initializer.rb', line 222 def objc_frameworks @objc_frameworks end |
#root_path ⇒ Object (readonly)
The applications base directory
215 216 217 |
# File 'lib/rucola/initializer.rb', line 215 def root_path @root_path end |
#use_debugger ⇒ Object
Defines wether or not you want to use the debugger
.
The debugger allows you to easily set breakpoints and debug them. See the documentation from ruby-debug for its usage: www.datanoise.com/ruby-debug/
241 242 243 |
# File 'lib/rucola/initializer.rb', line 241 def use_debugger @use_debugger end |
#use_reloader ⇒ Object
Defines wether or not you want to use the Reloader
.
Turning on the reloader will start a fsevent loop which watches the files in app/ for changes and try to reload any classes that have been saved while the app is running.
It could however lead to erratic behaviour so use it with caution.
234 235 236 |
# File 'lib/rucola/initializer.rb', line 234 def use_reloader @use_reloader end |
#use_rubygems ⇒ Object
Defines wether or not you want to allow the use of RubyGems.
You can completely disable the usage of RubyGems by setting this to false.
Unless you’re using gems which are installed on a system by default, it’s better to set it to false. This will enable you to debug wether or not your application has been bundled succesfully, PLUS not using rubygems will improve the performance of your application.
251 252 253 |
# File 'lib/rucola/initializer.rb', line 251 def use_rubygems @use_rubygems end |
Instance Method Details
#load_environment_configuration! ⇒ Object
Loads the current environment’s file (debug.rb, release.rb, test.rb). By default the file is at config/environments/#{environment}.rb
.
276 277 278 279 |
# File 'lib/rucola/initializer.rb', line 276 def load_environment_configuration! root = defined?(SOURCE_ROOT) ? SOURCE_ROOT : RCApp.root_path require "#{root}/config/environments/#{RCApp.env}.rb" end |