module TrustyCms

def app?

def app?
  File.exist?("#{Rails.root}/lib/trusty_cms.rb")
end

def boot!

def boot!
  unless booted?
    preinitialize
    pick_boot.run
  end
end

def booted?

def booted?
  defined? TrustyCms::Initializer
end

def config # method must be defined before any initializers run

method must be defined before any initializers run

end
config['other.thing'] = 'nothing'
config.define 'something', default => 'something'
TrustyCms.config do |config|

but it will also yield itself to a block:

TrustyCms.config['site.url'] = 'example.com'
TrustyCms.config['site.title']

Returns the TrustyCms::Config eigenclass object, so it can be used wherever you would use TrustyCms::Config.
def config  # method must be defined before any initializers run
  yield TrustyCms::Config if block_given?
  TrustyCms::Config
end

def config_definitions

def config_definitions
  @config_definitions ||= {}
end

def config_definitions=(definitions)

def config_definitions=(definitions)
  @config_definitions = definitions
end

def configuration


For now it's exactly the same as calling Rails.configuration except that it will also yield itself to a block.
Returns the configuration object with which this application was initialized.
def configuration
  yield Rails.configuration if block_given?
  Rails.configuration
end

def loaded_via_gem?

def loaded_via_gem?
  pick_boot.is_a? GemBoot
end

def pick_boot

def pick_boot
  case
    when app?
      AppBoot.new
    when vendor?
      VendorBoot.new
    else
      GemBoot.new
  end
end

def preinitialize

def preinitialize
  load(preinitializer_path) if File.exist?(preinitializer_path)
end

def preinitializer_path

def preinitializer_path
  "#{Rails.root}/config/preinitializer.rb"
end

def root


This is not the same as Rails.root, which is the instance directory and tends to contain only site-delivery material.
Returns the root directory of this installation (which is usually the gem directory).
def root
  Pathname.new(TRUSTY_CMS_ROOT) if defined?(TRUSTY_CMS_ROOT)
end

def vendor?

def vendor?
  File.exist?("#{Rails.root}/vendor/trusty")
end