Pat Maddox
2007-Sep-04 19:55 UTC
[rspec-users] Rake tasks getting in the way of edge (uses gem instead)
So I''d been running gem releases of rspec for the past several months, and I installed edge rspec so that I can use Story Runner. I''m running into a problem because I''ve got a couple rake tasks that reference "spec/rake/raketask". If I try to run "rake spec" then it pulls in the gem version instead of the plugin version. rake blows up saying that the versions are incompatible...RSpec is at 1.0.8 and rspec_on_rails is at r2507. If I remove those rake tasks then it runs fine. So it just seems that when rake starts up, it loads all the available task files, which includes a reference to require rspec stuff. Since the plugins haven''t been loaded yet it gets the gem version. afaik the solution is to build a new gem. However I don''t want to have to tell my team members to update their gem every single day. Also I think including rspec in vendor/plugins is supposed to obviate that anyway, but this is probably just some path loading stuff. Anyone else run into this? How do you handle it? Pat
David Chelimsky
2007-Sep-04 19:59 UTC
[rspec-users] Rake tasks getting in the way of edge (uses gem instead)
On 9/4/07, Pat Maddox <pergesu at gmail.com> wrote:> So I''d been running gem releases of rspec for the past several months, > and I installed edge rspec so that I can use Story Runner. > > I''m running into a problem because I''ve got a couple rake tasks that > reference "spec/rake/raketask". If I try to run "rake spec" then it > pulls in the gem version instead of the plugin version. rake blows up > saying that the versions are incompatible...RSpec is at 1.0.8 and > rspec_on_rails is at r2507. > > If I remove those rake tasks then it runs fine. So it just seems that > when rake starts up, it loads all the available task files, which > includes a reference to require rspec stuff. Since the plugins > haven''t been loaded yet it gets the gem version. > > afaik the solution is to build a new gem. However I don''t want to > have to tell my team members to update their gem every single day. > Also I think including rspec in vendor/plugins is supposed to obviate > that anyway, but this is probably just some path loading stuff. > > Anyone else run into this? How do you handle it?See http://rspec.rubyforge.org/documentation/rails/install.html> > Pat > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
David Richards
2007-Sep-04 20:12 UTC
[rspec-users] Rake tasks getting in the way of edge (uses gem instead)
What I''ve done with this is to just uninstall the gem and commit to working off of the plugins completely. I''ve found that with gems in general, I try to keep them local to the project I''m on, almost as if they were a plugin. I move them to my project''s lib (gem unpack) so that I''ve got explicit control over versions and dependencies and I can very easily encapsulate my work domain when I go to deploy an app. Committing to the rspec plugins gives me the same features for free. Hope this helps, David On Sep 4, 2007, at 1:55 PM, Pat Maddox wrote:> So I''d been running gem releases of rspec for the past several months, > and I installed edge rspec so that I can use Story Runner. > > I''m running into a problem because I''ve got a couple rake tasks that > reference "spec/rake/raketask". If I try to run "rake spec" then it > pulls in the gem version instead of the plugin version. rake blows up > saying that the versions are incompatible...RSpec is at 1.0.8 and > rspec_on_rails is at r2507. > > If I remove those rake tasks then it runs fine. So it just seems that > when rake starts up, it loads all the available task files, which > includes a reference to require rspec stuff. Since the plugins > haven''t been loaded yet it gets the gem version. > > afaik the solution is to build a new gem. However I don''t want to > have to tell my team members to update their gem every single day. > Also I think including rspec in vendor/plugins is supposed to obviate > that anyway, but this is probably just some path loading stuff. > > Anyone else run into this? How do you handle it? > > Pat > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users
Pat Maddox
2007-Sep-04 20:58 UTC
[rspec-users] Rake tasks getting in the way of edge (uses gem instead)
On 9/4/07, David Chelimsky <dchelimsky at gmail.com> wrote:> On 9/4/07, Pat Maddox <pergesu at gmail.com> wrote: > > So I''d been running gem releases of rspec for the past several months, > > and I installed edge rspec so that I can use Story Runner. > > > > I''m running into a problem because I''ve got a couple rake tasks that > > reference "spec/rake/raketask". If I try to run "rake spec" then it > > pulls in the gem version instead of the plugin version. rake blows up > > saying that the versions are incompatible...RSpec is at 1.0.8 and > > rspec_on_rails is at r2507. > > > > If I remove those rake tasks then it runs fine. So it just seems that > > when rake starts up, it loads all the available task files, which > > includes a reference to require rspec stuff. Since the plugins > > haven''t been loaded yet it gets the gem version. > > > > afaik the solution is to build a new gem. However I don''t want to > > have to tell my team members to update their gem every single day. > > Also I think including rspec in vendor/plugins is supposed to obviate > > that anyway, but this is probably just some path loading stuff. > > > > Anyone else run into this? How do you handle it? > > See http://rspec.rubyforge.org/documentation/rails/install.htmlI managed to fix it by changing the require to use the full path to the plugin: require "vendor/plugins/rspec/lib/spec/rake/spectask" Pat
David Chelimsky
2007-Sep-04 21:02 UTC
[rspec-users] Rake tasks getting in the way of edge (uses gem instead)
On 9/4/07, Pat Maddox <pergesu at gmail.com> wrote:> On 9/4/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > On 9/4/07, Pat Maddox <pergesu at gmail.com> wrote: > > > So I''d been running gem releases of rspec for the past several months, > > > and I installed edge rspec so that I can use Story Runner. > > > > > > I''m running into a problem because I''ve got a couple rake tasks that > > > reference "spec/rake/raketask". If I try to run "rake spec" then it > > > pulls in the gem version instead of the plugin version. rake blows up > > > saying that the versions are incompatible...RSpec is at 1.0.8 and > > > rspec_on_rails is at r2507. > > > > > > If I remove those rake tasks then it runs fine. So it just seems that > > > when rake starts up, it loads all the available task files, which > > > includes a reference to require rspec stuff. Since the plugins > > > haven''t been loaded yet it gets the gem version. > > > > > > afaik the solution is to build a new gem. However I don''t want to > > > have to tell my team members to update their gem every single day. > > > Also I think including rspec in vendor/plugins is supposed to obviate > > > that anyway, but this is probably just some path loading stuff. > > > > > > Anyone else run into this? How do you handle it? > > > > See http://rspec.rubyforge.org/documentation/rails/install.html > > I managed to fix it by changing the require to use the full path to the plugin: > > require "vendor/plugins/rspec/lib/spec/rake/spectask"Ah - so you already had rspec installed as a plugin also? I didn''t understand that part (clearly). Where is that require? I''ll updated it in the plugin.> > Pat > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Pat Maddox
2007-Sep-04 21:12 UTC
[rspec-users] Rake tasks getting in the way of edge (uses gem instead)
On 9/4/07, David Chelimsky <dchelimsky at gmail.com> wrote:> On 9/4/07, Pat Maddox <pergesu at gmail.com> wrote: > > On 9/4/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > On 9/4/07, Pat Maddox <pergesu at gmail.com> wrote: > > > > So I''d been running gem releases of rspec for the past several months, > > > > and I installed edge rspec so that I can use Story Runner. > > > > > > > > I''m running into a problem because I''ve got a couple rake tasks that > > > > reference "spec/rake/raketask". If I try to run "rake spec" then it > > > > pulls in the gem version instead of the plugin version. rake blows up > > > > saying that the versions are incompatible...RSpec is at 1.0.8 and > > > > rspec_on_rails is at r2507. > > > > > > > > If I remove those rake tasks then it runs fine. So it just seems that > > > > when rake starts up, it loads all the available task files, which > > > > includes a reference to require rspec stuff. Since the plugins > > > > haven''t been loaded yet it gets the gem version. > > > > > > > > afaik the solution is to build a new gem. However I don''t want to > > > > have to tell my team members to update their gem every single day. > > > > Also I think including rspec in vendor/plugins is supposed to obviate > > > > that anyway, but this is probably just some path loading stuff. > > > > > > > > Anyone else run into this? How do you handle it? > > > > > > See http://rspec.rubyforge.org/documentation/rails/install.html > > > > I managed to fix it by changing the require to use the full path to the plugin: > > > > require "vendor/plugins/rspec/lib/spec/rake/spectask" > > Ah - so you already had rspec installed as a plugin also? I didn''t > understand that part (clearly). > > Where is that require? I''ll updated it in the plugin.The require isn''t part of the rspec code...one of the guys I work with wrote the following rake task: require "rake" require "spec/rake/spectask" desc "Run all specs and dump to html" Spec::Rake::SpecTask.new(''spec:html'') do |t| t.spec_opts = ["--format", "html"] if ARGV.size > 1 t.out = ARGV[-1] else t.out = ''test.html'' end t.fail_on_error = false end There might be another way to generate the HTML output with rake automatically, I''m not sure... Anyway I''m assuming it loads the gem version because the plugins haven''t been loaded yet and the rspec plugin isn''t yet part of the classpath. Does that make sense? Pat
David Chelimsky
2007-Sep-04 21:14 UTC
[rspec-users] Rake tasks getting in the way of edge (uses gem instead)
On 9/4/07, Pat Maddox <pergesu at gmail.com> wrote:> On 9/4/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > On 9/4/07, Pat Maddox <pergesu at gmail.com> wrote: > > > On 9/4/07, David Chelimsky <dchelimsky at gmail.com> wrote: > > > > On 9/4/07, Pat Maddox <pergesu at gmail.com> wrote: > > > > > So I''d been running gem releases of rspec for the past several months, > > > > > and I installed edge rspec so that I can use Story Runner. > > > > > > > > > > I''m running into a problem because I''ve got a couple rake tasks that > > > > > reference "spec/rake/raketask". If I try to run "rake spec" then it > > > > > pulls in the gem version instead of the plugin version. rake blows up > > > > > saying that the versions are incompatible...RSpec is at 1.0.8 and > > > > > rspec_on_rails is at r2507. > > > > > > > > > > If I remove those rake tasks then it runs fine. So it just seems that > > > > > when rake starts up, it loads all the available task files, which > > > > > includes a reference to require rspec stuff. Since the plugins > > > > > haven''t been loaded yet it gets the gem version. > > > > > > > > > > afaik the solution is to build a new gem. However I don''t want to > > > > > have to tell my team members to update their gem every single day. > > > > > Also I think including rspec in vendor/plugins is supposed to obviate > > > > > that anyway, but this is probably just some path loading stuff. > > > > > > > > > > Anyone else run into this? How do you handle it? > > > > > > > > See http://rspec.rubyforge.org/documentation/rails/install.html > > > > > > I managed to fix it by changing the require to use the full path to the plugin: > > > > > > require "vendor/plugins/rspec/lib/spec/rake/spectask" > > > > Ah - so you already had rspec installed as a plugin also? I didn''t > > understand that part (clearly). > > > > Where is that require? I''ll updated it in the plugin. > > The require isn''t part of the rspec code...one of the guys I work with > wrote the following rake task: > > require "rake" > require "spec/rake/spectask" > > desc "Run all specs and dump to html" > Spec::Rake::SpecTask.new(''spec:html'') do |t| > t.spec_opts = ["--format", "html"] > if ARGV.size > 1 > t.out = ARGV[-1] > else > t.out = ''test.html'' > end > t.fail_on_error = false > end > > There might be another way to generate the HTML output with rake > automatically, I''m not sure... > > Anyway I''m assuming it loads the gem version because the plugins > haven''t been loaded yet and the rspec plugin isn''t yet part of the > classpath. > > Does that make sense?yep> > Pat > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Scott Taylor
2007-Sep-08 20:10 UTC
[rspec-users] Rake tasks getting in the way of edge (uses gem instead)
On Sep 4, 2007, at 3:55 PM, Pat Maddox wrote:> So I''d been running gem releases of rspec for the past several months, > and I installed edge rspec so that I can use Story Runner. > > I''m running into a problem because I''ve got a couple rake tasks that > reference "spec/rake/raketask". If I try to run "rake spec" then it > pulls in the gem version instead of the plugin version. rake blows up > saying that the versions are incompatible...RSpec is at 1.0.8 and > rspec_on_rails is at r2507. > > If I remove those rake tasks then it runs fine. So it just seems that > when rake starts up, it loads all the available task files, which > includes a reference to require rspec stuff. Since the plugins > haven''t been loaded yet it gets the gem version. > > afaik the solution is to build a new gem. However I don''t want to > have to tell my team members to update their gem every single day. > Also I think including rspec in vendor/plugins is supposed to obviate > that anyway, but this is probably just some path loading stuff. > > Anyone else run into this? How do you handle it?If I understand you correctly, I think this will work in your rakefile: $:.unshift File.dirname(__FILE__) + ''/vendor/plugins/rspec/rspec/lib/'' require ''spec/rake/spectask'' require ''spec/rake/verify_rcov'' Then you can do something like this (as per usual): desc "Run all examples with RCov" Spec::Rake::SpecTask.new(:rcov) do |t| t.spec_files = FileList[''spec/**/*.rb''] t.rcov = true t.rcov_opts = [''--exclude'', ''spec''] t.rcov_dir = "doc/rcov" end Scott