similar to: Why do plugins use class_eval?

Displaying 20 results from an estimated 1000 matches similar to: "Why do plugins use class_eval?"

2006 Feb 03
5
Limiting the columns loaded from a legacy db
I''m setting up a new Rails project that is a nice front end for a company''s personnel database with a legacy schema. Unfortunately, the table that contains all the standard information (first name, last name, email address) has some 20+ columns, one of which is a BLOB of a picture of the person. Loading all this takes a while, when the application really only needs the
2003 Dec 17
2
Assert in Fedora dovecot-0.99.10.4-1
Hello, I'm seeing this in my dovecot log file: imap(blair): Dec 16 13:53:06 Panic: file istream.c: line 93 (i_stream_set_read_limit): assertion failed: (stream->v_size == 0 || v_offset <= stream->v_size) I get this consistently when I search for the string "unknown C primitive" across 10 mailboxes using the Windows Netscape 4.80 client. If there's any more
2005 Aug 31
4
Oddities with Debian unstable dovecot
Hello, I'm running an Debian etch box with unstable and ever since the last upgrade to dovecot, I've seen odd things. At times, I would see emails would go missing from the Inbox or other folders, and I couldn't move emails that were moved from the Inbox to another folder back into the Inbox. These have seen gone away since I removed all dovecot.* files and .index* files from my
2005 Dec 21
3
Best Practices???
Has anyone come up with a list of best practices for App design using Ruby On Rails? John McClain Senior Software Engineer TCS Healthcare jmcclain-RI2jYlfFOOy2dUpmj6OxPQC/G2K4zDHf@public.gmane.org (530)886-1700x235 "Skepticism is the first step toward truth"
2006 Jun 23
2
WEBrick hangs with OCI8?
Has anyone experienced "hangs" with the WEBrick/OCI8 combination? The sequence of actions I perform to consistently get WEBrick to hang is: 1. start WEBrick 2. list a table form my Oracle 10g DB 3. startup sqlplus and update a few records in the table 4. go back to my browser and reload the table Here none of the chances I made directly to the table are reflected in the listing.
2006 Jun 09
2
Timzones, UTC, and to_xml()
Does anyone know a good way to hook into the AR to_xml() method to allow for adjusting datetimes to a user''s timezone? Basically I want a user to be able dump all their data before cancelling an account. I store all datetime info as UTC as per the recommendations of Jamis Buck and Scott Barron in the Rails Recipe article "Dealing with Timezones". Come to think of it I bet
2006 Jun 19
6
to_xml depth ...
hello, The "render :xml => myFriends.to_xml", return something like: <people> <person> <id type="integer">2</id> ... <person> But a Person has a "has_many" relationship and they are not in the xml, => so is it possible to change the depth of the marshall process ? if it not possible, what are the "rails
2006 Jun 26
5
How can I dynamiclly generate models?
I am trying to write a plugin, ''acts_as_commentable'', for my models - Image, Book, Music and so on, I do not want to use polymorphic association, so very model should have its own comment class. Here is my code acts_as_commentable.rb module Commentable def self.included(base) base.extend(ClassMethods) end module ClassMethods def
2006 Sep 04
2
"include" versus "extend" - what's the difference
Hi, Just wondering when one would use "include" over "extend"? Both seem to bring in methods to the class no? The context is I''m just trying to understand why both are used with the acts_as_audited plugin: Full extract from plugin (used within here): ================================================== # Copyright (c) 2006 Brandon Keepers # # Permission is hereby
2006 May 05
1
class_eval in ROR''s attribure_accessor.rb
hi, here is a snippet code in ROR''s attribure_accessor.rb. the usage of class_eval is different with "class_eval(string, <, file, <line>>)" somewhat, i don''t understand this usage, who can explain it more detail to me? def cattr_writer(*syms) syms.flatten.each do |sym| class_eval(<<-EOS, __FILE__, __LINE__) unless defined?
2006 May 26
1
access a ActionControllers protected method from plugin?
I can''t belive I fit that in as the subject! I''m writing a plugin that will allow me to grab some text from a database and call the render method from ActionController on part of the text. I can''t seem to figure out how to access the render method of ActionController::Base. I keep getting the "uninitialized constant Execute" error. How can I do this?
2006 Mar 28
0
How to set session variable in plug-ins
I''m working on a plug-in which has to manipulate some session varibles Unfortunately I end up with "Symbol as array index" errors. Probably the error occurs in a point that I never think about but here''s an abstract plug-in which generates the same error. It fails in the line of assignment "session[:aaa_uid] = uid" with "Symbol as array index"
2006 Jul 12
11
ruby-debug 0.1.3
Hello Everyone, I''m pleasant to announce the release of ruby-debug 0.1.3. If you think that ruby-breakpoint is too limited for your needs and debug.rb brings your application to its knees, you might find this small extension useful. INSTALL It''s a usual procedure: $ gem install ruby-debug DOCS This library has almost identical interface with the standard debug.rblibrary.
2008 Aug 23
0
Why ActionController::Base.class_eval for includes?
Just out of curiosity, why does action_controller.rb include classes with class_eval instead of directly? I.e., why ActionController::Base.class_eval do include ActionController::Flash include ActionController::Filters ... end instead of just class ActionController::Base include ActionController::Flash include ActionController::Filters ... end -- Posted via
2006 Jun 29
13
Ideal Ruby on Rails Development Environment on Linux
Hello, I''m not a developer myself, but I work for a hosting company that tries to cater to the needs of developers and basically right now I am trying to create a hosting platform that will be perfect for ruby developers. This is a linux VPS service and I create the base templates to make the system look however i want it after install. I was hoping some of you could give me
2006 Feb 15
36
Rubuntu Live CD for Rails
Friends- I am almost finished with a custom live cd called Rubuntu ;-) This is an ubuntu live cd variant that comes preloaded with ruby and rails developers in mind. I already have it working with all the basics but I was wondering what extras people would like to see on this distro. What editors with what configurations? What other tools do people really like for rails development on a
2008 Dec 03
5
How to test a plugin
Guys, I''ve created a plugin, i wanna put my automated test there. However, I got bad file descriptor error when i run the test like normal unit test file: "ruby plugins/acts_as_fox/test/acts_as_fox_test.rb" How to test a plugin? Also, is it right to say that I should only put my unit tests (but not functional test for example) for the plugin in the plugin test folder?
2006 Jan 26
21
pagination_links help
I want append custom query parameters to my pagination links, like ?page=1&foo=bar. I can''t quite figure out how to do this with the pagination_links helper, although I believe the API says you should be able to: pagination_links(paginator, options={}, html_options={}) options are: :params: any additional routing parameters for page URLs Has anyone tried this? thanks, jeff --
2006 Feb 02
1
Inserting svn revision into site
Hi, Say I wanted to know what svn revision a given site was using, simply from looking at the site. How could I embed that information into the page (into maybe a html comment or in the page footer)? A switchtower task? Joe
2006 Mar 30
11
Rails 1.1 and Ruby 1.8.3
I''ve seen that Rails 1.1 is not reliable with Ruby 1.8.2 so you should upgrade to 1.8.4 I''m running ruby 1.8.3. What''s the story with it? Do I need to upgrade before I try Rails 1.1? Thanks Greg -- Greg Freemyer The Norcross Group Forensics for the 21st Century