1

I have an application which I have just added Simplecov to in order to get code coverage stats. After adding this Gem, I began getting the following errors:

/Users/KristaOdger/.rvm/gems/jruby-1.7.6/gems/lockfile-2.1.0/lib/lockfile.rb:72 warning: optional boolean argument is obsoleted
/Users/KristaOdger/.rvm/gems/jruby-1.7.6/gems/lockfile-2.1.0/lib/lockfile.rb:73 warning: optional boolean argument is obsoleted
/Users/KristaOdger/.rvm/gems/jruby-1.7.6/gems/lockfile-2.1.0/lib/lockfile.rb:74 warning: optional boolean argument is obsoleted
/Users/KristaOdger/.rvm/gems/jruby-1.7.6/gems/lockfile-2.1.0/lib/lockfile.rb:75 warning: optional boolean argument is obsoleted

(there are about 20 lines like this printed out when I launch the rails server)

They seem to be only warnings, so I'm not super worried, but it would be nice to get rid of them. Both Simplecov and lockfile gems are already the most recent versions (Simplecov 0.8.1 and lockfile 2.1.0), so I can't update one of them... Has anyone else run into this?

Edit: other environment details

Jruby 1.7.6, Rails 3.1.3, Warbler 1.3.8, Bundler 1.3.5

Krista
  • 895
  • 1
  • 6
  • 16

1 Answers1

0

Looks like this comes from specifying class/module attributes using the attr() function (as opposed to attr_accessor, attr_writer or attr_reader)

You can see from the source of the Module attr() function, that the syntax of specifying a boolean argument to that function, is now obsolete. (No boolean argument, or a false boolean arg, would create a readable attribute, where as a true boolean arg would result in a readable and writeable attribute).

Looks like it is not necessary to fix anything, it doesn't cause issues - the correct attribute with the correct accessor levels will still be created... however it could cause issues in the future if support is ever completely removed... Going forward, gems should be using the proper attr_accessor, writer and reader methods to declare attributes.

Gems I have encountered so far that use the obsolete syntax:

  • lockfile
  • ruby-hl7
Krista
  • 895
  • 1
  • 6
  • 16