Skip to content
Browse files

remove ostruct dependency

  • Loading branch information...
1 parent 58abb6d commit 0bbad5bb07e6dd1c69b3e3b85b0d2bd79152392f @alexch committed May 11, 2011
Showing with 15 additions and 3 deletions.
  1. +15 −3 lib/rubygems/deprecate.rb
View
18 lib/rubygems/deprecate.rb
@@ -73,11 +73,23 @@ def skip_during(will_skip = true)
Deprecate.skip = original
end
- require 'ostruct'
- class Warning < OpenStruct
+ class Warning
+ attr_accessor :target, :method_name, :replacement, :year, :month, :location
+
+ def initialize options
+ @target, @method_name, @replacement, @year, @month, @location =
+ options[:target], options[:method_name], options[:replacement], options[:year], options[:month], options[:location]
+ end
+
+ def ==(other)
+ target == other.target and
+ method_name == other.method_name and
+ location == other.location
+ end
+
def message
[ "#{target}#{method_name} is deprecated",
- repl == :none ? " with no replacement" : "; use #{replacement} instead.",
+ replacement == :none ? " with no replacement" : "; use #{replacement} instead.",
" It will be removed on or after %4d-%02d-01." % [year, month]
].join
end

0 comments on commit 0bbad5b

Please sign in to comment.
Something went wrong with that request. Please try again.