Skip to content

Commit

Permalink
Fix bug in #arity due to a misbehaviour in facets/orderedhash
Browse files Browse the repository at this point in the history
where OrderedHash#include? does not work like #has_key? which
is the case with class Hash.
  • Loading branch information
mneumann committed Mar 31, 2008
1 parent f22e0e3 commit db3f535
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cplus2ruby.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require 'rubygems'

spec = Gem::Specification.new do |s|
s.name = "cplus2ruby"
s.version = "1.1.1"
s.version = "1.1.2"
s.summary = "Gluing C++ and Ruby together in an OO manner"
s.files = Dir['**/*']
s.add_dependency('facets', '>= 2.3.0')
Expand Down
4 changes: 3 additions & 1 deletion lib/cplus2ruby/code_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ def args_convertable?(args)
end

def arity(args)
args.size - (args.include?(:returns) ? 1 : 0)
# FIXME: Facets 2.3.0 has a bug in OrderedHash#include?
# (it behaves differently than Hash)
args.size - ((args.has_key?('returns') || args.has_key?(:returns)) ? 1 : 0)
end

end

0 comments on commit db3f535

Please sign in to comment.