Skip to content

Commit

Permalink
Fixed issue with Syck on Ruby 1.8. - Closes markbates#9
Browse files Browse the repository at this point in the history
  • Loading branch information
markbates committed Mar 22, 2011
1 parent ecaaca3 commit 5a1ab21
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Bundler.require
Gemstub.test_framework = :rspec

Gemstub.gem_spec do |s|
s.version = "2.7.0"
s.version = "2.7.1"
s.summary = "A powerful Ruby configuration system."
s.rubyforge_project = "magrathea"
s.add_dependency('yamler', '>=0.1.0')
Expand Down
4 changes: 2 additions & 2 deletions configatron.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Gem::Specification.new do |s|
s.name = %q{configatron}
s.version = "2.7.0.20110314124844"
s.version = "2.7.1.20110322102447"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["markbates"]
s.date = %q{2011-03-14}
s.date = %q{2011-03-22}
s.description = %q{configatron was developed by: markbates}
s.email = %q{mark@markbates.com}
s.extra_rdoc_files = ["README", "LICENSE"]
Expand Down
3 changes: 2 additions & 1 deletion lib/configatron/store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def parse_options(options)
if options.is_a?(Hash)
options.each do |k,v|
if v.is_a?(Hash)
if v.keys.length == 1 && v.keys.first.is_a?(Syck::MergeKey)
if v.keys.length == 1 && v.keys.first.is_a?(SYCK_CONSTANT)
self.method_missing("#{k.to_sym}=", v.values.first.flatten)
else
self.method_missing(k.to_sym).configure_from_hash(v)
Expand All @@ -309,6 +309,7 @@ def parse_options(options)
rescue Exception => e
end

SYCK_CONSTANT = (RUBY_VERSION.match(/^1\.9/) ? Syck::MergeKey : YAML::Syck::MergeKey)

end # Store
end # Configatron

0 comments on commit 5a1ab21

Please sign in to comment.