Displaying 20 results from an estimated 100000 matches similar to: "List of loaded plugins"
2006 Jun 27
0
Getting list of loaded plugins
According to the docs I''ve read, the loaded_plugins variable is made
available in any plugin''s init.rb file. How can I access the list of
plugins from outside of init.rb? For example if I''m at the console
and want to see what plugins are loaded how could I do that?
Basically I''d just like to use the equivalent of loaded_plugins
outside of init.rb.
Pat
2007 Sep 19
1
Strange error in StoryRunner (was: Mocks in StoryRunner)
Hi,
I''m posting this stack trace again because it keeps popping up,
seemingly as the ''default error'' when something is wrong with my story
code; for instance, I got it when I referenced a variable in my
''Given'' that I had forgotten to pass into the block.
Now I''m getting it when I attempt to post to a login action:
And ''user is
2007 Apr 09
7
RCov results seem to include the spec files
I saw the RCov page at http://rspec.rubyforge.org/tools/rcov.html and
decided to add it to my project. My rakefile looks like this:
require "rake"
require "spec/rake/spectask"
desc "Run all specs with RCov"
Spec::Rake::SpecTask.new("spec:rcov") do |t|
t.spec_files = FileList["spec/**/*_spec.rb"]
t.rcov = true
end
When I run rake spec:rcov,
2006 Dec 20
16
Edge RSpec on Rails...what did I forget?
Started a new Rails project, and installed RSpec and the Rails plugin
vendor/plugins/rspec (svn://rubyforge.org/var/svn/rspec/trunk/rspec) - 1332
vendor/plugins/rspec_on_rails
(svn://rubyforge.org/var/svn/rspec/trunk/rspec_on_rails/vendor/plugins/rspec_on_rails)
- 1332
Generated the rspec file, created a model...the spec runs fine if I do
ruby spec/models/foo_spec.rb. Running rake though gives
2006 Jun 22
2
[PLUGIN] url_for_with_prefix - allowing you to modify/remove prefixes easily
Here''s the readme. I think it''s okay to post this kind of thing to
the mailing list. Anyway, hopefully someone else finds this useful.
UrlForWithPrefix
================
By Pat Maddox
Very simple plugin, adds the :prefix option to url_for.
Say in your environment.rb file you''ve got
ActionController::AbstractRequest.relative_url_root = "/super"
Any time
2007 May 04
5
Problems with mongrel_cluster 1.0.1.1 on FreeBSD
I''m running FreeBSD 6.1 and installed the 1.0.1.1 mongrel_cluster
prerelease. I had a problem with the mongrels not stopping, and it
turns out it''s because ps is reporting my processes as just
[ruby18]
instead of someting more like "mongrel_rails start -d ......."
Not sure why it''s doing that, but it is. Any ideas?
For the time being I just changed line
2006 Jun 07
6
I want to stick my models in a module
I''ve got enough models now that I''d like to separate them into
modules. For example, I have the class Player that I want to stick in
the Trainer module. I''ve changed the definition to
class Trainer::Player
I''ve created a models/trainer dir, test/unit/trainer, and
test/fixtures/trainer. Change the PlayerTest class to be
Trainer::PlayerTest. I get the
2005 Dec 22
4
Switchtower problem - `sysread'': bignum too big to convert into `long'' (RangeError)
I''m trying to set up switchtower, following the info in the Manual,
but am getting this error when I run "rake remote_exec ACTION=setup":
servers: ["cantona.dnswatchdog.com"]
/usr/lib/ruby/gems/1.8/gems/net-ssh-1.0.3/lib/net/ssh/transport/packet-stream.rb:203:in
`sysread'': bignum too big to convert into `long'' (RangeError)
from
2005 Dec 21
6
Rails without a db - how to run tests
I''m writing a simple app that doesn''t need to use a database. I added
:active_record to the config.frameworks -= line in environment.rb
file. This lets me run ./script/generate fine without complaining
about no connection. However if I try to run a functional test, it
complains about no connection being established. Well...I don''t want
a connection to be established.
2006 Mar 13
4
controllers, models and views in plugins
Hello all,
Is it possible to package controllers, models and views in a plugin? The
tutorials for plugins seem rather sparse at the moment...
I''ve written a form "widget" that I''ve been using as a partial that I would
like to reuse in other projects. I was thinking about making a component
out of it, but I need to be able to access some of the form data that it
2006 Dec 24
6
What do you think of this controller spec?
Here''s a controller spec I wrote, it''s for a very simple RESTful
controller (well, aren''t all RESTful controllers simple? :)
I''ve created a couple spec helper methods to refactor some of the
common code...for example, require_login_and_correct_user creates two
specifications: one for when the user isn''t logged in, and one when
the user is logged in but
2006 Nov 03
10
[PLUGIN] rspec_resource_generator - RESTful scaffold generator with RSpec specifications
rspec_resource_generator
========================
By Pat Maddox
Use this generator to generate RESTful scaffolding with RSpec specifications.
Syntax is exactly the same as the scaffold_resource generator:
./script/generate rspec_resource ModelName [field:type field:type]
When you run this generator, it will create a migration, model, and
model spec file. In addition, it gives you a RESTful
2006 Apr 03
4
Clearing out filters in ActionController
I want to run a single filter in my application.rb file, and then if a
certain condition is true, end the action''s processing immediately.
Right now I''m using prepend_before_filter to ensure that it gets run
first, but some of my around_filters are still being processed. Is
there a way that I can clear out all the filters that should be run?
Basically it''ll look
2007 Nov 08
0
error on migration
Hi all,
I''m just getting started with rspec. I''m using trunk rspec with edge
rails. I get an error on migration though, here it is:
rake db:migrate RAILS_ENV="test" --trace
(in /home/pat/railsapp)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
undefined method `failure_message'' for class
2007 Sep 04
7
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
2006 May 04
2
Testing associations
I have a pretty simple model, articles and users.
class Article
belongs_to :user
end
class User
has_many :articles
end
In my unit tests I want to ensure that the associations work properly.
What''s the best way to do this? The obvious thing to do is a test in
each model.
# user_test.rb
def test_add_post
u = users(:first)
before_articles = u.articles.count
u.articles
2006 Mar 19
4
Trouble with composed_of
I''m trying to use composed_of within my model. I have a field in my
database named ''card1'', which is simply a string. I have this in my
model
class Player < ActiveRecord::Base
composed_of :card1, :class_name => ''Card''
end
class Card
attr_reader :value, :suit
def initialize(s)
@value = s[0].chr
@suit = s[1].chr
end
end
The
2005 Dec 12
9
Webrick is being stupid...no info on a brand new project
I created a project, made a migration, generated scaffolding...start
up webrick and I get nothing. To simplify things, I just started
another project and generated a controller, still getting nothing.
The index page loads fine, but nothing beyond that. If I go to
anything that should give me a 404, the page is just blank. The
Webrick console just says a 500 (nothing explaining why), and
2006 Mar 22
2
Test Failure: <0.01> expected but was <0.01>
I have two database fields, and then I have a method which shows the
difference. It''s simply
def ev_diff
ev_push - ev_fold
end
The value of ev_push is 0.26, value of ev_fold is 0.05, so the diff is
obviously 0.01. I have an assertion written as:
assert_equal 0.01, stats.ev_diff
Which fails..but I have no clue why. The failure message follow:
1) Failure:
2007 Oct 16
10
Scenarios Plugin Pre-Announcement
This is sort of a pre-announcement for a Rails plugin my friend Adam
Williams and I are working on. We''re in the process of extracting it
from a project we are working on so that it can be generally useful to
the Rails community. We are calling it "Scenarios". It is a drop in
replacement for Rails fixtures:
http://faithfulcode.rubyforge.org/svn/plugins/trunk/scenarios/README