Sha256: 50cd31cfe5b2ff6c88defdd9a75abc725c71281be9a70dda025b38f8e6d65518

Contents?: true

Size: 1.21 KB

Versions: 2

Compression:

Stored size: 1.21 KB

Contents

#
#  Project <%= @conf.appname %>
#
#  Created using bivouac on <%= Time.now %>.
#  Copyright (c) <%= Time.now.year %> __My__. All rights reserved.
#

require 'ostruct'
require 'yaml'

module Bivouac
  class Environment
  
    attr_reader :environment
    
    def initialize
      @environment = OpenStruct.new( 
        # Address to bind to
        :address  => "<%= @conf.address %>",
        
        # Application port
        :port     => <%= @conf.port %>,
        
        # Database configuration
        :db       => open("#{File.dirname( __FILE__ )}/database.yml") {|f| YAML.load(f)},
        
        # Name of the application
        # DO NOT CHANGE IT, OR YOU REALLY KNOW WHAT YOU ARE DOING!
        :appname  => "<%= @conf.appname %>",
        
        # Path of the application
        # DO NOT CHANGE IT, OR YOU REALLY KNOW WHAT YOU ARE DOING!
        :appdir   => "<%= @conf.appdir %>",

        # Organisation type of the application
        # DO NOT CHANGE IT, OR YOU REALLY KNOW WHAT YOU ARE DOING!
        :orgtype  => "<%= @conf.orgtype %>",
        
        # Session type  
        # DO NOT CHANGE IT, OR YOU REALLY KNOW WHAT YOU ARE DOING!
        :session_type  => "<%= @conf.session %>"
      )
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bivouac-0.2.3 lib/bivouac/template/environment.rb
bivouac-0.2.4 lib/bivouac/template/environment.rb