Skip to content

Instantly share code, notes, and snippets.

@harukizaemon
Created May 4, 2011 04:02
Show Gist options
  • Select an option

  • Save harukizaemon/954738 to your computer and use it in GitHub Desktop.

Select an option

Save harukizaemon/954738 to your computer and use it in GitHub Desktop.
Borked Psych/libyaml
require 'psych'
require 'yaml'
require 'erb'
puts "RUBY_VERSION: #{RUBY_VERSION}"
puts "YAML::VERSION: #{YAML::VERSION}"
yaml = <<-YAML
common: &common
adapter: postgresql
host: localhost
min_messages: warning
development:
<<: *common
database: example_development
test: &test
<<: *common
database: example_test
production:
<<: *common
database: example_production
YAML
config = YAML::load(yaml)
development = config["development"]
database = development["database"]
puts "development[database]: #{database.inspect}"
# RUBY_VERSION: 1.9.2
# YAML::VERSION: 1.0.0
# development[database]: nil
# require 'psych'
require 'yaml'
require 'erb'
puts "RUBY_VERSION: #{RUBY_VERSION}"
puts "YAML::VERSION: #{YAML::VERSION}"
yaml = <<-YAML
common: &common
adapter: postgresql
host: localhost
min_messages: warning
development:
<<: *common
database: example_development
test: &test
<<: *common
database: example_test
production:
<<: *common
database: example_production
YAML
config = YAML::load(yaml)
development = config["development"]
database = development["database"]
puts "development[database]: #{database.inspect}"
# RUBY_VERSION: 1.9.2
# YAML::VERSION: 1.0.0
# development[database]: "example_development"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment