Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration that takes a previous configuration breaks nesting #3

Open
duckworth opened this issue Aug 16, 2011 · 0 comments
Open

Comments

@duckworth
Copy link

require 'configuration'

b = Configuration.for('b'){
        host "codeforpeople.com"

        www {
            port 80
            url "http://#{ host }:#{ port }"
        }

        db {
            port 5342 
            url "db://#{ host }:#{ port }"
        }

        mail {
            host "gmail.com"
            port 25 
            url "mail://#{ host }:#{ port }"
        }
    }

c = Configuration.for('c' ,b){
        foo 'bar'
    }

puts b.mail.url 
puts c.mail.url

outputs

mail://gmail.com:25
test.rb:28:in `<main>': undefined method `url' for {:host=>"gmail.com", :port=>25, :url=>"mail://gmail.com:25"}:Hash       (NoMethodError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant