Skip to content

Commit

Permalink
implement encode_with to squash warnings from psych
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Jan 21, 2011
1 parent a318f91 commit ac9c3c9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/bundler/rubygems_ext.rb
Expand Up @@ -105,6 +105,12 @@ class Dependency

alias eql? ==

def encode_with(coder)
to_yaml_properties.each do |ivar|
coder[ivar.to_s.sub(/^@/, '')] = instance_variable_get(ivar)
end
end

def to_yaml_properties
instance_variables.reject { |p| ["@source", "@groups"].include?(p.to_s) }
end
Expand Down

0 comments on commit ac9c3c9

Please sign in to comment.