Can someone tell me the difference ins the gem versions and the plugin versions? do they work together? need both? Don French
on 03.10.2008 22:47
on 03.10.2008 22:58
On Fri, Oct 3, 2008 at 4:46 PM, Donald French <dhf0820@gmail.com> wrote: > Can someone tell me the difference ins the gem versions and the plugin > versions? do they work together? need both? > You do not need both. The plugin versions are for Ruby on Rails projects. Rails had a way of loading plugins from the vendor/plugins/ directory. This will most likely deprecate (or become less and less used) as Rails has added support for bundling gems with the project in the vendor/gems/ directory. The gem versions of rspec are the ones that are intended for everyday use. I would go with those unless you are supporting a Rails application in the 1.2.x family or earlier. Zach Dennis http://www.continuousthinking.com http://www.mutuallyhuman.com
on 03.10.2008 23:04
"Zach Dennis" <zach.dennis@gmail.com> writes: > On Fri, Oct 3, 2008 at 4:46 PM, Donald French <dhf0820@gmail.com> wrote: >> Can someone tell me the difference ins the gem versions and the plugin >> versions? do they work together? need both? >> > > You do not need both. The plugin versions are for Ruby on Rails > projects. Rails had a way of loading plugins from the vendor/plugins/ > directory. This will most likely deprecate (or become less and less > used) as Rails has added support for bundling gems with the project > in the vendor/gems/ directory. rspec-rails is now published as a gem as well. I am 100% plugin free when it comes to RSpec. Pat
on 04.10.2008 18:54
How do you go plugin-less for RSpec? The plugins require you to generate some files, so how do you do that without a plugin? Is there still a rake task in the gem to generate the required files?
on 04.10.2008 18:58
On Sat, Oct 4, 2008 at 11:54 AM, Fernando Perez <lists@ruby-forum.com> wrote: > How do you go plugin-less for RSpec? The plugins require you to generate > some files, so how do you do that without a plugin? Is there still a > rake task in the gem to generate the required files? I'll post this up on the wiki, but the steps are: [sudo] gem install rspec-rails script/generate rspec That's it. rspec is a dependency of rspec-rails, so installing the rspec-rails gem will also install the rspec gem. Once installed, if you type 'script/generate' with no arguments, you'll see all the rspec generators listed. 'script/generate rspec' generates the files necessary to work with rspec without having to install the plugins in your app. Cheers, David
on 04.10.2008 19:01
Cool. However what happens when my app is currently using the plugin version, is it easy to migrate to the gem? Should I regenerate the files? I guess there is somewhere a line that says to rspec "look into vendor/plugins"?
on 04.10.2008 19:14
On Sat, Oct 4, 2008 at 12:01 PM, Fernando Perez <lists@ruby-forum.com> wrote: > Cool. > > However what happens when my app is currently using the plugin version, > is it easy to migrate to the gem? Should I regenerate the files? I guess > there is somewhere a line that says to rspec "look into vendor/plugins"? Just delete the plugin directories. http://github.com/dchelimsky/rspec-rails/wikis/home Cheers, David
on 04.10.2008 20:34
On Sat, Oct 4, 2008 at 2:58 PM, David Chelimsky <dchelimsky@gmail.com> wrote: > That's it. > > rspec is a dependency of rspec-rails, so installing the rspec-rails > gem will also install the rspec gem. > > Once installed, if you type 'script/generate' with no arguments, > you'll see all the rspec generators listed. 'script/generate rspec' > generates the files necessary to work with rspec without having to > install the plugins in your app. > It doesn't :-P Just tried that on a fresh application, and when call script/generate rspec it just not find it and don't execute it :-P Also, going to the gem version instead of the plugin requires a new set of script files, since they try to look for vendor/plugins/ instead of doing: require 'rubygems' require 'spec' Last, but not least, you need to do config.gem 'rspec-rails', :lib => 'spec/rails' since Rails will try by default to load 'rspec-rails' module instead. Wow, lot of details :-P Cheers, -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams
on 04.10.2008 20:40
On Sat, Oct 4, 2008 at 1:06 PM, Luis Lavena <luislavena@gmail.com> wrote: >> > > require 'spec' > > Last, but not least, you need to do > > config.gem 'rspec-rails', :lib => 'spec/rails' since Rails will try by > default to load 'rspec-rails' module instead. > > Wow, lot of details :-P Hmmm. Wonder if this is a windows thing. Or maybe you have an older version of rubygems? It works as I prescribed for me with the following: $ ruby -v ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0] $ gem -v 1.3.0 $ rails -v Rails 2.1.1 $ spec --version rspec 1.1.8 Besides the OS, what's different in your system?
on 04.10.2008 20:41
On Sat, Oct 4, 2008 at 1:38 PM, David Chelimsky <dchelimsky@gmail.com> wrote: >>> script/generate rspec >>> >> require 'rubygems' > version of rubygems? It works as I prescribed for me with the > > Besides the OS, what's different in your system? Also - the script files prepend vendor/plugins/rspec/lib to the path, but if they are not there, there shouldn't be a problem. That just ensures that if you DO have the plugin installed it takes precedence over the gem.
on 04.10.2008 20:43
On Sat, Oct 4, 2008 at 4:41 PM, David Chelimsky <dchelimsky@gmail.com> wrote: > ... > > Also - the script files prepend vendor/plugins/rspec/lib to the path, > but if they are not there, there shouldn't be a problem. That just > ensures that if you DO have the plugin installed it takes precedence > over the gem. > But require 'rubygems' on top is missing, ending with LoadError due missing 'spec' :-P Will get back to you with facts and all the details, 1.3.0 was released with a bug on Windows so I need to cook a sandboxed ruby with trunk version instead. -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams
on 04.10.2008 20:48
On Sat, Oct 4, 2008 at 1:43 PM, Luis Lavena <luislavena@gmail.com> wrote: > missing 'spec' :-P I've added that to script/spec: http://github.com/dchelimsky/rspec-rails/commit/931f3700cf90f44f10ad599b360b20ebbbe95eab > Will get back to you with facts and all the details, 1.3.0 was > released with a bug on Windows so I need to cook a sandboxed ruby with > trunk version instead. Thanks for your help! Cheers, David
on 05.10.2008 17:45
Hi, Going plugin-less for RSpec went 99% smoothly, here is the only error message I got: $ ./script/generate rspec Gem::SourceIndex#search support for Regexp patterns is deprecated /usr/local/ruby/lib/ruby/gems/1.8/gems/rails-2.1.1/lib/rails_generator/lookup.rb:211:in `each' is outdated
on 05.10.2008 17:51
By the way for a RoR application, can I also go plugin-less for Webrat and Cucumber? From what I understand I still need to install these two as plugins.
on 05.10.2008 18:09
On Sun, Oct 5, 2008 at 10:51 AM, Fernando Perez <lists@ruby-forum.com> wrote: > By the way for a RoR application, can I also go plugin-less for Webrat > and Cucumber? From what I understand I still need to install these two > as plugins. Why ask us when you can ask rubygems? $ gem q -drn cucumber $ gem q -drn webrat Cheers, David
on 05.10.2008 18:09
On Sun, Oct 5, 2008 at 10:45 AM, Fernando Perez <lists@ruby-forum.com> wrote: > Hi, > > Going plugin-less for RSpec went 99% smoothly, here is the only error > message I got: > > $ ./script/generate rspec > Gem::SourceIndex#search support for Regexp patterns is deprecated > /usr/local/ruby/lib/ruby/gems/1.8/gems/rails-2.1.1/lib/rails_generator/lookup.rb:211:in > `each' is outdated That's actually not related to rspec. The deprecation notice is coming from Rubygems-1.3, and is referencing rails code, not rspec code.
on 05.10.2008 18:20
> Why ask us when you can ask rubygems? > Well I prefer to ask (and sound stupid 5 minutes) than not ask (and be stupid all my life), that's the way I work. From the cucumber github wiki located at: http://github.com/aslakhellesoy/cucumber/wikis -- Installation (Rails people – see Ruby on Rails). After you have installed Ruby or JRuby – install Cucumber with the following command: Ruby: gem install cucumber -- When I go to the Ruby on Rails wiki page, Aslak says to install Cucumber as a plugin. Therefore I was wondering if for a Rails app, installing Cucumber as a gem was okay. In the past, even though the RSpec gem existed, it was recommended to install the plugin version of rspec if it was going to be used with a Rails app.
on 05.10.2008 19:29
I have removed the plugins for both cucumber and webrat. Now I am having
the following error message when running rake features or
./script/generate cucumber:
--
/usr/local/ruby/lib/ruby/gems/1.8/gems/cucumber-0.1.6/lib/cucumber/cli.rb:83:in
`read': No such file or directory - cucumber.yml (Errno::ENOENT)
from
/usr/local/ruby/lib/ruby/gems/1.8/gems/cucumber-0.1.6/lib/cucumber/cli.rb:83:in
`parse_args_from_profile'
--
on 05.10.2008 20:01
On Sun, Oct 5, 2008 at 11:20 AM, Fernando Perez <lists@ruby-forum.com> wrote: > > > In the past, even though the RSpec gem existed, it was recommended to > install the plugin version of rspec if it was going to be used with a > Rails app. Didn't mean to make you feel bad or stupid. Was just offering you a way to answer at least part of your question. Teach a man to fish, and all. That said, here's some fish: As of 1.1.5, rspec-rails is now released as a gem. If you're using rails >= 2.0, you can use rspec/rspec-rails gems because the rspec generator (script/generate rspec) is visible, and the generated files are all you need in the rails app. Cucumber and webrat are both released as gems. My recommendation is to use gems for all these tools, except in cases where you need functionality that is in git, but not in the latest gem. Even then, I'd recommend downloading source from git and building the gem locally rather than adding the code to your repo. Of course, this all assumes just a local build on your development machine. If you've got a build machine running scenarios and code examples, you might find it easier to keep unreleased code in your app. Another option would be to use gems by default, and then store them in vendor/gems instead of vendor/plugins when you need functionality between releases. HTH, David