Sha256: 5682932974f0d628faf332ab7b95de69ea008cf93a16931b8343963913d262a7

Contents?: true

Size: 988 Bytes

Versions: 31

Compression:

Stored size: 988 Bytes

Contents

module Capricorn
  class System
    module Config
      
      def use_development!
        environment { 'development' }
      end
      
      def development?
        environment == 'development'
      end
      
      def use_production!
        environment { 'production' }
      end
      
      def production?
        environment == 'production'
      end
      
      def environment(&block)
        option(:environment, block) { |s,v| v or 'production' }
      end
      
      def use_ssl!
        option(:use_ssl, lambda { true })
      end
      
      def use_ssl?
        option(:use_ssl, nil)
      end
      
      def bind(hostname=nil, port=nil)
        server_hostname { hostname }
        server_port     { port }
      end
      
      def server_hostname(&block)
        option(:server_hostname, block) { |v| v or 'localhost' }
      end
      
      def server_port(&block)
        option(:server_port, block) { |v| v or 5000 }
      end
      
    end
  end
end

Version data entries

31 entries across 31 versions & 2 rubygems

Version Path
simonmenke-capricorn-0.2.00 lib/capricorn/system/config.rb
simonmenke-capricorn-0.2.03 lib/capricorn/system/config.rb
simonmenke-capricorn-0.2.07 lib/capricorn/system/config.rb
simonmenke-capricorn-0.2.25 lib/capricorn/system/config.rb
simonmenke-capricorn-0.2.26 lib/capricorn/system/config.rb
capricorn-0.2.25 lib/capricorn/system/config.rb
capricorn-0.2.24 lib/capricorn/system/config.rb
capricorn-0.2.23 lib/capricorn/system/config.rb
capricorn-0.2.22 lib/capricorn/system/config.rb
capricorn-0.2.21 lib/capricorn/system/config.rb
capricorn-0.2.20 lib/capricorn/system/config.rb
capricorn-0.2.19 lib/capricorn/system/config.rb
capricorn-0.2.18 lib/capricorn/system/config.rb
capricorn-0.2.17 lib/capricorn/system/config.rb
capricorn-0.2.16 lib/capricorn/system/config.rb
capricorn-0.2.15 lib/capricorn/system/config.rb
capricorn-0.2.14 lib/capricorn/system/config.rb
capricorn-0.2.13 lib/capricorn/system/config.rb
capricorn-0.2.12 lib/capricorn/system/config.rb
capricorn-0.2.11 lib/capricorn/system/config.rb