Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 80 lines (67 sloc) 1.606 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
Example
=======

    require 'funfig'
    
    UploadConf = Funfig.new do
      p.root '/services'
      g.nginx do
        p.folder { File.join(_.root, 'nginx') }
        p.port '8000'
      end
      p.public_ip_port '*:80'
    end
    
    conf = UploadConf.new
    p conf.nginx.folder
    conf.root = "~/MailProject/upload"
    p conf.nginx.folder
    conf.each {|k,v| puts "#{k} #{v}"}
    p conf
    p conf.to_hash()
    p conf.to_hash(true)
    
    Up1Conf = UploadConf.clone do
      g.nginx do
        p.folder { File.join(_.root, 'nganx') }
        p.location '/public'
      end
    end
    
    conf1 = Up1Conf.new
    conf1.update(conf.to_hash())
    p conf1
    conf1.nginx_reset!
    p conf1

TODO
====

1. define array of same kinds

    Conf = Funfig.new do
      p.port 8000
      p.folder '/folder'
      array :servers do
        p.port { _parent.port + _pos }
        p.folder { File.join(_parent.folder, _pos.to_s) }
      end
      a.servers1 do
        p.port { _parent.port + _pos }
        p.folder { File.join(_parent.folder, _pos.to_s) }
      end
    end

2. define hash of same kinds

    Conf = Funfig.new do
      hash :environments do
        p.host 'localhost'
        p.database { "mybase_#{_name}" }
      end
      h.environments1 do
        p.host 'localhost'
        p.database { "mybase_#{_name}" }
      end
    end

3. Correct composition of schemes

    ConfServ = Funfig.new do
      p.port 80
      p.ip '192.168.168.192'
    end

    ConfApp = Funfig.new do
      p.path '/srv/path'
      g.server ConfServ do
        p.path { _.path }
      end
    end
Something went wrong with that request. Please try again.