Sha256: fb5447d191c431edea3b0b59bfb75300751d7962eb18c2b54d9b6a7c0d3fe4a7

Contents?: true

Size: 1.01 KB

Versions: 2

Compression:

Stored size: 1.01 KB

Contents

require 'singleton'
require 'ostruct'
module Frank
  class Settings
    include Singleton

    attr_accessor :environment
    attr_accessor :root

    attr_accessor :server
    attr_accessor :options
    attr_accessor :static_folder
    attr_accessor :dynamic_folder
    attr_accessor :layouts_folder
    attr_accessor :sass_options

    def initialize
      reset
    end

    # Reset settings to the defaults
    def reset
      # reset server settings
      @server = OpenStruct.new
      @server.handler = "mongrel"
      @server.hostname = "0.0.0.0"
      @server.port = "3601"

      # reset options
      @options = OpenStruct.new

      # setup folders
      @static_folder = "static"
      @dynamic_folder = "dynamic"
      @layouts_folder = "layouts"

      # setup 3rd party configurations
      @sass_options = {}
    end

    # Check to see if we're in production mode
    def production?
      @production
    end

    # Mark this Frank run as production
    def production!
      @production = true
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
frank-0.4.1 lib/frank/settings.rb
frank-0.4.0 lib/frank/settings.rb