Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
test
tool
.gitignore
.travis.yml
Gemfile
README.md
Rakefile
UNLICENSE
block-is-hash.gemspec

README.md

block-is-hash

Build Status License

Block is Hash

Installation

$ gem install block-is-hash

Usage

Code:

require 'block-is-hash'

hash = block_is_hash %i(server) do # `server` directive can be repeated.
  user :www

  http do
    server do
      listen 80
      server_name 'foo.com'
    end

    server do
      listen 443, :ssl
      server_name 'bar.com'
    end
  end
end

p hash

Output:

{:user=>:www, :http=>{:server=>[{:listen=>80, :server_name=>"foo.com"}, {:listen=>[443, :ssl], :server_name=>"bar.com"}]}}

For more examples, see examples directory.

License

The Unlicense