buildr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Donald <pe...@realityforge.org>
Subject BUILDR-705 - Removing RSpec as a hard dependency
Date Sat, 14 Feb 2015 10:00:23 GMT
Hi,

Recently we received a request to remove RSpec as a hard dependency [1].
Essentially if the RSpec version, that buildr uses is not compatible with
the code you write, then this can cause issues. This is an issue I have
faced before a few times so I wanted to see if there a way it could be
easily addressed.

Buildr uses rspec within build files so that you can write checks to ensure
the packages contain the correct contents. An example of this in use is at
[2]. I don't believe this feature is widely used but I know I use it fairly
extensively.

However just removing the dependency, would be a backwards incompatible
change so what I decided to do was;
* remove rspec as a runtime dependency
* if the user adds a call to check() method in a buildfile, then load rspec
* If loading of rspec fails then fail the build and emit the error message:

=============================================================
RuntimeError : check() method invoked in buildfile but RSpec has not been
loaded.

Buildr prior to version 1.4.22, included rspec as a dependency but as
of version 1.4.22, it is expected users manually add RSpec to their
Gemfile. The following lines should be added to restore the version
of rspec included in 1.4.22:

gem 'rspec-expectations',   '= 2.14.3'
gem 'rspec-mocks',          '= 2.14.3'
gem 'rspec-core',           '= 2.14.5'
gem 'rspec',                '= 2.14.1'
=============================================================

I have put the changes in a branch at [3]. Does anyone have any problems
with going ahead with this change or can they suggest a better way of
solving this issue?

[1] https://issues.apache.org/jira/browse/BUILDR-705
[2]
https://github.com/realityforge/buildr-examples/blob/master/check-helloworld/buildfile#L8-L10
[3] https://github.com/apache/buildr/compare/BUILDR-705


-- 
Cheers,

Peter Donald

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message