From geoff at geoffdavis.net Fri Sep 1 09:29:07 2006 From: geoff at geoffdavis.net (Geoff Davis) Date: Fri, 01 Sep 2006 09:29:07 -0400 Subject: [raleigh.rb] Plugins Message-ID: <1157117347.4048.11.camel@test> Hi all-- I have been hacking on mephisto (blog package) to add a few features, and I am reaching a point at which it's time to start rolling plugins. One thing I'm having some trouble figuring out is the best way of modifying the database from a plugin's rake file (I need to add a few columns to a table). Anybody know of a good example I can look at? Mephisto plugins I'm working on: * Add nested comments * Require authentication to comment * Add digg-like comment / content ratings Geoff From nathaniel at talbott.ws Fri Sep 1 12:28:57 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Fri, 1 Sep 2006 12:28:57 -0400 Subject: [raleigh.rb] Plugins In-Reply-To: <1157117347.4048.11.camel@test> References: <1157117347.4048.11.camel@test> Message-ID: <657CD7FA-1F2A-465D-956D-6C0C1174DFC1@talbott.ws> On Sep 1, 2006, at 09:29 , Geoff Davis wrote: > I have been hacking on mephisto (blog package) to add a few features, > and I am reaching a point at which it's time to start rolling plugins. > One thing I'm having some trouble figuring out is the best way of > modifying the database from a plugin's rake file (I need to add a few > columns to a table). Anybody know of a good example I can look at? I think the best practice for this is to include a migration generator the user can run that will spit out a properly numbered migration in the right spot. The user is can then run the migration themselves after looking at it to make sure everything is copacetic. I know the acts_as_authenticated plugin generates a migration... that might one place to look for an example. > Mephisto plugins I'm working on: > * Add nested comments > * Require authentication to comment > * Add digg-like comment / content ratings Sounds like good stuff! -- Nathaniel Talbott <:((>< From ryan.daigle at gmail.com Fri Sep 1 12:40:58 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Fri, 01 Sep 2006 12:40:58 -0400 Subject: [raleigh.rb] Plugins In-Reply-To: <657CD7FA-1F2A-465D-956D-6C0C1174DFC1@talbott.ws> References: <1157117347.4048.11.camel@test> <657CD7FA-1F2A-465D-956D-6C0C1174DFC1@talbott.ws> Message-ID: <44F8629A.4030309@gmail.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/087ad6d6/attachment.html From charlesmbowman at gmail.com Fri Sep 1 16:18:05 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Fri, 1 Sep 2006 16:18:05 -0400 Subject: [raleigh.rb] page caching and dynamic pages Message-ID: <298c4d2a0609011318q71e6019bx5c489c968ec6a82b@mail.gmail.com> I'm working on a project that must be page cached. The demands are too high to allow for rails to start up on each page request. The problem is that I also want a roles based authentication system. How would you guys go about this. Would you use Ajax to get the user info or something else? I'm interested in your opinions. Charlie -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/dc3409b9/attachment.html From nathaniel at talbott.ws Fri Sep 1 16:22:56 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Fri, 1 Sep 2006 16:22:56 -0400 Subject: [raleigh.rb] page caching and dynamic pages In-Reply-To: <298c4d2a0609011318q71e6019bx5c489c968ec6a82b@mail.gmail.com> References: <298c4d2a0609011318q71e6019bx5c489c968ec6a82b@mail.gmail.com> Message-ID: On Sep 1, 2006, at 16:18 , Charlie Bowman wrote: > I'm working on a project that must be page cached. The demands are > too high to allow for rails to start up on each page request. The > problem is that I also want a roles based authentication system. > How would you guys go about this. Would you use Ajax to get the > user info or something else? I'm interested in your opinions. I'm not clear what you mean by Rails starting up for each page request - this is only the case under CGI, which is a miserable way to deploy a Rails app. If you're using something like FastCgi, or Mongrel behind an http-proxy, you should be able to get fine response times even without Rails-based page caching. What's your setup? -- Nathaniel Talbott <:((>< From charlesmbowman at gmail.com Fri Sep 1 16:26:29 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Fri, 1 Sep 2006 16:26:29 -0400 Subject: [raleigh.rb] page caching and dynamic pages In-Reply-To: References: <298c4d2a0609011318q71e6019bx5c489c968ec6a82b@mail.gmail.com> Message-ID: <298c4d2a0609011326k325430a5wf7f8b2703c661abe@mail.gmail.com> > > > > What's your setup? Sorry, I wasn't clear. The app will be ran under either fastcgi or mongrel. The powers that be demand any CMS we use to be full cachable. Nothing is served dynamically. For my project to be considered it must be ran with page-cacheing turned on. This makes dynamic roles tricky. -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/ff96d9f9/attachment.html From geoff at geoffdavis.net Fri Sep 1 16:30:18 2006 From: geoff at geoffdavis.net (Geoff Davis) Date: Fri, 01 Sep 2006 16:30:18 -0400 Subject: [raleigh.rb] page caching and dynamic pages In-Reply-To: <298c4d2a0609011326k325430a5wf7f8b2703c661abe@mail.gmail.com> References: <298c4d2a0609011318q71e6019bx5c489c968ec6a82b@mail.gmail.com> <298c4d2a0609011326k325430a5wf7f8b2703c661abe@mail.gmail.com> Message-ID: <1157142618.4048.58.camel@test> How exactly do they imagine that you will implement dynamic roles with static content? On Fri, 2006-09-01 at 16:26 -0400, Charlie Bowman wrote: > Sorry, I wasn't clear. The app will be ran under either fastcgi or > mongrel. The powers that be demand any CMS we use to be full > cachable. Nothing is served dynamically. For my project to be > considered it must be ran with page-cacheing turned on. This makes > dynamic roles tricky. From nathaniel at talbott.ws Fri Sep 1 16:34:39 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Fri, 1 Sep 2006 16:34:39 -0400 Subject: [raleigh.rb] page caching and dynamic pages In-Reply-To: <298c4d2a0609011326k325430a5wf7f8b2703c661abe@mail.gmail.com> References: <298c4d2a0609011318q71e6019bx5c489c968ec6a82b@mail.gmail.com> <298c4d2a0609011326k325430a5wf7f8b2703c661abe@mail.gmail.com> Message-ID: On Sep 1, 2006, at 16:26 , Charlie Bowman wrote: > Sorry, I wasn't clear. The app will be ran under either fastcgi > or mongrel. The powers that be demand any CMS we use to be full > cachable. Nothing is served dynamically. For my project to be > considered it must be ran with page-cacheing turned on. This makes > dynamic roles tricky. Wow - gotta love arbitrary technical requirements... don't get me started on that rant! Anyhow, IMO authorization is _always_ dynamic, it's just a matter of _where_ it's dynamic - in the application or at the web server level. The latter is typically faster, but at a huge flexibility cost (and the former can be quite fast if things are designed right). The only thing I can think of off the top of my head is to segregate the roles by directory path, and then use web server authentication to protect those directories. I think you can even get away with "virtual" role-based directories using routing. Anyone else have any ideas? -- Nathaniel Talbott <:((>< From charlesmbowman at gmail.com Fri Sep 1 16:34:19 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Fri, 1 Sep 2006 16:34:19 -0400 Subject: [raleigh.rb] page caching and dynamic pages In-Reply-To: <1157142618.4048.58.camel@test> References: <298c4d2a0609011318q71e6019bx5c489c968ec6a82b@mail.gmail.com> <298c4d2a0609011326k325430a5wf7f8b2703c661abe@mail.gmail.com> <1157142618.4048.58.camel@test> Message-ID: <298c4d2a0609011334nee8ee70r299bd5657ced2e26@mail.gmail.com> That's my job to figure out. I could use Ajax to check if the user is logged in. All content if viewable, only logged in users can submit content. Any form could check the user's auth status on submission, before save. I just need to display either a sign in link or the user's name with a link to the users account page. On 9/1/06, Geoff Davis wrote: > > How exactly do they imagine that you will implement dynamic roles with > static content? > > On Fri, 2006-09-01 at 16:26 -0400, Charlie Bowman wrote: > > Sorry, I wasn't clear. The app will be ran under either fastcgi or > > mongrel. The powers that be demand any CMS we use to be full > > cachable. Nothing is served dynamically. For my project to be > > considered it must be ran with page-cacheing turned on. This makes > > dynamic roles tricky. > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/c8613cb4/attachment.html From geoff at geoffdavis.net Fri Sep 1 16:41:30 2006 From: geoff at geoffdavis.net (Geoff Davis) Date: Fri, 01 Sep 2006 16:41:30 -0400 Subject: [raleigh.rb] page caching and dynamic pages In-Reply-To: References: <298c4d2a0609011318q71e6019bx5c489c968ec6a82b@mail.gmail.com> <298c4d2a0609011326k325430a5wf7f8b2703c661abe@mail.gmail.com> Message-ID: <1157143290.4048.64.camel@test> One alternative to Ajax for personalization might be to put Apache on the front end and use SSI includes to generate personalization. That would still entail a hit on Rails (but so would Ajax), and I think SSI would be a lot more robust. I'm sure there are equivalents for Apache alternatives. SSI is fast and dumb, and generating a small personalized portion of a page is presumably cheap. A related idea I have seen used is that the back-end CMS bakes content to a dynamic front-end instead of a static front-end. For example, you could have rails emit PHP pages where the PHP's only responsibility would be handling authentication and doing personalization. On Fri, 2006-09-01 at 16:34 -0400, Nathaniel Talbott wrote: > On Sep 1, 2006, at 16:26 , Charlie Bowman wrote: > > > Sorry, I wasn't clear. The app will be ran under either fastcgi > > or mongrel. The powers that be demand any CMS we use to be full > > cachable. Nothing is served dynamically. For my project to be > > considered it must be ran with page-cacheing turned on. This makes > > dynamic roles tricky. > > Wow - gotta love arbitrary technical requirements... don't get me > started on that rant! > > Anyhow, IMO authorization is _always_ dynamic, it's just a matter of > _where_ it's dynamic - in the application or at the web server level. > The latter is typically faster, but at a huge flexibility cost (and > the former can be quite fast if things are designed right). > > The only thing I can think of off the top of my head is to segregate > the roles by directory path, and then use web server authentication > to protect those directories. I think you can even get away with > "virtual" role-based directories using routing. > > Anyone else have any ideas? > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From nathaniel at talbott.ws Fri Sep 1 16:41:39 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Fri, 1 Sep 2006 16:41:39 -0400 Subject: [raleigh.rb] page caching and dynamic pages In-Reply-To: <298c4d2a0609011334nee8ee70r299bd5657ced2e26@mail.gmail.com> References: <298c4d2a0609011318q71e6019bx5c489c968ec6a82b@mail.gmail.com> <298c4d2a0609011326k325430a5wf7f8b2703c661abe@mail.gmail.com> <1157142618.4048.58.camel@test> <298c4d2a0609011334nee8ee70r299bd5657ced2e26@mail.gmail.com> Message-ID: <478A3E3A-46F5-47E2-859A-15BF667C3734@talbott.ws> On Sep 1, 2006, at 16:34 , Charlie Bowman wrote: > That's my job to figure out. I could use Ajax to check if the user > is logged in. All content if viewable, only logged in users can > submit content. Any form could check the user's auth status on > submission, before save. I just need to display either a sign in > link or the user's name with a link to the users account page. But to get true authentication you'll always have to check things server-side, won't you? Remember, when it comes to security, you always have to assume that the user is the Devil... -- Nathaniel Talbott <:((>< From ryan.daigle at gmail.com Fri Sep 1 16:45:42 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Fri, 01 Sep 2006 16:45:42 -0400 Subject: [raleigh.rb] page caching and dynamic pages In-Reply-To: <298c4d2a0609011334nee8ee70r299bd5657ced2e26@mail.gmail.com> References: <298c4d2a0609011318q71e6019bx5c489c968ec6a82b@mail.gmail.com> <298c4d2a0609011326k325430a5wf7f8b2703c661abe@mail.gmail.com> <1157142618.4048.58.camel@test> <298c4d2a0609011334nee8ee70r299bd5657ced2e26@mail.gmail.com> Message-ID: <44F89BF6.10202@gmail.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/67b31e28/attachment.html From charlesmbowman at gmail.com Fri Sep 1 16:47:16 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Fri, 1 Sep 2006 16:47:16 -0400 Subject: [raleigh.rb] page caching and dynamic pages In-Reply-To: <478A3E3A-46F5-47E2-859A-15BF667C3734@talbott.ws> References: <298c4d2a0609011318q71e6019bx5c489c968ec6a82b@mail.gmail.com> <298c4d2a0609011326k325430a5wf7f8b2703c661abe@mail.gmail.com> <1157142618.4048.58.camel@test> <298c4d2a0609011334nee8ee70r299bd5657ced2e26@mail.gmail.com> <478A3E3A-46F5-47E2-859A-15BF667C3734@talbott.ws> Message-ID: <298c4d2a0609011347g8c8cd2fte7dd9323e108981b@mail.gmail.com> Before any content is modified, the server will check the authentication. The 'static' stuff on the front is where my troubles lie. It appears that either ajax or SSI would be good choices for this, unless you guys have more ideas On 9/1/06, Nathaniel Talbott wrote: > > On Sep 1, 2006, at 16:34 , Charlie Bowman wrote: > > > That's my job to figure out. I could use Ajax to check if the user > > is logged in. All content if viewable, only logged in users can > > submit content. Any form could check the user's auth status on > > submission, before save. I just need to display either a sign in > > link or the user's name with a link to the users account page. > > But to get true authentication you'll always have to check things > server-side, won't you? Remember, when it comes to security, you > always have to assume that the user is the Devil... > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/d4691f4d/attachment.html From charlesmbowman at gmail.com Fri Sep 1 16:50:44 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Fri, 1 Sep 2006 16:50:44 -0400 Subject: [raleigh.rb] page caching and dynamic pages In-Reply-To: <298c4d2a0609011347g8c8cd2fte7dd9323e108981b@mail.gmail.com> References: <298c4d2a0609011318q71e6019bx5c489c968ec6a82b@mail.gmail.com> <298c4d2a0609011326k325430a5wf7f8b2703c661abe@mail.gmail.com> <1157142618.4048.58.camel@test> <298c4d2a0609011334nee8ee70r299bd5657ced2e26@mail.gmail.com> <478A3E3A-46F5-47E2-859A-15BF667C3734@talbott.ws> <298c4d2a0609011347g8c8cd2fte7dd9323e108981b@mail.gmail.com> Message-ID: <298c4d2a0609011350r2548fc3bj981370f5fdbe2f77@mail.gmail.com> The requirements may be unreasonable, but the system will have to be nearly as fast as mod-perl to be considered. Maybe I can get this speed with fragment caching, but I doubt it. I'm going to move forward with the system, then try to speed it up with caching when I'm nearly complete. The more I think about it, the more I think I may be pre-mature optimizing. On 9/1/06, Charlie Bowman wrote: > > Before any content is modified, the server will check the authentication. > The 'static' stuff on the front is where my troubles lie. It appears that > either ajax or SSI would be good choices for this, unless you guys have more > ideas > > > On 9/1/06, Nathaniel Talbott wrote: > > > > On Sep 1, 2006, at 16:34 , Charlie Bowman wrote: > > > > > That's my job to figure out. I could use Ajax to check if the user > > > is logged in. All content if viewable, only logged in users can > > > submit content. Any form could check the user's auth status on > > > submission, before save. I just need to display either a sign in > > > link or the user's name with a link to the users account page. > > > > But to get true authentication you'll always have to check things > > server-side, won't you? Remember, when it comes to security, you > > always have to assume that the user is the Devil... > > > > > > -- > > Nathaniel Talbott > > > > <:((>< > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/c1ef26e3/attachment.html From geoff at geoffdavis.net Fri Sep 1 16:54:18 2006 From: geoff at geoffdavis.net (Geoff Davis) Date: Fri, 01 Sep 2006 16:54:18 -0400 Subject: [raleigh.rb] page caching and dynamic pages In-Reply-To: <298c4d2a0609011350r2548fc3bj981370f5fdbe2f77@mail.gmail.com> References: <298c4d2a0609011318q71e6019bx5c489c968ec6a82b@mail.gmail.com> <298c4d2a0609011326k325430a5wf7f8b2703c661abe@mail.gmail.com> <1157142618.4048.58.camel@test> <298c4d2a0609011334nee8ee70r299bd5657ced2e26@mail.gmail.com> <478A3E3A-46F5-47E2-859A-15BF667C3734@talbott.ws> <298c4d2a0609011347g8c8cd2fte7dd9323e108981b@mail.gmail.com> <298c4d2a0609011350r2548fc3bj981370f5fdbe2f77@mail.gmail.com> Message-ID: <1157144058.4048.68.camel@test> If you are brave, you could also try edge side includes in Squid 3. Squid 3 is unreleased (and has been for a couple of years), but from what I understand, it's usable in production as a web proxy. (Word on the street is that the holdup is that one of the developers wants to reimplement the way it handles NTLM, which I think is mainly important if you are pointing it in the opposite direction). ESI is a very cool way of doing fragment caching, and squid is crazy fast. On Fri, 2006-09-01 at 16:50 -0400, Charlie Bowman wrote: > The requirements may be unreasonable, but the system will have to be > nearly as fast as mod-perl to be considered. Maybe I can get this > speed with fragment caching, but I doubt it. I'm going to move > forward with the system, then try to speed it up with caching when I'm > nearly complete. The more I think about it, the more I think I may be > pre-mature optimizing. > > On 9/1/06, Charlie Bowman wrote: > Before any content is modified, the server will check the > authentication. The 'static' stuff on the front is where my > troubles lie. It appears that either ajax or SSI would be > good choices for this, unless you guys have more ideas > > > On 9/1/06, Nathaniel Talbott wrote: > On Sep 1, 2006, at 16:34 , Charlie Bowman wrote: > > > That's my job to figure out. I could use Ajax to > check if the user > > is logged in. All content if viewable, only logged > in users can > > submit content. Any form could check the user's > auth status on > > submission, before save. I just need to display > either a sign in > > link or the user's name with a link to the users > account page. > > But to get true authentication you'll always have to > check things > server-side, won't you? Remember, when it comes to > security, you > always have to assume that the user is the Devil... > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb- > members > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From pelargir at gmail.com Fri Sep 1 17:50:13 2006 From: pelargir at gmail.com (Matthew) Date: Fri, 1 Sep 2006 17:50:13 -0400 Subject: [raleigh.rb] Interesting AJAX problem here Message-ID: Got an interesting AJAX problem here. I have a form that adds a new DIV to the end of a list, highlighting it with the cool yellow fade out afterwards. Pretty standard stuff. The problem is that my list is broken into four separate sections, and the section to which the new DIV will get added is determined by the value of a drop-down in the add form. My DIVs look something like this:
etc...
This is my form_remote_tag: <%= form_remote_tag( :url => { :controller => "course", :action => "create" }, :id => "course_form", :update => "courses", :position => "bottom", :complete => "course_added(request)" ) %> I need the value of :update to be (depending on which section is selected) alternately "math_courses", "english_courses", "science_courses", or "elective_courses." The value it should be can be determined by JavaScript. The problem is that the form_remote_tag helper only takes a CSS ID for the :update parameter, NOT a block of JavaScript to call. (And no, I can't really change the way the DIVs are organized because there is other junk in the HTML sample above that I didn't include. Stuff like headers for each section, stuff that needs to be there.) I'd like to avoid re-rendering the entire list of DIVs just to add this one DIV to the right spot, but I can't figure out how to get the DIV to show up in the correct area without modifying :update to accept a JavaScript function. Any suggestions? Matthew -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/0cc88d6d/attachment-0001.html From ryan.daigle at gmail.com Fri Sep 1 18:05:32 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Fri, 01 Sep 2006 18:05:32 -0400 Subject: [raleigh.rb] Interesting AJAX problem here In-Reply-To: References: Message-ID: <44F8AEAC.5030502@gmail.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/3f97e5ad/attachment.html From charlesmbowman at gmail.com Fri Sep 1 18:23:21 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Fri, 1 Sep 2006 18:23:21 -0400 Subject: [raleigh.rb] Interesting AJAX problem here In-Reply-To: <44F8AEAC.5030502@gmail.com> References: <44F8AEAC.5030502@gmail.com> Message-ID: <298c4d2a0609011523s7c25d57avc528dc530f501b58@mail.gmail.com> I agree, rjs will do the trick nicely On 9/1/06, Ryan Daigle wrote: > > Seems like you could use RJS templates instead of the more static > form_remote_tag options. I.e. submit the parameter that determines which > section to update in your remote request, and have the rjs send the update > to the proper div based on that key? > > Matthew wrote: > > Got an interesting AJAX problem here. I have a form that adds a new DIV to > the end of a list, highlighting it with the cool yellow fade out afterwards. > Pretty standard stuff. The problem is that my list is broken into four > separate sections, and the section to which the new DIV will get added is > determined by the value of a drop-down in the add form. > > My DIVs look something like this: > >
>
>
>
>
> etc... >
> > This is my form_remote_tag: > > <%= form_remote_tag( > :url => { :controller => "course", :action => "create" }, > :id => "course_form", > :update => "courses", > :position => "bottom", > :complete => "course_added(request)" > ) %> > > I need the value of :update to be (depending on which section is selected) > alternately "math_courses", "english_courses", "science_courses", or > "elective_courses." The value it should be can be determined by JavaScript. > The problem is that the form_remote_tag helper only takes a CSS ID for the > :update parameter, NOT a block of JavaScript to call. (And no, I can't > really change the way the DIVs are organized because there is other junk in > the HTML sample above that I didn't include. Stuff like headers for each > section, stuff that needs to be there.) > > I'd like to avoid re-rendering the entire list of DIVs just to add this > one DIV to the right spot, but I can't figure out how to get the DIV to show > up in the correct area without modifying :update to accept a JavaScript > function. Any suggestions? > > Matthew > > ------------------------------ > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.orghttp://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/9dd5ee30/attachment.html From pelargir at gmail.com Fri Sep 1 20:08:39 2006 From: pelargir at gmail.com (Matthew) Date: Fri, 1 Sep 2006 20:08:39 -0400 Subject: [raleigh.rb] Interesting AJAX problem here In-Reply-To: <298c4d2a0609011523s7c25d57avc528dc530f501b58@mail.gmail.com> References: <44F8AEAC.5030502@gmail.com> <298c4d2a0609011523s7c25d57avc528dc530f501b58@mail.gmail.com> Message-ID: This brings up another interesting question. What does one do if the JavaScript generated by one's RJS template is displayed in a blank page (instead of being executed) after submitting through a form_remote_tag? I had this problem once before and thought it had something to do with MIME types, but I'm having trouble figuring out what to do now. Thanks, Matthew On 9/1/06, Charlie Bowman wrote: > > I agree, rjs will do the trick nicely > > > On 9/1/06, Ryan Daigle wrote: > > > > Seems like you could use RJS templates instead of the more static > > form_remote_tag options. I.e. submit the parameter that determines > > which section to update in your remote request, and have the rjs send the > > update to the proper div based on that key? > > > > Matthew wrote: > > > > Got an interesting AJAX problem here. I have a form that adds a new DIV > > to the end of a list, highlighting it with the cool yellow fade out > > afterwards. Pretty standard stuff. The problem is that my list is broken > > into four separate sections, and the section to which the new DIV will get > > added is determined by the value of a drop-down in the add form. > > > > My DIVs look something like this: > > > >
> >
> >
> >
> >
> > etc... > >
> > > > This is my form_remote_tag: > > > > <%= form_remote_tag( > > :url => { :controller => "course", :action => "create" > > }, > > :id => "course_form", > > :update => "courses", > > :position => "bottom", > > :complete => "course_added(request)" > > ) %> > > > > I need the value of :update to be (depending on which section is > > selected) alternately "math_courses", "english_courses", "science_courses", > > or "elective_courses." The value it should be can be determined by > > JavaScript. The problem is that the form_remote_tag helper only takes a CSS > > ID for the :update parameter, NOT a block of JavaScript to call. (And no, I > > can't really change the way the DIVs are organized because there is other > > junk in the HTML sample above that I didn't include. Stuff like headers for > > each section, stuff that needs to be there.) > > > > I'd like to avoid re-rendering the entire list of DIVs just to add this > > one DIV to the right spot, but I can't figure out how to get the DIV to show > > up in the correct area without modifying :update to accept a JavaScript > > function. Any suggestions? > > > > Matthew > > > > ------------------------------ > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/58eaeec9/attachment.html From nathaniel at talbott.ws Fri Sep 1 20:12:42 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Fri, 1 Sep 2006 20:12:42 -0400 Subject: [raleigh.rb] Interesting AJAX problem here In-Reply-To: References: <44F8AEAC.5030502@gmail.com> <298c4d2a0609011523s7c25d57avc528dc530f501b58@mail.gmail.com> Message-ID: <6735654C-8C25-48C3-9BD1-AD66D681ED84@talbott.ws> On Sep 1, 2006, at 20:08 , Matthew wrote: > This brings up another interesting question. What does one do if > the JavaScript generated by one's RJS template is displayed in a > blank page (instead of being executed) after submitting through a > form_remote_tag? I had this problem once before and thought it had > something to do with MIME types, but I'm having trouble figuring > out what to do now. I'm not clear on what's happening - is the whole page getting replaced with Javascript source? Or something else? -- Nathaniel Talbott <:((>< From kevin.olbrich at gmail.com Fri Sep 1 21:05:54 2006 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Fri, 1 Sep 2006 21:05:54 -0400 Subject: [raleigh.rb] Interesting AJAX problem here In-Reply-To: <6735654C-8C25-48C3-9BD1-AD66D681ED84@talbott.ws> References: <44F8AEAC.5030502@gmail.com> <298c4d2a0609011523s7c25d57avc528dc530f501b58@mail.gmail.com> <6735654C-8C25-48C3-9BD1-AD66D681ED84@talbott.ws> Message-ID: I've seen issues where RJS templates just render as text if you don't set your content-type header manually. I think I encountered it when I rendered the RJS to text. This changes the content-type header to the wrong setting. FWIW, I would also suggest taking a look at the KRJS plugin. Makes RJS quite painless. _Kevin On 9/1/06, Nathaniel Talbott wrote: > > On Sep 1, 2006, at 20:08 , Matthew wrote: > > > This brings up another interesting question. What does one do if > > the JavaScript generated by one's RJS template is displayed in a > > blank page (instead of being executed) after submitting through a > > form_remote_tag? I had this problem once before and thought it had > > something to do with MIME types, but I'm having trouble figuring > > out what to do now. > > I'm not clear on what's happening - is the whole page getting > replaced with Javascript source? Or something else? > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Kevin Olbrich kevin.olbrich at gmail.com CONFIDENTIAL Unless otherwise indicated or obvious from the nature of the following communication, the information contained herein is a privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. It the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies, electronic, paper, or otherwise, which you may have of this communication. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/60c1dd16/attachment.html From pelargir at gmail.com Fri Sep 1 21:06:13 2006 From: pelargir at gmail.com (Matthew) Date: Fri, 1 Sep 2006 21:06:13 -0400 Subject: [raleigh.rb] Interesting AJAX problem here In-Reply-To: <6735654C-8C25-48C3-9BD1-AD66D681ED84@talbott.ws> References: <44F8AEAC.5030502@gmail.com> <298c4d2a0609011523s7c25d57avc528dc530f501b58@mail.gmail.com> <6735654C-8C25-48C3-9BD1-AD66D681ED84@talbott.ws> Message-ID: The whole page is getting replaced with the JavaScript source. Matthew On 9/1/06, Nathaniel Talbott wrote: > > On Sep 1, 2006, at 20:08 , Matthew wrote: > > > This brings up another interesting question. What does one do if > > the JavaScript generated by one's RJS template is displayed in a > > blank page (instead of being executed) after submitting through a > > form_remote_tag? I had this problem once before and thought it had > > something to do with MIME types, but I'm having trouble figuring > > out what to do now. > > I'm not clear on what's happening - is the whole page getting > replaced with Javascript source? Or something else? > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/46a56743/attachment.html From ryan.daigle at gmail.com Fri Sep 1 21:41:43 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Fri, 01 Sep 2006 21:41:43 -0400 Subject: [raleigh.rb] Interesting AJAX problem here In-Reply-To: References: <44F8AEAC.5030502@gmail.com> <298c4d2a0609011523s7c25d57avc528dc530f501b58@mail.gmail.com> <6735654C-8C25-48C3-9BD1-AD66D681ED84@talbott.ws> Message-ID: <44F8E157.5010303@gmail.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/4ea8c609/attachment.html From robertfwest at gmail.com Fri Sep 1 23:55:25 2006 From: robertfwest at gmail.com (Rob West) Date: Fri, 1 Sep 2006 23:55:25 -0400 Subject: [raleigh.rb] Anyone used the Ruby Java Bridge project? In-Reply-To: References: <2b27183e0608151622h61e5847bocfcb5be2e1ab0180@mail.gmail.com> <44E9D3EB.90606@gmail.com> <2b27183e0608290946k334123des3f2b7f198542a3a@mail.gmail.com> <20881DEC-B1DA-4891-AE42-B46822FCA91A@nc.rr.com> Message-ID: Jared, I just came across a blog postby Charles Nutter (the JRuby guy) that mentions another blog that shows that YAJB has serious problems but that RJB works even if it "looks cumbersome". I guess it's not OK to require that users of your driver use JRuby only? That of course would get rid of the separate server problem. Also, Charles mentions elsewhere that they've had an ActiveRecord JDBC adapterworking since June for MySQL and Oracle. - Rob On 8/31/06, Jared Richardson wrote: > > Following up on my own message... > I'm going to move forward using YAJB - Yet Another Ruby Bridge. :) > > > http://www.cmt.phys.kyushu-u.ac.jp/~M.Sakurai/cgi-bin/fw/wiki.cgi?page=YAJB > > The docs are sparse but it seems to Just Work. > > Here's an example bit of code: > > require 'yajb/jbridge' > include JavaBridge > jimport "javax.swing.*" > > :JOptionPane.jclass.showMessageDialog( nil, "Hello World!") > > This will let me wrap the JDBC driver directly. > > Jared > http://jaredrichardson.net > > > > On Aug 29, 2006, at 4:29 PM, Jared Richardson wrote: > > I'm working on another Ruby database driver, this time for a database > written in Java (Hypersonic, http://www.hsqldb.org/) > > I'm looking at two projects to get Ruby talking to a Java database. The > first is JRuby and the second is RJB. > > JRuby has the advantage of being well tested and a very active development > community. In my case however, I think I'd have to have a second server bit > up and running. I was thinking of going this route: > > Rails -> Active Record -> Hypersonic_adapter.rb -> ( over the network via > drb or sockets) -> Java "server" program running Jruby w/drb -> JDBC Driver > -> database server > > > But if the Ruby Java Bridge project is sufficiently mature I can go this > route > > Rails -> Active Record -> Hypersonic_adapter.rb -> JRB -> JDBC driver -> > database server > > Using RJB eliminates the Java "server" bit and potentially the network > overhead. > > Does anyone have any experience with either project? Or have any ideas for > another direction? > > Thanks, > > Jared > http://jaredrichardson.net > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060901/15b6367b/attachment.html From pelargir at gmail.com Sat Sep 2 09:54:53 2006 From: pelargir at gmail.com (Matthew) Date: Sat, 2 Sep 2006 09:54:53 -0400 Subject: [raleigh.rb] Interesting AJAX problem here In-Reply-To: <44F8E157.5010303@gmail.com> References: <44F8AEAC.5030502@gmail.com> <298c4d2a0609011523s7c25d57avc528dc530f501b58@mail.gmail.com> <6735654C-8C25-48C3-9BD1-AD66D681ED84@talbott.ws> <44F8E157.5010303@gmail.com> Message-ID: Very nice. Using RJS did fix the original problem I had. The second issue turned out to be related to a JavaScript function that I was calling as the form got submitted, which in turn called "submit()" on the form again. So Ryan was right, the form was getting submitted as a vanilla post, not a remote request, thus causing the RJS to get returned as plain text in the browser window. Thanks, guys! Matthew On 9/1/06, Ryan Daigle wrote: > > I've seen this when the request wasn't made as a remote request. I.e. if > you were to type the request URL into your browser you would see the > javascript source returned. Are you sure the link_to_remote or > form_remote_tag is properly listed? > > Matthew wrote: > > The whole page is getting replaced with the JavaScript source. > > Matthew > > > On 9/1/06, Nathaniel Talbott < nathaniel at talbott.ws> wrote: > > > > On Sep 1, 2006, at 20:08 , Matthew wrote: > > > > > This brings up another interesting question. What does one do if > > > the JavaScript generated by one's RJS template is displayed in a > > > blank page (instead of being executed) after submitting through a > > > form_remote_tag? I had this problem once before and thought it had > > > something to do with MIME types, but I'm having trouble figuring > > > out what to do now. > > > > I'm not clear on what's happening - is the whole page getting > > replaced with Javascript source? Or something else? > > > > > > -- > > Nathaniel Talbott > > > > <:((>< > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > ------------------------------ > > _______________________________________________ raleigh-rb-members mailing > list raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060902/716ca39e/attachment-0001.html From lists-jared at nc.rr.com Sat Sep 2 10:59:51 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Sat, 2 Sep 2006 10:59:51 -0400 Subject: [raleigh.rb] Anyone used the Ruby Java Bridge project? In-Reply-To: References: <2b27183e0608151622h61e5847bocfcb5be2e1ab0180@mail.gmail.com> <44E9D3EB.90606@gmail.com> <2b27183e0608290946k334123des3f2b7f198542a3a@mail.gmail.com> <20881DEC-B1DA-4891-AE42-B46822FCA91A@nc.rr.com> Message-ID: On Sep 1, 2006, at 11:55 PM, Rob West wrote: > Jared, > > I just came across a blog post by Charles Nutter (the JRuby guy) > that mentions another blog that shows that YAJB has serious > problems but that RJB works even if it "looks cumbersome". > Thanks for the link! I'm digging in. RJB wouldn't install for me... it was an mkmf problem and I haven't gone deep on it yet. It couldn't find jni.h... I suspect it's a configuration on OS X issue. I went deep w/mkmf several months ago, but it was on Red Hat, not OS X, and I haven't swapped those bits back in yet. I got a basic Ruby to Hypersonic database adapter running in YAJB after one day... so I have to say that YAJB seems to work for me. I've inserted and read back out 10,000 entries rows w/o anything falling over. It did take a few seconds to run, but that could've been the database itself, the prints I had going, or the bridge causing the performance problems. I blogged on the topic and got a ping from someone who's used both RJB and YAJB and the big issue he's seen w/YAJB is that it uses a network serialization protocol for all interaction between the languages as opposed to RJB, which uses JNI, resulting in a huge performance difference. He suggested I invest in RJB even if it's a bit harder to get running. > I guess it's not OK to require that users of your driver use JRuby > only? That of course would get rid of the separate server problem. > Also, Charles mentions elsewhere that they've had an ActiveRecord > JDBC adapter working since June for MySQL and Oracle. > No, I can't require JRuby. Besides, we plan on open sourcing the work, and I don't think we can make that a general requirement. Especially since it's going to be a Rails adapter when we're done. I haven't looked at AR JDBC yet.... I'd assume it too slow for a Rails app anyway, but it might be worth trying. Thanks again! Jared http://jaredrichardson.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060902/94dc85bf/attachment.html From lists-jared at nc.rr.com Sun Sep 3 20:16:32 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Sun, 3 Sep 2006 20:16:32 -0400 Subject: [raleigh.rb] Anyone used the Ruby Java Bridge project? In-Reply-To: References: <2b27183e0608151622h61e5847bocfcb5be2e1ab0180@mail.gmail.com> <44E9D3EB.90606@gmail.com> <2b27183e0608290946k334123des3f2b7f198542a3a@mail.gmail.com> <20881DEC-B1DA-4891-AE42-B46822FCA91A@nc.rr.com> Message-ID: Charles Nutter sent me mail after seeing my blog post on this topic and suggested I try running Rails inside JRuby and use the JDBC adapter. When I asked him if he could suggest any blog postings with a tutorial on setting it up, he posted one! http:// headius.blogspot.com/2006/09/using-activerecord-jdbc-adapter.html I know when to take a hint... between Rob and Charles, I think I'm going to give up and give JRuby and their AR JDBC driver a try. :) I'm still not convinced it's something I can require of the customer... but if it's easy to set up and it Just Works, it might let my client start developing applications before the native version is done. And time is money, right? Jared http://jaredrichardson.net On Sep 2, 2006, at 10:59 AM, Jared Richardson wrote: > > On Sep 1, 2006, at 11:55 PM, Rob West wrote: > >> Jared, >> >> I just came across a blog post by Charles Nutter (the JRuby guy) >> that mentions another blog that shows that YAJB has serious >> problems but that RJB works even if it "looks cumbersome". >> > > Thanks for the link! I'm digging in. > > RJB wouldn't install for me... it was an mkmf problem and I haven't > gone deep on it yet. It couldn't find jni.h... I suspect it's a > configuration on OS X issue. I went deep w/mkmf several months ago, > but it was on Red Hat, not OS X, and I haven't swapped those bits > back in yet. > > I got a basic Ruby to Hypersonic database adapter running in YAJB > after one day... so I have to say that YAJB seems to work for me. > I've inserted and read back out 10,000 entries rows w/o anything > falling over. It did take a few seconds to run, but that could've > been the database itself, the prints I had going, or the bridge > causing the performance problems. > > I blogged on the topic and got a ping from someone who's used both > RJB and YAJB and the big issue he's seen w/YAJB is that it uses a > network serialization protocol for all interaction between the > languages as opposed to RJB, which uses JNI, resulting in a huge > performance difference. He suggested I invest in RJB even if it's a > bit harder to get running. > > >> I guess it's not OK to require that users of your driver use JRuby >> only? That of course would get rid of the separate server problem. >> Also, Charles mentions elsewhere that they've had an ActiveRecord >> JDBC adapter working since June for MySQL and Oracle. >> > > No, I can't require JRuby. Besides, we plan on open sourcing the > work, and I don't think we can make that a general requirement. > Especially since it's going to be a Rails adapter when we're done. > > I haven't looked at AR JDBC yet.... I'd assume it too slow for a > Rails app anyway, but it might be worth trying. > > Thanks again! > > Jared > http://jaredrichardson.net > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060903/a63e8f30/attachment.html From kevin.olbrich at gmail.com Wed Sep 6 21:17:26 2006 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Wed, 6 Sep 2006 21:17:26 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns Message-ID: I ran into a bit of a sticky problem with Rails a while back that I would like to be able to track down and fix. The problem is this... if you change the default date format for the date printing functions used by rails, it seems to confuse the database adapter. Apparently the database adapter uses the same routine to format date output for the database, and if you muck around with it, the database can't interpret dates properly. The net result being that date's get written to the DB as 0000-00-00 (with MySQL), but don't generate any error messages, making it difficult to track down the bug. Have any of you who have been spelunking in the AR code (Jared?) come across anything that might shed light on this? -- Kevin Olbrich kevin.olbrich at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060906/e0aa56b4/attachment.html From lists-jared at nc.rr.com Wed Sep 6 22:46:19 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Wed, 6 Sep 2006 22:46:19 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: References: Message-ID: <2228EAC1-CB7D-40F7-AB30-185E0558FA63@nc.rr.com> On Sep 6, 2006, at 9:17 PM, Kevin Olbrich wrote: > I ran into a bit of a sticky problem with Rails a while back that I > would like to be able to track down and fix. > > The problem is this... if you change the default date format for > the date printing functions used by rails, it seems to confuse the > database adapter. > Apparently the database adapter uses the same routine to format > date output for the database, and if you muck around with it, the > database can't interpret dates properly. > > The net result being that date's get written to the DB as > 0000-00-00 (with MySQL), but don't generate any error messages, > making it difficult to track down the bug. > > Have any of you who have been spelunking in the AR code (Jared?) > come across anything that might shed light on this? > You'd hate to see the code I wrote to handle dates in my first adapter. :) I'm in the middle of five things right now so I can't go too deep, but here's some stream of consciousness. Feel free to follow up with any extra questions. All the type conversion in the database adapters is adapter specific. While there are generic higher level routines, every adapter I looked at as an example changed that behavior slightly to match their databases convention. It sounds like you've wandered from the blessed path. :) Stu Halloway once said that half the cool stuff being done w/Ruby and Rails couldn't be done if it weren't all open source. If I were you I'd go peek in the active record gems folder on your box, and look at the mysql connection adapter. On my Mac this is in /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/ active_record/connection_adapters/ I'm looking through the code now and remembering that MySql cheats though... it requires some extra ruby classes to be available. But the main mysql_adapter.rb isn't doing anything fancy with the dates. So then we look in /usr/local/lib/ruby/gems/1.8/gems/ activerecord-1.14.4/lib/active_record/connection_adapters/abstract to find the basic operation. Look at schema_definitions.rb Search on date and you'll find def type_cast which casts values to and from the database formats. Be sure the values you are passing in and out conform to that code. In particular I'm seeing: when :datetime then self.class.string_to_time(value) and when :date then self.class.string_to_date(value) Then later... def self.string_to_date(string) return string unless string.is_a?(String) date_array = ParseDate.parsedate(string) # treat 0000-00-00 as nil Date.new(date_array[0], date_array[1], date_array[2]) rescue nil end def self.string_to_time(string) return string unless string.is_a?(String) time_array = ParseDate.parsedate(string)[0..5] # treat 0000-00-00 00:00:00 as nil Time.send(Base.default_timezone, *time_array) rescue nil end Those zeros look familiar. I'd bet your new format is not parse-able and being converted to nil. Jared http://jaredrichardson.net From lists-jared at nc.rr.com Wed Sep 6 22:47:50 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Wed, 6 Sep 2006 22:47:50 -0400 Subject: [raleigh.rb] Bruce Tate on Steamlined In-Reply-To: References: Message-ID: FYI, if you haven't seen it yet, Bruce Tate has a Streamlined tutorial on Alphaworks. http://www-128.ibm.com/developerworks/java/library/j-cb09056/ index.html?ca=drs- Crossing borders: Streamlined, Part 1: Enterprise-strength scaffolding using Ajax, metaprogramming, and the Ruby on Rails framework Jared http://jaredrichardson.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060906/446a1839/attachment-0001.html From kevin.olbrich at gmail.com Wed Sep 6 22:53:58 2006 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Wed, 6 Sep 2006 22:53:58 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: <2228EAC1-CB7D-40F7-AB30-185E0558FA63@nc.rr.com> References: <2228EAC1-CB7D-40F7-AB30-185E0558FA63@nc.rr.com> Message-ID: Ah Ha! Thanks Jared. I'll dig into this a bit more now that I have a clue where to look. -Kevin On 9/6/06, Jared Richardson wrote: > > > On Sep 6, 2006, at 9:17 PM, Kevin Olbrich wrote: > > > I ran into a bit of a sticky problem with Rails a while back that I > > would like to be able to track down and fix. > > > > The problem is this... if you change the default date format for > > the date printing functions used by rails, it seems to confuse the > > database adapter. > > Apparently the database adapter uses the same routine to format > > date output for the database, and if you muck around with it, the > > database can't interpret dates properly. > > > > The net result being that date's get written to the DB as > > 0000-00-00 (with MySQL), but don't generate any error messages, > > making it difficult to track down the bug. > > > > Have any of you who have been spelunking in the AR code (Jared?) > > come across anything that might shed light on this? > > > > You'd hate to see the code I wrote to handle dates in my first > adapter. :) > > I'm in the middle of five things right now so I can't go too deep, > but here's some stream of consciousness. Feel free to follow up with > any extra questions. > > All the type conversion in the database adapters is adapter specific. > While there are generic higher level routines, every adapter I looked > at as an example changed that behavior slightly to match their > databases convention. It sounds like you've wandered from the blessed > path. :) > > Stu Halloway once said that half the cool stuff being done w/Ruby and > Rails couldn't be done if it weren't all open source. If I were you > I'd go peek in the active record gems folder on your box, and look at > the mysql connection adapter. On my Mac this is in > /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/ > active_record/connection_adapters/ > > I'm looking through the code now and remembering that MySql cheats > though... it requires some extra ruby classes to be available. But > the main mysql_adapter.rb isn't doing anything fancy with the dates. > > So then we look in /usr/local/lib/ruby/gems/1.8/gems/ > activerecord-1.14.4/lib/active_record/connection_adapters/abstract to > find the basic operation. > > Look at schema_definitions.rb > > Search on date and you'll find def type_cast which casts values to > and from the database formats. Be sure the values you are passing in > and out conform to that code. In particular I'm seeing: > > when :datetime then self.class.string_to_time(value) > > and > > when :date then self.class.string_to_date(value) > > Then later... > > def self.string_to_date(string) > return string unless string.is_a?(String) > date_array = ParseDate.parsedate(string) > # treat 0000-00-00 as nil > Date.new(date_array[0], date_array[1], date_array[2]) rescue > nil > end > > def self.string_to_time(string) > return string unless string.is_a?(String) > time_array = ParseDate.parsedate(string)[0..5] > # treat 0000-00-00 00:00:00 as nil > Time.send(Base.default_timezone, *time_array) rescue nil > end > > > Those zeros look familiar. I'd bet your new format is not parse-able > and being converted to nil. > > > Jared > http://jaredrichardson.net > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Kevin Olbrich kevin.olbrich at gmail.com CONFIDENTIAL Unless otherwise indicated or obvious from the nature of the following communication, the information contained herein is a privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. It the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies, electronic, paper, or otherwise, which you may have of this communication. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060906/f0699899/attachment.html From nospam at tonyspencer.com Thu Sep 7 18:48:38 2006 From: nospam at tonyspencer.com (Tony Spencer) Date: Thu, 07 Sep 2006 18:48:38 -0400 Subject: [raleigh.rb] Ruby on Rails training with David A. Black in Raleigh In-Reply-To: Message-ID: New to the list? Maybe you?ve watched that amazing 15 minute demo video on the official RoR site or maybe you?ve already installed Ruby and Rails and setup a web app in under an hour. Either way you are frustrated with repetitive tasks Java/JSP, PHP and the like force you to endure and you want some RoR. Raleigh on Rails is now taking registration for an 'Introduction to Ruby on Rails' training course October 2nd to October 5th, 2006 in Raleigh, NC. The course will be led by acclaimed author and trainer Dr. David A. Black whose recently published book 'Ruby for Rails' has been rated 10 out of 10 by Slashdot. " A stunningly well written explanation of real-world Ruby skills for Rails development." http://www.raleighonrails.com Feel free to call me if you or a friend is interested and I?ll be happy to chat with you about it. Tony 919.277.0931 P.S. - We?ve got some hot RaleighOnRails bumpers stickers that we?ll bring to the next meetup. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060907/01d5deaa/attachment.html From lists-jared at nc.rr.com Fri Sep 8 09:04:12 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Fri, 8 Sep 2006 09:04:12 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: References: <2228EAC1-CB7D-40F7-AB30-185E0558FA63@nc.rr.com> Message-ID: <93AEA8AC-4C84-42C4-AB1E-CA56D4514361@nc.rr.com> Kevin, I saw this post and thought of you http://www.railtie.net/articles/2006/09/07/validate-dates-in-your-models It might be a useful tool for validating your dates in the code instead of letting the database do it. Jared http://jaredrichardson.net On Sep 6, 2006, at 10:53 PM, Kevin Olbrich wrote: > Ah Ha! Thanks Jared. I'll dig into this a bit more now that I have > a clue where to look. > > -Kevin > > On 9/6/06, Jared Richardson < lists-jared at nc.rr.com> wrote: > > On Sep 6, 2006, at 9:17 PM, Kevin Olbrich wrote: > > > I ran into a bit of a sticky problem with Rails a while back that I > > would like to be able to track down and fix. > > > > The problem is this... if you change the default date format for > > the date printing functions used by rails, it seems to confuse the > > database adapter. > > Apparently the database adapter uses the same routine to format > > date output for the database, and if you muck around with it, the > > database can't interpret dates properly. > > > > The net result being that date's get written to the DB as > > 0000-00-00 (with MySQL), but don't generate any error messages, > > making it difficult to track down the bug. > > > > Have any of you who have been spelunking in the AR code (Jared?) > > come across anything that might shed light on this? > > > > You'd hate to see the code I wrote to handle dates in my first > adapter. :) > > I'm in the middle of five things right now so I can't go too deep, > but here's some stream of consciousness. Feel free to follow up with > any extra questions. > > All the type conversion in the database adapters is adapter specific. > While there are generic higher level routines, every adapter I looked > at as an example changed that behavior slightly to match their > databases convention. It sounds like you've wandered from the blessed > path. :) > > Stu Halloway once said that half the cool stuff being done w/Ruby and > Rails couldn't be done if it weren't all open source. If I were you > I'd go peek in the active record gems folder on your box, and look at > the mysql connection adapter. On my Mac this is in > /usr/local/lib/ruby/gems/1.8/gems/activerecord- 1.14.4/lib/ > active_record/connection_adapters/ > > I'm looking through the code now and remembering that MySql cheats > though... it requires some extra ruby classes to be available. But > the main mysql_adapter.rb isn't doing anything fancy with the dates. > > So then we look in /usr/local/lib/ruby/gems/1.8/gems/ > activerecord-1.14.4/lib/active_record/connection_adapters/abstract to > find the basic operation. > > Look at schema_definitions.rb > > Search on date and you'll find def type_cast which casts values to > and from the database formats. Be sure the values you are passing in > and out conform to that code. In particular I'm seeing: > > when :datetime then self.class.string_to_time(value) > > and > > when :date then self.class.string_to_date(value) > > Then later... > > def self.string_to_date(string) > return string unless string.is_a?(String) > date_array = ParseDate.parsedate(string) > # treat 0000-00-00 as nil > Date.new(date_array[0], date_array[1], date_array[2]) rescue > nil > end > > def self.string_to_time(string) > return string unless string.is_a?(String) > time_array = ParseDate.parsedate (string)[0..5] > # treat 0000-00-00 00:00:00 as nil > Time.send(Base.default_timezone, *time_array) rescue nil > end > > > Those zeros look familiar. I'd bet your new format is not parse-able > and being converted to nil. > > > Jared > http://jaredrichardson.net > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > -- > Kevin Olbrich > kevin.olbrich at gmail.com > > CONFIDENTIAL > Unless otherwise indicated or obvious from the nature of the > following communication, the information contained herein is a > privileged and confidential information/work product. The > communication is intended for the use of the individual or entity > named above. It the reader of this transmission is not the intended > recipient, you are hereby notified that any dissemination, > distribution, or copying of this communication is strictly > prohibited. If you have received this communication in error or are > not sure whether it is privileged, please immediately notify us by > return e-mail and destroy any copies, electronic, paper, or > otherwise, which you may have of this communication. > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060908/ec3e9b13/attachment-0001.html From lists-jared at nc.rr.com Fri Sep 8 10:17:08 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Fri, 8 Sep 2006 10:17:08 -0400 Subject: [raleigh.rb] Adding your own Ruby library? In-Reply-To: References: Message-ID: <6520F3DF-AB8A-42D9-BA46-6DD55F14EFFD@nc.rr.com> Hi all, I'm trying to install a Ruby database driver... last time around mkmf did this for me "auto-magically". This time I'm actually having to understand it. Who would've thought C would make anything easier?? :) Looking in my gems folder, it appears that I can just make a new folder (like hypersonic-0.0.1), then put my Ruby file in it, create a lib folder there and put my Jar file (JDBC driver) in there, and I'm good. I can then go to irb and type require 'Hypersonic' and I'm up and running. Am I doing this right or taking horrible bad shortcuts that will cause heartache and famine later? Next, my driver requires a classpath to be set. Is there a way to set this for the gem? So that when someone uses the Gem, the classpath gets set? I can require the users to set it themselves, but cleaner would be nice. Eventually I'm planning to wrap the whole thing up in a proper Gem, as described here: http://docs.rubygems.org/read/chapter/10#page29 Is there a better reference anywhere? I don't know that this one is bad, I just haven't read it very deep yet. Thanks in advance! Jared http://jaredrichardson.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060908/485ff9cf/attachment.html From lists-jared at nc.rr.com Fri Sep 8 10:30:03 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Fri, 8 Sep 2006 10:30:03 -0400 Subject: [raleigh.rb] Adding your own Ruby library? In-Reply-To: <6520F3DF-AB8A-42D9-BA46-6DD55F14EFFD@nc.rr.com> References: <6520F3DF-AB8A-42D9-BA46-6DD55F14EFFD@nc.rr.com> Message-ID: I spoke too soon... apparently my require from IRB was finding the Hypersonic file because I was in the gems directory... any ideas on how I can register this class with Ruby? On Sep 8, 2006, at 10:17 AM, Jared Richardson wrote: > Hi all, > > I'm trying to install a Ruby database driver... last time around > mkmf did this for me "auto-magically". This time I'm actually > having to understand it. Who would've thought C would make anything > easier?? :) > > Looking in my gems folder, it appears that I can just make a new > folder (like hypersonic-0.0.1), then put my Ruby file in it, create > a lib folder there and put my Jar file (JDBC driver) in there, and > I'm good. > > I can then go to irb and type require 'Hypersonic' and I'm up and > running. > > Am I doing this right or taking horrible bad shortcuts that will > cause heartache and famine later? > > > Next, my driver requires a classpath to be set. Is there a way to > set this for the gem? So that when someone uses the Gem, the > classpath gets set? I can require the users to set it themselves, > but cleaner would be nice. > > Eventually I'm planning to wrap the whole thing up in a proper Gem, > as described here: > http://docs.rubygems.org/read/chapter/10#page29 > > Is there a better reference anywhere? I don't know that this one is > bad, I just haven't read it very deep yet. > > Thanks in advance! > > Jared > http://jaredrichardson.net > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060908/e4da5527/attachment.html From adam at thewilliams.ws Fri Sep 8 10:32:29 2006 From: adam at thewilliams.ws (Adam Williams) Date: Fri, 8 Sep 2006 10:32:29 -0400 Subject: [raleigh.rb] Adding your own Ruby library? In-Reply-To: <6520F3DF-AB8A-42D9-BA46-6DD55F14EFFD@nc.rr.com> References: <6520F3DF-AB8A-42D9-BA46-6DD55F14EFFD@nc.rr.com> Message-ID: Jared, I did a Gem for a project, OFXRB, recently. It was super simple. I tried to make it a 1, 2, 3 kind of thing. http://home.thewilliams.ws/ 2006/9/8/my-first-gem hth, aiwilliams On Sep 8, 2006, at 10:17 AM, Jared Richardson wrote: > Hi all, > > I'm trying to install a Ruby database driver... last time around > mkmf did this for me "auto-magically". This time I'm actually > having to understand it. Who would've thought C would make anything > easier?? :) > > Looking in my gems folder, it appears that I can just make a new > folder (like hypersonic-0.0.1), then put my Ruby file in it, create > a lib folder there and put my Jar file (JDBC driver) in there, and > I'm good. > > I can then go to irb and type require 'Hypersonic' and I'm up and > running. > > Am I doing this right or taking horrible bad shortcuts that will > cause heartache and famine later? > > > Next, my driver requires a classpath to be set. Is there a way to > set this for the gem? So that when someone uses the Gem, the > classpath gets set? I can require the users to set it themselves, > but cleaner would be nice. > > Eventually I'm planning to wrap the whole thing up in a proper Gem, > as described here: > http://docs.rubygems.org/read/chapter/10#page29 > > Is there a better reference anywhere? I don't know that this one is > bad, I just haven't read it very deep yet. > > Thanks in advance! > > Jared > http://jaredrichardson.net > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060908/efae72ad/attachment.html From lists-jared at nc.rr.com Fri Sep 8 10:57:34 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Fri, 8 Sep 2006 10:57:34 -0400 Subject: [raleigh.rb] Adding your own Ruby library? In-Reply-To: References: <6520F3DF-AB8A-42D9-BA46-6DD55F14EFFD@nc.rr.com> Message-ID: <1A814981-74CA-42C8-8854-4AF5B8E9C378@nc.rr.com> Thanks Adam... I'm following your blog entry and finding this error message: uninitialized constant Gem::Buider Is there a missing require? I'll go Google it but I thought I'd ask. :) Jared http://jaredrichardson.net On Sep 8, 2006, at 10:32 AM, Adam Williams wrote: > Jared, > > I did a Gem for a project, OFXRB, recently. It was super simple. I > tried to make it a 1, 2, 3 kind of thing. http:// > home.thewilliams.ws/2006/9/8/my-first-gem > > hth, aiwilliams > > > On Sep 8, 2006, at 10:17 AM, Jared Richardson wrote: > >> Hi all, >> >> I'm trying to install a Ruby database driver... last time around >> mkmf did this for me "auto-magically". This time I'm actually >> having to understand it. Who would've thought C would make >> anything easier?? :) >> >> Looking in my gems folder, it appears that I can just make a new >> folder (like hypersonic-0.0.1), then put my Ruby file in it, >> create a lib folder there and put my Jar file (JDBC driver) in >> there, and I'm good. >> >> I can then go to irb and type require 'Hypersonic' and I'm up and >> running. >> >> Am I doing this right or taking horrible bad shortcuts that will >> cause heartache and famine later? >> >> >> Next, my driver requires a classpath to be set. Is there a way to >> set this for the gem? So that when someone uses the Gem, the >> classpath gets set? I can require the users to set it themselves, >> but cleaner would be nice. >> >> Eventually I'm planning to wrap the whole thing up in a proper >> Gem, as described here: >> http://docs.rubygems.org/read/chapter/10#page29 >> >> Is there a better reference anywhere? I don't know that this one >> is bad, I just haven't read it very deep yet. >> >> Thanks in advance! >> >> Jared >> http://jaredrichardson.net >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060908/e07535ba/attachment.html From robertfwest at gmail.com Fri Sep 8 11:11:50 2006 From: robertfwest at gmail.com (Rob West) Date: Fri, 8 Sep 2006 11:11:50 -0400 Subject: [raleigh.rb] Core JRuby developers hired by Sun! Message-ID: In case you haven't seen it elsewhere, Charles Nutter and Thomas Enebo have been hired by Sun to work on JRuby fulltime! Here is the link to Charles' blog post, which also has links to other articles: http://headius.blogspot.com/2006/09/jruby-steps-into-sun.html - Rob -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060908/5ddf953e/attachment-0001.html From adam at thewilliams.ws Fri Sep 8 11:20:12 2006 From: adam at thewilliams.ws (Adam Williams) Date: Fri, 8 Sep 2006 11:20:12 -0400 Subject: [raleigh.rb] Adding your own Ruby library? In-Reply-To: <1A814981-74CA-42C8-8854-4AF5B8E9C378@nc.rr.com> References: <6520F3DF-AB8A-42D9-BA46-6DD55F14EFFD@nc.rr.com> <1A814981-74CA-42C8-8854-4AF5B8E9C378@nc.rr.com> Message-ID: <87F00859-B7FB-49F1-8AA2-486D19EA0325@thewilliams.ws> On Sep 8, 2006, at 10:57 AM, Jared Richardson wrote: > Thanks Adam... I'm following your blog entry and finding this error > message: > > uninitialized constant Gem::Buider > > > Is there a missing require? Hey Jared. AFAIK, the "require 'rubygems'" should get the Gem module, which has the Builder (builder.rb). Perhaps the version of RubyGems that you have isn't quite the same? I have 0.8.11. aiwilliams From lists-jared at nc.rr.com Fri Sep 8 11:25:25 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Fri, 8 Sep 2006 11:25:25 -0400 Subject: [raleigh.rb] Adding your own Ruby library? In-Reply-To: <87F00859-B7FB-49F1-8AA2-486D19EA0325@thewilliams.ws> References: <6520F3DF-AB8A-42D9-BA46-6DD55F14EFFD@nc.rr.com> <1A814981-74CA-42C8-8854-4AF5B8E9C378@nc.rr.com> <87F00859-B7FB-49F1-8AA2-486D19EA0325@thewilliams.ws> Message-ID: <972AD774-31B8-4041-A9F5-8D27B723E8FE@nc.rr.com> I have another reply floating through the email/mailing list ethers. :) I typed builder wrong. Now I'm trying to add more file sets to the gem... your Dir.glob works fine but I can't get the s.files object to see anymore. On Sep 8, 2006, at 11:20 AM, Adam Williams wrote: > > On Sep 8, 2006, at 10:57 AM, Jared Richardson wrote: > >> Thanks Adam... I'm following your blog entry and finding this error >> message: >> >> uninitialized constant Gem::Buider >> >> >> Is there a missing require? > > Hey Jared. > > AFAIK, the "require 'rubygems'" should get the Gem module, which has > the Builder (builder.rb). Perhaps the version of RubyGems that you > have isn't quite the same? I have 0.8.11. > > aiwilliams > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From adam at thewilliams.ws Fri Sep 8 11:27:20 2006 From: adam at thewilliams.ws (Adam Williams) Date: Fri, 8 Sep 2006 11:27:20 -0400 Subject: [raleigh.rb] Core JRuby developers hired by Sun! In-Reply-To: References: Message-ID: Yeah, this is pretty exciting news. I started the RDT project, which has been using JRuby for awhile now (though I deserve no credit). Charles and Thomas have worked hard to fix things in the AST so that RDT could do outlining and highlighting better. Great guys, very responsive and helpful. Also, the RadRails guys are working with Erich Gamma this summer, Google sponsored type inference work on RDT, and the Eclipse foundation has committed some effort to dynamic language support, so hopefully we'll see some great things coming for Ruby for Eclipse (for all you non-Mac, non-TextMate users ;) adam williams (aiwilliams) On Sep 8, 2006, at 11:11 AM, Rob West wrote: > In case you haven't seen it elsewhere, Charles Nutter and Thomas > Enebo have been hired by Sun to work on JRuby fulltime! Here is the > link to Charles' blog post, which also has links to other articles: > http://headius.blogspot.com/2006/09/jruby-steps-into-sun.html > > - Rob > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060908/8628436d/attachment.html From lists-jared at nc.rr.com Fri Sep 8 14:18:12 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Fri, 8 Sep 2006 14:18:12 -0400 Subject: [raleigh.rb] Adding your own Ruby library? In-Reply-To: <972AD774-31B8-4041-A9F5-8D27B723E8FE@nc.rr.com> References: <6520F3DF-AB8A-42D9-BA46-6DD55F14EFFD@nc.rr.com> <1A814981-74CA-42C8-8854-4AF5B8E9C378@nc.rr.com> <87F00859-B7FB-49F1-8AA2-486D19EA0325@thewilliams.ws> <972AD774-31B8-4041-A9F5-8D27B723E8FE@nc.rr.com> Message-ID: I bugged Adam off list to avoid clogging up the list, but everything is working now. Adam's example works great. I've blogged on the topic and cut his example down a bit (removed the testing task) to make it simpler. Remember to require "rubygems" from irb ~before~ you try to use your newly created and installed gem. :) Thanks for the help! Jared http://jaredrichardson.net From kevin.olbrich at gmail.com Fri Sep 8 14:20:25 2006 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Fri, 8 Sep 2006 14:20:25 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: <93AEA8AC-4C84-42C4-AB1E-CA56D4514361@nc.rr.com> References: <2228EAC1-CB7D-40F7-AB30-185E0558FA63@nc.rr.com> <93AEA8AC-4C84-42C4-AB1E-CA56D4514361@nc.rr.com> Message-ID: Thanks Jared, That is useful, although it wasn't really an issue I was having to deal with yet. BTW, I wasn't trying to use the DB for date validation. I was just trying to be lazy and have rails use a prettier date format for output by default. -Kevin On 9/8/06, Jared Richardson wrote: > > Kevin, > > I saw this post and thought of you > > http://www.railtie.net/articles/2006/09/07/validate-dates-in-your-models > > It might be a useful tool for validating your dates in the code instead of > letting the database do it. > > Jared > http://jaredrichardson.net > > > > On Sep 6, 2006, at 10:53 PM, Kevin Olbrich wrote: > Ah Ha! Thanks Jared. I'll dig into this a bit more now that I have a clue > where to look. > > -Kevin > > On 9/6/06, Jared Richardson < lists-jared at nc.rr.com> wrote: > > > > On Sep 6, 2006, at 9:17 PM, Kevin Olbrich wrote: > > > > > I ran into a bit of a sticky problem with Rails a while back that I > > > would like to be able to track down and fix. > > > > > > The problem is this... if you change the default date format for > > > the date printing functions used by rails, it seems to confuse the > > > database adapter. > > > Apparently the database adapter uses the same routine to format > > > date output for the database, and if you muck around with it, the > > > database can't interpret dates properly. > > > > > > The net result being that date's get written to the DB as > > > 0000-00-00 (with MySQL), but don't generate any error messages, > > > making it difficult to track down the bug. > > > > > > Have any of you who have been spelunking in the AR code (Jared?) > > > come across anything that might shed light on this? > > > > > > > You'd hate to see the code I wrote to handle dates in my first > > adapter. :) > > > > I'm in the middle of five things right now so I can't go too deep, > > but here's some stream of consciousness. Feel free to follow up with > > any extra questions. > > > > All the type conversion in the database adapters is adapter specific. > > While there are generic higher level routines, every adapter I looked > > at as an example changed that behavior slightly to match their > > databases convention. It sounds like you've wandered from the blessed > > path. :) > > > > Stu Halloway once said that half the cool stuff being done w/Ruby and > > Rails couldn't be done if it weren't all open source. If I were you > > I'd go peek in the active record gems folder on your box, and look at > > the mysql connection adapter. On my Mac this is in > > /usr/local/lib/ruby/gems/1.8/gems/activerecord- > 1.14.4/lib/ > > active_record/connection_adapters/ > > > > I'm looking through the code now and remembering that MySql cheats > > though... it requires some extra ruby classes to be available. But > > the main mysql_adapter.rb isn't doing anything fancy with the dates. > > > > So then we look in /usr/local/lib/ruby/gems/1.8/gems/ > > > activerecord-1.14.4/lib/active_record/connection_adapters/abstract > to > > find the basic operation. > > > > Look at schema_definitions.rb > > > > Search on date and you'll find def type_cast which casts values to > > and from the database formats. Be sure the values you are passing in > > and out conform to that code. In particular I'm seeing: > > > > when :datetime then self.class.string_to_time(value) > > > > and > > > > when :date then self.class.string_to_date(value) > > > > Then later... > > > > def self.string_to_date(string) > > return string unless string.is_a?(String) > > date_array = ParseDate.parsedate(string) > > # treat 0000-00-00 as nil > > Date.new(date_array[0], date_array[1], date_array[2]) rescue > > nil > > end > > > > def self.string_to_time(string) > > return string unless string.is_a?(String) > > time_array = ParseDate.parsedate (string)[0..5] > > # treat 0000-00-00 00:00:00 as nil > > Time.send(Base.default_timezone, *time_array) rescue nil > > end > > > > > > Those zeros look familiar. I'd bet your new format is not parse-able > > and being converted to nil. > > > > > > Jared > > http://jaredrichardson.net > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > -- > Kevin Olbrich > kevin.olbrich at gmail.com > > CONFIDENTIAL > Unless otherwise indicated or obvious from the nature of the following > communication, the information contained herein is a privileged and > confidential information/work product. The communication is intended for the > use of the individual or entity named above. It the reader of this > transmission is not the intended recipient, you are hereby notified that any > dissemination, distribution, or copying of this communication is strictly > prohibited. If you have received this communication in error or are not sure > whether it is privileged, please immediately notify us by return e-mail and > destroy any copies, electronic, paper, or otherwise, which you may have of > this communication. > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -- Kevin Olbrich kevin.olbrich at gmail.com CONFIDENTIAL Unless otherwise indicated or obvious from the nature of the following communication, the information contained herein is a privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. It the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies, electronic, paper, or otherwise, which you may have of this communication. From kevin.olbrich at gmail.com Fri Sep 8 14:32:53 2006 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Fri, 8 Sep 2006 14:32:53 -0400 Subject: [raleigh.rb] Adding your own Ruby library? In-Reply-To: References: <6520F3DF-AB8A-42D9-BA46-6DD55F14EFFD@nc.rr.com> <1A814981-74CA-42C8-8854-4AF5B8E9C378@nc.rr.com> <87F00859-B7FB-49F1-8AA2-486D19EA0325@thewilliams.ws> <972AD774-31B8-4041-A9F5-8D27B723E8FE@nc.rr.com> Message-ID: FYI, I will be talking about a Gem I put together at the next meetup. I intend to spend a bit of time talking about the basic packaging of gems. -Kevin On 9/8/06, Jared Richardson wrote: > I bugged Adam off list to avoid clogging up the list, but everything > is working now. > > Adam's example works great. I've blogged on the topic and cut his > example down a bit (removed the testing task) to make it simpler. > > Remember to require "rubygems" from irb ~before~ you try to use your > newly created and installed gem. :) > > Thanks for the help! > > Jared > http://jaredrichardson.net > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Kevin Olbrich kevin.olbrich at gmail.com CONFIDENTIAL Unless otherwise indicated or obvious from the nature of the following communication, the information contained herein is a privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. It the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies, electronic, paper, or otherwise, which you may have of this communication. From nathaniel at talbott.ws Sat Sep 9 08:55:34 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Sat, 9 Sep 2006 08:55:34 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: References: Message-ID: <908AF717-CD31-4B6B-A673-B660B8AC0B22@talbott.ws> On Sep 6, 2006, at 21:17 , Kevin Olbrich wrote: > I ran into a bit of a sticky problem with Rails a while back that I > would like to be able to track down and fix. > > The problem is this... if you change the default date format for > the date printing functions used by rails, it seems to confuse the > database adapter. > Apparently the database adapter uses the same routine to format > date output for the database, and if you muck around with it, the > database can't interpret dates properly. Hmmm.... which date printing functions in particular? And how are you changing the format? -- Nathaniel Talbott <:((>< From kevin.olbrich at gmail.com Sat Sep 9 09:34:01 2006 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Sat, 9 Sep 2006 09:34:01 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: <908AF717-CD31-4B6B-A673-B660B8AC0B22@talbott.ws> References: <908AF717-CD31-4B6B-A673-B660B8AC0B22@talbott.ws> Message-ID: On 9/9/06, Nathaniel Talbott wrote: > On Sep 6, 2006, at 21:17 , Kevin Olbrich wrote: > > > I ran into a bit of a sticky problem with Rails a while back that I > > would like to be able to track down and fix. > > > > The problem is this... if you change the default date format for > > the date printing functions used by rails, it seems to confuse the > > database adapter. > > Apparently the database adapter uses the same routine to format > > date output for the database, and if you muck around with it, the > > database can't interpret dates properly. > > Hmmm.... which date printing functions in particular? And how are you > changing the format? > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > If you add this line to your environment.rb... ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.update( :default => '%m-%d-%Y' ) Rails will happily format any printed date at m-d-Y. It also tries to send it to the DB that way, which confuses MySQL. -- Kevin Olbrich kevin.olbrich at gmail.com CONFIDENTIAL Unless otherwise indicated or obvious from the nature of the following communication, the information contained herein is a privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. It the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies, electronic, paper, or otherwise, which you may have of this communication. From nathaniel at talbott.ws Sat Sep 9 09:49:06 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Sat, 9 Sep 2006 09:49:06 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: References: <908AF717-CD31-4B6B-A673-B660B8AC0B22@talbott.ws> Message-ID: <4E1A44AA-B5BA-4A8A-ABBB-252564DC4D29@talbott.ws> On Sep 9, 2006, at 09:34 , Kevin Olbrich wrote: > If you add this line to your environment.rb... > > ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.update( > :default => '%m-%d-%Y' ) > > Rails will happily format any printed date at m-d-Y. It also tries to > send it to the DB that way, which confuses MySQL. Looking at the code, it appears that :default is the specifier that allows you to get at the original formatting code for Date, without the activesupport wrapping. If you override it, anywhere in the system that uses (and expects) Date#to_s with no arguments to behave per stock Ruby is probably going to act wonky (as you've found). Rather than override :default, the accepted way is to name and use your own format: ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS [:me] = '%m-%d-%Y' Date.new.to_s(:me) Will that work? -- Nathaniel Talbott <:((>< From PKristoff at acm.org Sat Sep 9 10:22:56 2006 From: PKristoff at acm.org (PKristoff at acm.org) Date: Sat, 9 Sep 2006 10:22:56 -0400 Subject: [raleigh.rb] Mysql problem In-Reply-To: <4E1A44AA-B5BA-4A8A-ABBB-252564DC4D29@talbott.ws> Message-ID: <01ba01c6d41b$72569440$1702a8c0@Ralph> Hey, I am having a problem getting my application working in production. It is working fine in development but when I move it to the production machine I get the following message in the production.log: Mysql::Error (Access denied for user 'kristoff'@'69.16.220.210' (using password: YES)): /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec tion_adapters/mysql_adapter.rb:330:in `real_connect' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec tion_adapters/mysql_adapter.rb:330:in `connect' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec tion_adapters/mysql_adapter.rb:87:in `initialize' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec tion_adapters/mysql_adapter.rb:36:in `mysql_connection' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec tion_adapters/abstract/connection_specification.rb:251:in `connection_without_quer\y_cache=' My database.yml looks like: production: adapter: mysql database: survivor host: survivor.paulkristoff.com username: kristoff password: I should mention that development was done on my laptop (windows) and production was done on OCS Solutions. Any help would be much appreciated. Paul Kristoff From geoff at geoffdavis.net Sat Sep 9 10:55:55 2006 From: geoff at geoffdavis.net (Geoff Davis) Date: Sat, 09 Sep 2006 10:55:55 -0400 Subject: [raleigh.rb] Access to host in observer Message-ID: <1157813755.4051.30.camel@test> I have an observer that fires off an email. The email contains a URL for a page on my site. The host for the URL is a function of whether I am testing, when it is localhost:3000, or whether have actually deployed the site. The observer inherits from ActiveRecord::Observer, which does not have access to the request object, so there is not an obvious way to get the host from the request. This seems like a fairly common issue -- is there a preferred solution? A few possibilities: * stick the host in an instance variable on the object in the controller (though this seems pretty easy to break) * stick the host in my environment.rb file somewhere (in which case I'm not sure how to access it) Any suggestions? Thanks Geoff From adam at thewilliams.ws Sat Sep 9 10:59:31 2006 From: adam at thewilliams.ws (Adam Williams) Date: Sat, 9 Sep 2006 10:59:31 -0400 Subject: [raleigh.rb] Mysql problem In-Reply-To: <01ba01c6d41b$72569440$1702a8c0@Ralph> References: <01ba01c6d41b$72569440$1702a8c0@Ralph> Message-ID: Paul, I think your problem lies in the mysql.user table... Be sure to understand this: http://mysql.com/doc/refman/5.0/en/connection- access.html I had similar problems. mysql> select user, host from mysql.user; +-------------+-------------------+ | user | host | +-------------+-------------------+ | thewilliams | % | | root | localhost | | root | thewilliams.local | +-------------+-------------------+ Being a table, you can use SQL to update this, but it is recommended that you use their GRANT stuff, as in: grant all privileges on database_name.* to 'user_name'@'host_name'; Hope that helps. adam williams (aiwilliams) On Sep 9, 2006, at 10:22 AM, wrote: > Hey, > > I am having a problem getting my application working in production. > It is working fine in development but when I move it to the production > machine I get the following message in the production.log: > > Mysql::Error (Access denied for user 'kristoff'@'69.16.220.210' (using > password: YES)): > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/ > connec > tion_adapters/mysql_adapter.rb:330:in `real_connect' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/ > connec > tion_adapters/mysql_adapter.rb:330:in `connect' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/ > connec > tion_adapters/mysql_adapter.rb:87:in `initialize' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/ > connec > tion_adapters/mysql_adapter.rb:36:in `mysql_connection' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/ > connec > tion_adapters/abstract/connection_specification.rb:251:in > `connection_without_quer\y_cache=' > > My database.yml looks like: > > production: > adapter: mysql > database: survivor > host: survivor.paulkristoff.com > username: kristoff > password: > > I should mention that development was done on my laptop (windows) and > production was done on OCS Solutions. Any help would be much > appreciated. > > Paul Kristoff > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From atomgiant at gmail.com Sat Sep 9 11:06:31 2006 From: atomgiant at gmail.com (Tom Davies) Date: Sat, 9 Sep 2006 11:06:31 -0400 Subject: [raleigh.rb] Mysql problem In-Reply-To: <01ba01c6d41b$72569440$1702a8c0@Ralph> References: <4E1A44AA-B5BA-4A8A-ABBB-252564DC4D29@talbott.ws> <01ba01c6d41b$72569440$1702a8c0@Ralph> Message-ID: Hi Paul, This probably just means that either your username, database name or password are not correct. For example, your host may prefix your database name with your username. Also, make sure you created your database first. If you have shell access, try testing your connection using this command: > mysql -D -u -p Also, it will always say password: YES for any password you enter. If you didn't enter a password it would say password: NO. Hope that helps, Tom On 9/9/06, PKristoff at acm.org wrote: > Hey, > > I am having a problem getting my application working in production. > It is working fine in development but when I move it to the production > machine I get the following message in the production.log: > > Mysql::Error (Access denied for user 'kristoff'@'69.16.220.210' (using > password: YES)): > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec > tion_adapters/mysql_adapter.rb:330:in `real_connect' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec > tion_adapters/mysql_adapter.rb:330:in `connect' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec > tion_adapters/mysql_adapter.rb:87:in `initialize' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec > tion_adapters/mysql_adapter.rb:36:in `mysql_connection' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec > tion_adapters/abstract/connection_specification.rb:251:in > `connection_without_quer\y_cache=' > > My database.yml looks like: > > production: > adapter: mysql > database: survivor > host: survivor.paulkristoff.com > username: kristoff > password: > > I should mention that development was done on my laptop (windows) and > production was done on OCS Solutions. Any help would be much > appreciated. > > Paul Kristoff > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Tom Davies http://atomgiant.com http://gifthat.com From atomgiant at gmail.com Sat Sep 9 11:08:37 2006 From: atomgiant at gmail.com (Tom Davies) Date: Sat, 9 Sep 2006 11:08:37 -0400 Subject: [raleigh.rb] Mysql problem In-Reply-To: References: <4E1A44AA-B5BA-4A8A-ABBB-252564DC4D29@talbott.ws> <01ba01c6d41b$72569440$1702a8c0@Ralph> Message-ID: It could also be your permissions like Adam said too :) On 9/9/06, Tom Davies wrote: > Hi Paul, > > This probably just means that either your username, database name or > password are not correct. For example, your host may prefix your > database name with your username. Also, make sure you created your > database first. > > If you have shell access, try testing your connection using this command: > > > mysql -D -u -p > > Also, it will always say password: YES for any password you enter. If > you didn't enter a password it would say password: NO. > > Hope that helps, > > Tom > > On 9/9/06, PKristoff at acm.org wrote: > > Hey, > > > > I am having a problem getting my application working in production. > > It is working fine in development but when I move it to the production > > machine I get the following message in the production.log: > > > > Mysql::Error (Access denied for user 'kristoff'@'69.16.220.210' (using > > password: YES)): > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec > > tion_adapters/mysql_adapter.rb:330:in `real_connect' > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec > > tion_adapters/mysql_adapter.rb:330:in `connect' > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec > > tion_adapters/mysql_adapter.rb:87:in `initialize' > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec > > tion_adapters/mysql_adapter.rb:36:in `mysql_connection' > > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connec > > tion_adapters/abstract/connection_specification.rb:251:in > > `connection_without_quer\y_cache=' > > > > My database.yml looks like: > > > > production: > > adapter: mysql > > database: survivor > > host: survivor.paulkristoff.com > > username: kristoff > > password: > > > > I should mention that development was done on my laptop (windows) and > > production was done on OCS Solutions. Any help would be much > > appreciated. > > > > Paul Kristoff > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > -- > Tom Davies > > http://atomgiant.com > http://gifthat.com > -- Tom Davies http://atomgiant.com http://gifthat.com From nathaniel at talbott.ws Sat Sep 9 11:44:53 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Sat, 9 Sep 2006 11:44:53 -0400 Subject: [raleigh.rb] Access to host in observer In-Reply-To: <1157813755.4051.30.camel@test> References: <1157813755.4051.30.camel@test> Message-ID: <47081EF9-07DE-4917-885B-93B21C4A28F8@talbott.ws> On Sep 9, 2006, at 10:55 , Geoff Davis wrote: > I have an observer that fires off an email. The email contains a URL > for a page on my site. > > The host for the URL is a function of whether I am testing, when it is > localhost:3000, or whether have actually deployed the site. > > The observer inherits from ActiveRecord::Observer, which does not have > access to the request object, so there is not an obvious way to get > the > host from the request. > > This seems like a fairly common issue -- is there a preferred > solution? > > A few possibilities: > * stick the host in an instance variable on the object in the > controller > (though this seems pretty easy to break) > * stick the host in my environment.rb file somewhere (in which case > I'm > not sure how to access it) > > Any suggestions? First of all, I found this revision while looking in to this: http://dev.rubyonrails.org/changeset/4818 So it looks like url creation in ActionMailer will be much easier in 1.2. For now, though, what I usually do is just send emails directly from the controller, and pass a url built using url_for directly in to the mailer method. Perhaps not as nice as using an Observer, but much easier to get working. HTH, -- Nathaniel Talbott <:((>< From geoff at geoffdavis.net Sat Sep 9 11:52:12 2006 From: geoff at geoffdavis.net (Geoff Davis) Date: Sat, 09 Sep 2006 11:52:12 -0400 Subject: [raleigh.rb] Access to host in observer In-Reply-To: <47081EF9-07DE-4917-885B-93B21C4A28F8@talbott.ws> References: <1157813755.4051.30.camel@test> <47081EF9-07DE-4917-885B-93B21C4A28F8@talbott.ws> Message-ID: <1157817132.4051.34.camel@test> On Sat, 2006-09-09 at 11:44 -0400, Nathaniel Talbott wrote: > First of all, I found this revision while looking in to this: > > http://dev.rubyonrails.org/changeset/4818 > > So it looks like url creation in ActionMailer will be much easier in > 1.2. Nice find! I'm using edge rails (I'm hacking on Mephisto, which requires it), so that's perfect. > For now, though, what I usually do is just send emails directly from > the controller, and pass a url built using url_for directly in to the > mailer method. Perhaps not as nice as using an Observer, but much > easier to get working. Hm. I was just going down the road of putting the host in a module- level variable in my mailer via environment.rb. I'm going to try the 1.2 approach. From PKristoff at acm.org Sat Sep 9 15:13:15 2006 From: PKristoff at acm.org (PKristoff at acm.org) Date: Sat, 9 Sep 2006 15:13:15 -0400 Subject: [raleigh.rb] Mysql problem In-Reply-To: Message-ID: <000a01c6d444$00d2afb0$1702a8c0@Ralph> Adam & Tom, Thank you for the information. What you said below was not the problem but it got me thinking in the right direction. It turns out I had put in my database.yml the following line: host: survivor.paulkristoff.com, which translated to the ip address: 69.16.220.210. Well my user id in mysql was kristoff at localhost, which did not match up, thus the error. So, I changed the line to host: localhost and it worked. Paul Kristoff -----Original Message----- From: Adam Williams [mailto:adam at thewilliams.ws] Sent: Saturday, September 09, 2006 11:00 AM To: paul at kristoffs.com; The mailing list of raleigh.rb Subject: Re: [raleigh.rb] Mysql problem Paul, I think your problem lies in the mysql.user table... Be sure to understand this: http://mysql.com/doc/refman/5.0/en/connection- access.html I had similar problems. mysql> select user, host from mysql.user; +-------------+-------------------+ | user | host | +-------------+-------------------+ | thewilliams | % | | root | localhost | | root | thewilliams.local | +-------------+-------------------+ Being a table, you can use SQL to update this, but it is recommended that you use their GRANT stuff, as in: grant all privileges on database_name.* to 'user_name'@'host_name'; Hope that helps. adam williams (aiwilliams) On Sep 9, 2006, at 10:22 AM, wrote: > Hey, > > I am having a problem getting my application working in production. > It is working fine in development but when I move it to the production > machine I get the following message in the production.log: > > Mysql::Error (Access denied for user 'kristoff'@'69.16.220.210' (using > password: YES)): > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/ > connec > tion_adapters/mysql_adapter.rb:330:in `real_connect' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/ > connec > tion_adapters/mysql_adapter.rb:330:in `connect' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/ > connec > tion_adapters/mysql_adapter.rb:87:in `initialize' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/ > connec > tion_adapters/mysql_adapter.rb:36:in `mysql_connection' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/ > connec > tion_adapters/abstract/connection_specification.rb:251:in > `connection_without_quer\y_cache=' > > My database.yml looks like: > > production: > adapter: mysql > database: survivor > host: survivor.paulkristoff.com > username: kristoff > password: > > I should mention that development was done on my laptop (windows) and > production was done on OCS Solutions. Any help would be much > appreciated. > > Paul Kristoff > > _______________________________________________ > raleigh-rb-members mailing list raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From kevin.olbrich at gmail.com Sat Sep 9 16:22:22 2006 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Sat, 9 Sep 2006 16:22:22 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: <4E1A44AA-B5BA-4A8A-ABBB-252564DC4D29@talbott.ws> References: <908AF717-CD31-4B6B-A673-B660B8AC0B22@talbott.ws> <4E1A44AA-B5BA-4A8A-ABBB-252564DC4D29@talbott.ws> Message-ID: Sure that works, but that requires me to go add code everywhere I print a date. Not very DRY in my book. The principle of least surprise suggests to me that changing the default date should alter the way the date appears in most places, but sensitve things, like the DB adapter, should enforce the date format it requires. _Kevin On 9/9/06, Nathaniel Talbott wrote: > On Sep 9, 2006, at 09:34 , Kevin Olbrich wrote: > > > If you add this line to your environment.rb... > > > > ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.update( > > :default => '%m-%d-%Y' ) > > > > Rails will happily format any printed date at m-d-Y. It also tries to > > send it to the DB that way, which confuses MySQL. > > Looking at the code, it appears that :default is the specifier that > allows you to get at the original formatting code for Date, without > the activesupport wrapping. If you override it, anywhere in the > system that uses (and expects) Date#to_s with no arguments to behave > per stock Ruby is probably going to act wonky (as you've found). > Rather than override :default, the accepted way is to name and use > your own format: > > ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS > [:me] = '%m-%d-%Y' > Date.new.to_s(:me) > > Will that work? > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Kevin Olbrich kevin.olbrich at gmail.com CONFIDENTIAL Unless otherwise indicated or obvious from the nature of the following communication, the information contained herein is a privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. It the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies, electronic, paper, or otherwise, which you may have of this communication. From nathaniel at talbott.ws Sat Sep 9 17:16:26 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Sat, 9 Sep 2006 17:16:26 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: References: <908AF717-CD31-4B6B-A673-B660B8AC0B22@talbott.ws> <4E1A44AA-B5BA-4A8A-ABBB-252564DC4D29@talbott.ws> Message-ID: <1F2129CD-6602-4C70-B304-FEC29092B179@talbott.ws> On Sep 9, 2006, at 16:22 , Kevin Olbrich wrote: > Sure that works, but that requires me to go add code everywhere I > print a date. Not very DRY in my book. > > The principle of least surprise suggests to me that changing the > default date should alter the way the date appears in most places, but > sensitve things, like the DB adapter, should enforce the date format > it requires. But what you're doing is overriding the system-wide Date#to_s method - open classes are cool and all, but changing system-wide behavior is often going to cause trouble. Rails tries to keep things a little DRY- er by allowing you to pass in a format symbol to to_s (instead of you having to add your own method), but it can only do so much. It seems pretty reasonable to me that database drivers and the like should be able to depend on Date#to_s's return value being consistent. The only thing I think is a little questionable here is that Rails allows you to define the :default pattern at all - I'd like the barrier to breaking Date#to_s to be set a little higher. HTH, -- Nathaniel Talbott <:((>< From kevin.olbrich at gmail.com Sat Sep 9 18:16:27 2006 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Sat, 9 Sep 2006 18:16:27 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: <1F2129CD-6602-4C70-B304-FEC29092B179@talbott.ws> References: <908AF717-CD31-4B6B-A673-B660B8AC0B22@talbott.ws> <4E1A44AA-B5BA-4A8A-ABBB-252564DC4D29@talbott.ws> <1F2129CD-6602-4C70-B304-FEC29092B179@talbott.ws> Message-ID: On 9/9/06, Nathaniel Talbott wrote: > On Sep 9, 2006, at 16:22 , Kevin Olbrich wrote: > > > Sure that works, but that requires me to go add code everywhere I > > print a date. Not very DRY in my book. > > > > The principle of least surprise suggests to me that changing the > > default date should alter the way the date appears in most places, but > > sensitve things, like the DB adapter, should enforce the date format > > it requires. > > But what you're doing is overriding the system-wide Date#to_s method > - open classes are cool and all, but changing system-wide behavior is > often going to cause trouble. Rails tries to keep things a little DRY- > er by allowing you to pass in a format symbol to to_s (instead of you > having to add your own method), but it can only do so much. It seems > pretty reasonable to me that database drivers and the like should be > able to depend on Date#to_s's return value being consistent. > > The only thing I think is a little questionable here is that Rails > allows you to define the :default pattern at all - I'd like the > barrier to breaking Date#to_s to be set a little higher. > > HTH, > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > I'd have to disagree with you about the database adapters. If the behavior of the class is tied in an important way to the format of the output of another class, it better darn well make sure that it is getting that format, or at least complain loudly when it doesn't. Part of the problem with this particular bug is that it fails silently. It took me the better part of a day to even figure out why it wasn't working in the first place. Maybe rails shouldn't let people change the default, but there is no reason why the database adapter can't explicitly format the date in a way that the DB will understand it. -- Kevin Olbrich kevin.olbrich at gmail.com CONFIDENTIAL Unless otherwise indicated or obvious from the nature of the following communication, the information contained herein is a privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. It the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies, electronic, paper, or otherwise, which you may have of this communication. From PKristoff at acm.org Sun Sep 10 18:52:42 2006 From: PKristoff at acm.org (PKristoff at acm.org) Date: Sun, 10 Sep 2006 18:52:42 -0400 Subject: [raleigh.rb] Active Record Question Message-ID: <008c01c6d52b$d4093100$1702a8c0@Ralph> Hey, I am having trouble getting my model to act the way i think it should in relation to active record. In other words what am I doing wrong. The problem I am having is that in my test when I refer to pick.player (where pick is an instance of PicksForEpisode) I get undefined method player. I was expecting it to be defined. Paul Kristoff I have the following class definitions: class Player < ActiveRecord::Base belongs_to :picks_for_episode end class PicksForEpisode < ActiveRecord::Base has_many :survivor_pick, :dependent => true end class SurvivorPick < ActiveRecord::Base attr_reader :survivor has_one :survivor belongs_to :picks_for_episode acts_as_list :scope => :survivor_id end I have the following test written: class PicksForEpisodeTest < Test::Unit::TestCase fixtures :players, :episodes, :survivors fixtures :picks_for_episodes, :survivor_picks def test_things_work pick = PicksForEpisode.find(1) assert_equal Player.find(1), pick.player end end yml of player paul: id: 1 first_name: Paul last_name: Kristoff email: paul at kristoffs.com vicki: id: 2 first_name: Vicki last_name: Kristoff email: vicki at kristoffs.com Yml of picks_for_episodes picks1: id: 1 player_id: 1 episode_id: 1 picks2: id: 2 player_id: 2 episode_id: 2 Db definition: drop table if exists players; create table players ( id int not null auto_increment, first_name varchar(25) not null, last_name varchar(25) not null, email varchar(50) not null, primary key (id) ); drop table if exists picks_for_episodes; create table picks_for_episodes ( id int not null auto_increment, player_id int not null, episode_id int not null, primary key (id) ); drop table if exists survivor_picks; create table survivor_picks ( id int not null auto_increment, picks_for_episode_id int not null, survivor_id int not null, primary key (id) ); From PKristoff at acm.org Sun Sep 10 22:01:36 2006 From: PKristoff at acm.org (PKristoff at acm.org) Date: Sun, 10 Sep 2006 22:01:36 -0400 Subject: [raleigh.rb] Active Record Question (never mind) In-Reply-To: <008c01c6d52b$d4093100$1702a8c0@Ralph> Message-ID: <00ae01c6d546$370a5990$1702a8c0@Ralph> I solved the problem. It was using has_many instead of belongs_to. Paul Kristoff -----Original Message----- From: raleigh-rb-members-bounces at rubyforge.org [mailto:raleigh-rb-members-bounces at rubyforge.org] On Behalf Of PKristoff at acm.org Sent: Sunday, September 10, 2006 6:53 PM To: 'The mailing list of raleigh.rb' Subject: [raleigh.rb] Active Record Question Hey, I am having trouble getting my model to act the way i think it should in relation to active record. In other words what am I doing wrong. The problem I am having is that in my test when I refer to pick.player (where pick is an instance of PicksForEpisode) I get undefined method player. I was expecting it to be defined. Paul Kristoff I have the following class definitions: class Player < ActiveRecord::Base belongs_to :picks_for_episode end class PicksForEpisode < ActiveRecord::Base has_many :survivor_pick, :dependent => true end class SurvivorPick < ActiveRecord::Base attr_reader :survivor has_one :survivor belongs_to :picks_for_episode acts_as_list :scope => :survivor_id end I have the following test written: class PicksForEpisodeTest < Test::Unit::TestCase fixtures :players, :episodes, :survivors fixtures :picks_for_episodes, :survivor_picks def test_things_work pick = PicksForEpisode.find(1) assert_equal Player.find(1), pick.player end end yml of player paul: id: 1 first_name: Paul last_name: Kristoff email: paul at kristoffs.com vicki: id: 2 first_name: Vicki last_name: Kristoff email: vicki at kristoffs.com Yml of picks_for_episodes picks1: id: 1 player_id: 1 episode_id: 1 picks2: id: 2 player_id: 2 episode_id: 2 Db definition: drop table if exists players; create table players ( id int not null auto_increment, first_name varchar(25) not null, last_name varchar(25) not null, email varchar(50) not null, primary key (id) ); drop table if exists picks_for_episodes; create table picks_for_episodes ( id int not null auto_increment, player_id int not null, episode_id int not null, primary key (id) ); drop table if exists survivor_picks; create table survivor_picks ( id int not null auto_increment, picks_for_episode_id int not null, survivor_id int not null, primary key (id) ); _______________________________________________ raleigh-rb-members mailing list raleigh-rb-members at rubyforge.org http://rubyforge.org/mailman/listinfo/raleigh-rb-members From rick.denatale at gmail.com Mon Sep 11 10:47:41 2006 From: rick.denatale at gmail.com (Rick DeNatale) Date: Mon, 11 Sep 2006 10:47:41 -0400 Subject: [raleigh.rb] Active Record Question In-Reply-To: <008c01c6d52b$d4093100$1702a8c0@Ralph> References: <008c01c6d52b$d4093100$1702a8c0@Ralph> Message-ID: On 9/10/06, PKristoff at acm.org wrote: > Hey, > > I am having trouble getting my model to act the way i think it should > in relation to active record. In other words what am I doing wrong. > The problem I am having is that in my test when I refer to pick.player > (where pick is an instance of PicksForEpisode) I get undefined method > player. I was expecting it to be defined. > > Paul Kristoff > > I have the following class definitions: > > class Player < ActiveRecord::Base > belongs_to :picks_for_episode > end > > class PicksForEpisode < ActiveRecord::Base > has_many :survivor_pick, :dependent => true > end > > class SurvivorPick < ActiveRecord::Base > attr_reader :survivor > has_one :survivor The argument to has_one should be a symbol which is the downcased, name of an ActiveRecord class. You don't have an ActiveRecord called Survivor. It's going to add the methods survivor() and survivor=(), but not player() nor player()=. I think that you either need to change the has_one to either: has_one :player which will give you the player methods, or has_one: :survivor, :class_name => "Player" which will give you the survivor methods which will return instances of Player. In this case you need to change your test case code, or also provide a player method which returns survivor. > belongs_to :picks_for_episode > acts_as_list :scope => :survivor_id > end > > I have the following test written: > > class PicksForEpisodeTest < Test::Unit::TestCase > fixtures :players, :episodes, :survivors > fixtures :picks_for_episodes, :survivor_picks > > def test_things_work > pick = PicksForEpisode.find(1) > assert_equal Player.find(1), pick.player > end > end > > yml of player > paul: > id: 1 > first_name: Paul > last_name: Kristoff > email: paul at kristoffs.com > vicki: > id: 2 > first_name: Vicki > last_name: Kristoff > email: vicki at kristoffs.com > > Yml of picks_for_episodes > > picks1: > id: 1 > player_id: 1 > episode_id: 1 > picks2: > id: 2 > player_id: 2 > episode_id: 2 > > Db definition: > > drop table if exists players; > create table players ( > id int not null auto_increment, > first_name varchar(25) not null, > last_name varchar(25) not null, > email varchar(50) not null, > primary key (id) > ); > drop table if exists picks_for_episodes; > create table picks_for_episodes ( > id int not null auto_increment, > player_id int not null, > episode_id int not null, > primary key (id) > ); > > drop table if exists survivor_picks; > create table survivor_picks ( > id int not null auto_increment, > picks_for_episode_id int not null, > survivor_id int not null, > primary key (id) > ); > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From lists-jared at nc.rr.com Tue Sep 12 11:04:28 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Tue, 12 Sep 2006 11:04:28 -0400 Subject: [raleigh.rb] Captcha in Rails? In-Reply-To: References: <008c01c6d52b$d4093100$1702a8c0@Ralph> Message-ID: <8686543D-8EBE-44E9-BBF0-E67D4767D153@nc.rr.com> Hi all, Has anyone added a Captcha system to their Rails app? I've never tinkered with one before now but find myself needing add one. I'd prefer something that would let me generate the images before hand. I'd prefer to avoid the overhead of generating images on the fly. The site I'm working on plans on being Big. :) So far Google has given me these hits and I'm starting to read a bit. http://npenkov.com/articles/tag/captcha http://ridingrails.blogspot.com/2006/06/captcha-login-engine.html http://captcha.rubyforge.org/ Thanks all, Jared http://jaredrichardson.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060912/246aaf7e/attachment-0001.html From kevin.olbrich at gmail.com Tue Sep 12 11:15:03 2006 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Tue, 12 Sep 2006 11:15:03 -0400 Subject: [raleigh.rb] Captcha in Rails? In-Reply-To: <8686543D-8EBE-44E9-BBF0-E67D4767D153@nc.rr.com> References: <008c01c6d52b$d4093100$1702a8c0@Ralph> <8686543D-8EBE-44E9-BBF0-E67D4767D153@nc.rr.com> Message-ID: I haven't used this one, but it's probably worth looking at.. http://dev.2750flesk.com/validates_captcha/ _Kevin On 9/12/06, Jared Richardson wrote: > > Hi all, > > Has anyone added a Captcha system to their Rails app? I've never tinkered > with one before now but find myself needing add one. > > I'd prefer something that would let me generate the images before hand. I'd > prefer to avoid the overhead of generating images on the fly. The site I'm > working on plans on being Big. :) > > So far Google has given me these hits and I'm starting to read a bit. > > http://npenkov.com/articles/tag/captcha > http://ridingrails.blogspot.com/2006/06/captcha-login-engine.html > http://captcha.rubyforge.org/ > > Thanks all, > > Jared > http://jaredrichardson.net > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -- Kevin Olbrich kevin.olbrich at gmail.com CONFIDENTIAL Unless otherwise indicated or obvious from the nature of the following communication, the information contained herein is a privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. It the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies, electronic, paper, or otherwise, which you may have of this communication. From charlesmbowman at gmail.com Tue Sep 12 11:29:27 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Tue, 12 Sep 2006 11:29:27 -0400 Subject: [raleigh.rb] Captcha in Rails? In-Reply-To: References: <008c01c6d52b$d4093100$1702a8c0@Ralph> <8686543D-8EBE-44E9-BBF0-E67D4767D153@nc.rr.com> Message-ID: <298c4d2a0609120829o78bc9c13xb7af7e89b111480b@mail.gmail.com> Using a question/answer system is more friendly for screen readers. I haven't used them but they do help with accessibility On 9/12/06, Kevin Olbrich wrote: > > I haven't used this one, but it's probably worth looking at.. > > http://dev.2750flesk.com/validates_captcha/ > > _Kevin > > On 9/12/06, Jared Richardson wrote: > > > > Hi all, > > > > Has anyone added a Captcha system to their Rails app? I've never > tinkered > > with one before now but find myself needing add one. > > > > I'd prefer something that would let me generate the images before hand. > I'd > > prefer to avoid the overhead of generating images on the fly. The site > I'm > > working on plans on being Big. :) > > > > So far Google has given me these hits and I'm starting to read a bit. > > > > http://npenkov.com/articles/tag/captcha > > http://ridingrails.blogspot.com/2006/06/captcha-login-engine.html > > http://captcha.rubyforge.org/ > > > > Thanks all, > > > > Jared > > http://jaredrichardson.net > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > -- > Kevin Olbrich > kevin.olbrich at gmail.com > > CONFIDENTIAL > Unless otherwise indicated or obvious from the nature of the following > communication, the information contained herein is a privileged and > confidential information/work product. The communication is intended > for the use of the individual or entity named above. It the reader of > this transmission is not the intended recipient, you are hereby > notified that any dissemination, distribution, or copying of this > communication is strictly prohibited. If you have received this > communication in error or are not sure whether it is privileged, > please immediately notify us by return e-mail and destroy any copies, > electronic, paper, or otherwise, which you may have of this > communication. > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060912/234dd46f/attachment.html From blake at near-time.com Tue Sep 12 11:29:58 2006 From: blake at near-time.com (Blake Watters) Date: Tue, 12 Sep 2006 11:29:58 -0400 Subject: [raleigh.rb] Captcha in Rails? In-Reply-To: <8686543D-8EBE-44E9-BBF0-E67D4767D153@nc.rr.com> References: <008c01c6d52b$d4093100$1702a8c0@Ralph> <8686543D-8EBE-44E9-BBF0-E67D4767D153@nc.rr.com> Message-ID: I've been using validates_captcha to provide anonymous commenting for a few months at Near-Time (http://www.near-time.net/). We do development on OS X and production is in Linux, but the plugin uses RMagick for the drawing operations and so should be reasonably portable... It does generate images on the fly, but could be modified fairly easily... http://svn.2750flesk.com/validates_captcha/trunk/README Cheers, Blake On Sep 12, 2006, at 11:04 AM, Jared Richardson wrote: > Hi all, > > Has anyone added a Captcha system to their Rails app? I've never > tinkered with one before now but find myself needing add one. > > I'd prefer something that would let me generate the images before > hand. I'd prefer to avoid the overhead of generating images on the > fly. The site I'm working on plans on being Big. :) > > So far Google has given me these hits and I'm starting to read a bit. > > http://npenkov.com/articles/tag/captcha > http://ridingrails.blogspot.com/2006/06/captcha-login-engine.html > http://captcha.rubyforge.org/ > > Thanks all, > > Jared > http://jaredrichardson.net > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060912/91523c08/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060912/91523c08/attachment.bin From geoff at geoffdavis.net Wed Sep 13 09:35:28 2006 From: geoff at geoffdavis.net (Geoff Davis) Date: Wed, 13 Sep 2006 09:35:28 -0400 Subject: [raleigh.rb] Module variable question Message-ID: <1158154528.4044.23.camel@test> I am running into some weird issues with module variables. Here's the story: class X @@m = 3 def self.print_m puts @@m end end This works as expected: X.print_m 3 Now I split Y into an initial declaration and a monkey patch like so: class Y @@m = 3 end Y.class_eval do def self.print_m puts @@m end end This dies horribly: Y.print_m NameError: uninitialized class variable @@m in Object in `print_m' Any idea why the class method in the patch can't see @@m? Thanks! Geoff From ryan.daigle at gmail.com Wed Sep 13 09:48:18 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Wed, 13 Sep 2006 09:48:18 -0400 Subject: [raleigh.rb] Module variable question In-Reply-To: <1158154528.4044.23.camel@test> References: <1158154528.4044.23.camel@test> Message-ID: <45080C22.1060000@gmail.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060913/2c505063/attachment.html From charlesmbowman at gmail.com Wed Sep 13 10:01:39 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Wed, 13 Sep 2006 10:01:39 -0400 Subject: [raleigh.rb] Module variable question In-Reply-To: <45080C22.1060000@gmail.com> References: <1158154528.4044.23.camel@test> <45080C22.1060000@gmail.com> Message-ID: <298c4d2a0609130701v596b93e7o53c791fe4d5db857@mail.gmail.com> I've got a few questions about this code. If you're using class_eval to add a method to the Y class, why doesn't it have access to @@m without having to call class_variable_get. Also why would you use class_eval why you could have opened up the Y class and added the method as such: class Y @@m = 3 end class Y def self.print_m puts @@m end end Y.print_m I'm still new to this style of programming and I'm trying to determine why one way should be used over the other. On 9/13/06, Ryan Daigle wrote: > > Try: > > class Y > @@m = 3 > end > > Y.class_eval do > def self.print_m > puts *class_variable_get(:@@m)* > end > end > > -Ryan > > Geoff Davis wrote: > > I am running into some weird issues with module variables. Here's the > story: > > class X > @@m = 3 > def self.print_m > puts @@m > end > end > > This works as expected: > > X.print_m > 3 > > Now I split Y into an initial declaration and a monkey patch like so: > > class Y > @@m = 3 > end > > Y.class_eval do > def self.print_m > puts @@m > end > end > > This dies horribly: > > Y.print_m > NameError: uninitialized class variable @@m in Object > in `print_m' > > Any idea why the class method in the patch can't see @@m? > > Thanks! > > Geoff > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.orghttp://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060913/7cec0671/attachment-0001.html From geoff at geoffdavis.net Wed Sep 13 10:02:02 2006 From: geoff at geoffdavis.net (Geoff Davis) Date: Wed, 13 Sep 2006 10:02:02 -0400 Subject: [raleigh.rb] Module variable question In-Reply-To: <45080C22.1060000@gmail.com> References: <1158154528.4044.23.camel@test> <45080C22.1060000@gmail.com> Message-ID: <1158156122.4044.25.camel@test> Thanks - that works great. Can you provide any insight as to why I need to do that? On Wed, 2006-09-13 at 09:48 -0400, Ryan Daigle wrote: > Try: > > class Y > @@m = 3 > end > > Y.class_eval do > def self.print_m > puts class_variable_get(:@@m) > end > end > > -Ryan > > Geoff Davis wrote: > > I am running into some weird issues with module variables. Here's the > > story: > > > > class X > > @@m = 3 > > def self.print_m > > puts @@m > > end > > end > > > > This works as expected: > > > > X.print_m > > 3 > > > > Now I split Y into an initial declaration and a monkey patch like so: > > > > class Y > > @@m = 3 > > end > > > > Y.class_eval do > > def self.print_m > > puts @@m > > end > > end > > > > This dies horribly: > > > > Y.print_m > > NameError: uninitialized class variable @@m in Object > > in `print_m' > > > > Any idea why the class method in the patch can't see @@m? > > > > Thanks! > > > > Geoff > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From geoff at geoffdavis.net Wed Sep 13 10:10:41 2006 From: geoff at geoffdavis.net (Geoff Davis) Date: Wed, 13 Sep 2006 10:10:41 -0400 Subject: [raleigh.rb] Module variable question In-Reply-To: <298c4d2a0609130701v596b93e7o53c791fe4d5db857@mail.gmail.com> References: <1158154528.4044.23.camel@test> <45080C22.1060000@gmail.com> <298c4d2a0609130701v596b93e7o53c791fe4d5db857@mail.gmail.com> Message-ID: <1158156641.4044.29.camel@test> In my case I am using class_eval rather than reopening the class because I want to be able to replace existing methods in my patch. If you reopen the class you can add new method but you can't replace existing ones. On Wed, 2006-09-13 at 10:01 -0400, Charlie Bowman wrote: > I've got a few questions about this code. If you're using class_eval > to add a method to the Y class, why doesn't it have access to @@m > without having to call class_variable_get. Also why would you use > class_eval why you could have opened up the Y class and added the > method as such: > > class Y > @@m = 3 > end > > class Y > def self.print_m > puts @@m > end > end > > Y.print_m > > I'm still new to this style of programming and I'm trying to determine > why one way should be used over the other. > > > On 9/13/06, Ryan Daigle wrote: > Try: > > class Y > @@m = 3 > end > > Y.class_eval do > def self.print_m > puts class_variable_get(:@@m) > end > end > > -Ryan > > Geoff Davis wrote: > > I am running into some weird issues with module variables. Here's the > > story: > > > > class X > > @@m = 3 > > def self.print_m > > puts @@m > > end > > end > > > > This works as expected: > > > > X.print_m > > > > 3 > > > > Now I split Y into an initial declaration and a monkey patch like so: > > > > class Y > > @@m = 3 > > end > > > > Y.class_eval do > > def self.print_m > > puts @@m > > end > > end > > > > This dies horribly: > > > > > > Y.print_m > > NameError: uninitialized class variable @@m in Object > > in `print_m' > > > > Any idea why the class method in the patch can't see @@m? > > > > Thanks! > > > > Geoff > > > > _______________________________________________ > > > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From charlesmbowman at gmail.com Wed Sep 13 10:12:56 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Wed, 13 Sep 2006 10:12:56 -0400 Subject: [raleigh.rb] Module variable question In-Reply-To: <1158156641.4044.29.camel@test> References: <1158154528.4044.23.camel@test> <45080C22.1060000@gmail.com> <298c4d2a0609130701v596b93e7o53c791fe4d5db857@mail.gmail.com> <1158156641.4044.29.camel@test> Message-ID: <298c4d2a0609130712m2e6d74ffp569b61bb77b6f976@mail.gmail.com> ...but the code below works class Y @@m = 3 end class Y def self.print_m puts @@m end end class Y def self.print_m puts 'modified' end end Y.print_m On 9/13/06, Geoff Davis wrote: > > In my case I am using class_eval rather than reopening the class because > I want to be able to replace existing methods in my patch. If you > reopen the class you can add new method but you can't replace existing > ones. > > On Wed, 2006-09-13 at 10:01 -0400, Charlie Bowman wrote: > > I've got a few questions about this code. If you're using class_eval > > to add a method to the Y class, why doesn't it have access to @@m > > without having to call class_variable_get. Also why would you use > > class_eval why you could have opened up the Y class and added the > > method as such: > > > > class Y > > @@m = 3 > > end > > > > class Y > > def self.print_m > > puts @@m > > end > > end > > > > Y.print_m > > > > I'm still new to this style of programming and I'm trying to determine > > why one way should be used over the other. > > > > > > On 9/13/06, Ryan Daigle wrote: > > Try: > > > > class Y > > @@m = 3 > > end > > > > Y.class_eval do > > def self.print_m > > puts class_variable_get(:@@m) > > end > > end > > > > -Ryan > > > > Geoff Davis wrote: > > > I am running into some weird issues with module > variables. Here's the > > > story: > > > > > > class X > > > @@m = 3 > > > def self.print_m > > > puts @@m > > > end > > > end > > > > > > This works as expected: > > > > > > X.print_m > > > > > > 3 > > > > > > Now I split Y into an initial declaration and a monkey patch > like so: > > > > > > class Y > > > @@m = 3 > > > end > > > > > > Y.class_eval do > > > def self.print_m > > > puts @@m > > > end > > > end > > > > > > This dies horribly: > > > > > > > > > Y.print_m > > > NameError: uninitialized class variable @@m in Object > > > in `print_m' > > > > > > Any idea why the class method in the patch can't see @@m? > > > > > > Thanks! > > > > > > Geoff > > > > > > _______________________________________________ > > > > > > raleigh-rb-members mailing list > > > raleigh-rb-members at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060913/8f152d4b/attachment.html From geoff at geoffdavis.net Wed Sep 13 10:18:59 2006 From: geoff at geoffdavis.net (Geoff Davis) Date: Wed, 13 Sep 2006 10:18:59 -0400 Subject: [raleigh.rb] Module variable question In-Reply-To: <298c4d2a0609130712m2e6d74ffp569b61bb77b6f976@mail.gmail.com> References: <1158154528.4044.23.camel@test> <45080C22.1060000@gmail.com> <298c4d2a0609130701v596b93e7o53c791fe4d5db857@mail.gmail.com> <1158156641.4044.29.camel@test> <298c4d2a0609130712m2e6d74ffp569b61bb77b6f976@mail.gmail.com> Message-ID: <1158157140.4044.36.camel@test> Hmmm.... I stand corrected. On Wed, 2006-09-13 at 10:12 -0400, Charlie Bowman wrote: > ...but the code below works > > class Y > @@m = 3 > end > > class Y > def self.print_m > puts @@m > end > end > > class Y > def self.print_m > puts 'modified' > end > end > > Y.print_m > > > On 9/13/06, Geoff Davis wrote: > In my case I am using class_eval rather than reopening the > class because > I want to be able to replace existing methods in my patch. If > you > reopen the class you can add new method but you can't replace > existing > ones. > > On Wed, 2006-09-13 at 10:01 -0400, Charlie Bowman wrote: > > I've got a few questions about this code. If you're using > class_eval > > to add a method to the Y class, why doesn't it have access > to @@m > > without having to call class_variable_get. Also why would > you use > > class_eval why you could have opened up the Y class and > added the > > method as such: > > > > class Y > > @@m = 3 > > end > > > > class Y > > def self.print_m > > puts @@m > > end > > end > > > > Y.print_m > > > > I'm still new to this style of programming and I'm trying to > determine > > why one way should be used over the other. > > > > > > On 9/13/06, Ryan Daigle < ryan.daigle at gmail.com> wrote: > > Try: > > > > class Y > > @@m = 3 > > end > > > > Y.class_eval do > > def self.print_m > > puts class_variable_get(:@@m) > > end > > end > > > > -Ryan > > > > Geoff Davis wrote: > > > I am running into some weird issues with module > variables. Here's the > > > story: > > > > > > class X > > > @@m = 3 > > > def self.print_m > > > puts @@m > > > end > > > end > > > > > > This works as expected: > > > > > > X.print_m > > > > > > 3 > > > > > > Now I split Y into an initial declaration and a > monkey patch like so: > > > > > > class Y > > > @@m = 3 > > > end > > > > > > Y.class_eval do > > > def self.print_m > > > puts @@m > > > end > > > end > > > > > > This dies horribly: > > > > > > > > > Y.print_m > > > NameError: uninitialized class variable @@m in > Object > > > in `print_m' > > > > > > Any idea why the class method in the patch can't > see @@m? > > > > > > Thanks! > > > > > > Geoff > > > > > > _______________________________________________ > > > > > > raleigh-rb-members mailing list > > > raleigh-rb-members at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/raleigh-rb- > members > > > > > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb- > members > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From ryan.daigle at gmail.com Wed Sep 13 10:31:04 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Wed, 13 Sep 2006 10:31:04 -0400 Subject: [raleigh.rb] Module variable question In-Reply-To: <298c4d2a0609130701v596b93e7o53c791fe4d5db857@mail.gmail.com> References: <1158154528.4044.23.camel@test> <45080C22.1060000@gmail.com> <298c4d2a0609130701v596b93e7o53c791fe4d5db857@mail.gmail.com> Message-ID: <45081628.3030302@gmail.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060913/97aa5d1c/attachment-0001.html From charlesmbowman at gmail.com Wed Sep 13 10:48:40 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Wed, 13 Sep 2006 10:48:40 -0400 Subject: [raleigh.rb] Module variable question In-Reply-To: <45081628.3030302@gmail.com> References: <1158154528.4044.23.camel@test> <45080C22.1060000@gmail.com> <298c4d2a0609130701v596b93e7o53c791fe4d5db857@mail.gmail.com> <45081628.3030302@gmail.com> Message-ID: <298c4d2a0609130748k529a587ar4066289afe460852@mail.gmail.com> that makes sense. Luckily I've never had to open class when I didn't know it's name. Just the fact that you can even open a class and add methods when you don't even know what class you're opening amazes me! On 9/13/06, Ryan Daigle wrote: > > Charlie, here's my take on it - and I'm sure others can correct/clarify > further... > > Charlie Bowman wrote: > > I've got a few questions about this code. If you're using class_eval to > add a method to the Y class, why doesn't it have access to @@m without > having to call class_variable_get. > > The @@m class variable in this case is scoped in the class where > class_eval is defined (which is the Module module and the Object class - > hence the "NameError: uninitialized class variable @@m in *Object*" > error). So... the only way to get at class variable is with the > class_variable_get method which knows to operate on the scope of the class > which is being class_eval'd. > > Also why would you use class_eval why you could have opened up the Y class > and added the method as such: > > class Y > @@m = 3 > end > > class Y > def self.print_m > puts @@m > end > end > > Y.print_m > > I'm still new to this style of programming and I'm trying to determine why > one way should be used over the other. > > Because class_eval is prettier and makes Ruby developers feel superior to > their non meta-programming peers :) And because you may not always know > that class "Y" is the one you want to open up. It's more flexible to > operate in the meta-level so when the time comes to apply this operation on > dynamically received classes, you can do so with no modifications. You see > this a lot in ActiveRecord where ActiveRecord::Base doesn't know that it's > being included into the "Blog" object and it has to do something like " > klass.class_eval do ... end". > > That's my take, at least. > > -Ryan > > > > On 9/13/06, Ryan Daigle wrote: > > > > Try: > > > > class Y > > @@m = 3 > > end > > > > Y.class_eval do > > def self.print_m > > puts *class_variable_get(:@@m)* > > end > > end > > > > -Ryan > > > > Geoff Davis wrote: > > > > I am running into some weird issues with module variables. Here's the > > story: > > > > class X > > @@m = 3 > > def self.print_m > > puts @@m > > end > > end > > > > This works as expected: > > > > X.print_m > > > > 3 > > > > Now I split Y into an initial declaration and a monkey patch like so: > > > > class Y > > @@m = 3 > > end > > > > Y.class_eval do > > def self.print_m > > puts @@m > > end > > end > > > > This dies horribly: > > > > > > Y.print_m > > NameError: uninitialized class variable @@m in Object > > in `print_m' > > > > Any idea why the class method in the patch can't see @@m? > > > > Thanks! > > > > Geoff > > > > _______________________________________________ > > > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.orghttp://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > ------------------------------ > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.orghttp://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060913/915dbee6/attachment.html From ryan.daigle at gmail.com Wed Sep 13 10:52:16 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Wed, 13 Sep 2006 10:52:16 -0400 Subject: [raleigh.rb] Module variable question In-Reply-To: <298c4d2a0609130748k529a587ar4066289afe460852@mail.gmail.com> References: <1158154528.4044.23.camel@test> <45080C22.1060000@gmail.com> <298c4d2a0609130701v596b93e7o53c791fe4d5db857@mail.gmail.com> <45081628.3030302@gmail.com> <298c4d2a0609130748k529a587ar4066289afe460852@mail.gmail.com> Message-ID: <45081B20.4070307@gmail.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060913/dfb26b4e/attachment.html From adam at thewilliams.ws Wed Sep 13 11:11:15 2006 From: adam at thewilliams.ws (Adam Williams) Date: Wed, 13 Sep 2006 11:11:15 -0400 Subject: [raleigh.rb] Module variable question In-Reply-To: <1158157140.4044.36.camel@test> References: <1158154528.4044.23.camel@test> <45080C22.1060000@gmail.com> <298c4d2a0609130701v596b93e7o53c791fe4d5db857@mail.gmail.com> <1158156641.4044.29.camel@test> <298c4d2a0609130712m2e6d74ffp569b61bb77b6f976@mail.gmail.com> <1158157140.4044.36.camel@test> Message-ID: <522F470C-F56E-4D18-8E4A-7A13BE8132A2@thewilliams.ws> On Sep 13, 2006, at 10:18 AM, Geoff Davis wrote: > Hmmm.... I stand corrected. > > On Wed, 2006-09-13 at 10:12 -0400, Charlie Bowman wrote: >> ...but the code below works >> >> class Y >> @@m = 3 >> end >> >> class Y >> def self.print_m >> puts @@m >> end >> end >> >> class Y >> def self.print_m >> puts 'modified' >> end >> end >> >> Y.print_m Yes, but if you turn on warnings (ruby -w), as I've heard told you should, you find that this code does cause 'warning: redefine print_m', which may have contributed to your thinking, Geoff. I was getting this doing some 'meta programming' in a Rails app a bit ago, and it did make me feel icky. That is when someone, here on this list I think, pointed me to alias. class Y @@m = 3 end class Y def self.print_m puts @@m end end class Y class << self alias original_print_m print_m def print_m puts 'modified' end end end Y.print_m As an example of what Ryan stated w/r/t using class_eval when not knowing which class your extension would be applied to, I wrote this little diddy yesterday to make AR instances barf if you try to change certain attributes or associations. This extends AR::Base, so that you can do something like 'belongs_to :something; assoc_alarm :something'. Feel free to skip it if you aren't interested - it is kinda involved - but it helped me to understand what Ryan was talking about. # Causes a RuntimeError to be raised if the attribute is written on an existing record def attr_alarm(attribute_name) unless self.method_defined?(:alarms) class_eval do class_inheritable_array :alarms # This hooks into AR's handling of attribute writers, maintaining the # feature where a user is allowed to define a custom writer, but still # have the alarm alias_method :unalarming_write_attribute, :write_attribute def write_attribute(attr_name, value) if !new_record? and self.class.alarms.include? (attr_name.to_s) raise "Cannot change attribute #{attr_name} on a(n) # {self.class.name}" end unalarming_write_attribute(attr_name, value) end end end # Warning! This is addition in the world of class_inheritables self.alarms = [attribute_name.to_s] end # Causes a RuntimeError to be raised if the association is written on an existing record def assoc_alarm(association_name) attr_alarm "#{association_name}_id".to_sym assoc_writer = "#{association_name}=".to_sym original_assoc_writer = "original_#{association_name}=".to_sym self.send(:alias_method, original_assoc_writer, assoc_writer) define_method(assoc_writer) do |*params| raise "Cannot change association #{association_name} on a (n) #{self.class.name}" unless new_record? self.send(original_assoc_writer, params.blank? ? nil : params.first) end end In Meta-Heaven, aiwilliams From ryan.daigle at gmail.com Wed Sep 13 13:58:12 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Wed, 13 Sep 2006 13:58:12 -0400 Subject: [raleigh.rb] Module variable question In-Reply-To: <522F470C-F56E-4D18-8E4A-7A13BE8132A2@thewilliams.ws> References: <1158154528.4044.23.camel@test> <45080C22.1060000@gmail.com> <298c4d2a0609130701v596b93e7o53c791fe4d5db857@mail.gmail.com> <1158156641.4044.29.camel@test> <298c4d2a0609130712m2e6d74ffp569b61bb77b6f976@mail.gmail.com> <1158157140.4044.36.camel@test> <522F470C-F56E-4D18-8E4A-7A13BE8132A2@thewilliams.ws> Message-ID: <450846B4.9020705@gmail.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060913/79da2fc1/attachment-0001.html From lists-jared at nc.rr.com Wed Sep 13 13:30:12 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Wed, 13 Sep 2006 13:30:12 -0400 Subject: [raleigh.rb] Captcha in Rails? In-Reply-To: <8686543D-8EBE-44E9-BBF0-E67D4767D153@nc.rr.com> References: <008c01c6d52b$d4093100$1702a8c0@Ralph> <8686543D-8EBE-44E9-BBF0-E67D4767D153@nc.rr.com> Message-ID: Just an update... I went with this tutorial and it worked great. http:// ridingrails.blogspot.com/2006/06/captcha-login-engine.html I spent a ~lot~ of time getting RMagick installed properly. :( But the Ruby stuff worked great. When we put the code on the server (a G5), the text didn't display properly. I went into some of the captcha code, captcha_challenge.rb, around line 124 and changed this line :rotate => true to this line :rotate => false and the text renders fine now. Of course, I'm not bothering to include the umpteen dozen other things I tried that didn't work. ;) It worked "out of the box" on a Windows box and on my Mac laptop... go figure!~ Jared http://jaredrichardson.net On Sep 12, 2006, at 11:04 AM, Jared Richardson wrote: > Hi all, > > Has anyone added a Captcha system to their Rails app? I've never > tinkered with one before now but find myself needing add one. > > I'd prefer something that would let me generate the images before > hand. I'd prefer to avoid the overhead of generating images on the > fly. The site I'm working on plans on being Big. :) > > So far Google has given me these hits and I'm starting to read a bit. > > http://npenkov.com/articles/tag/captcha > http://ridingrails.blogspot.com/2006/06/captcha-login-engine.html > http://captcha.rubyforge.org/ > > Thanks all, > > Jared > http://jaredrichardson.net > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060913/955e92d2/attachment.html From blake at near-time.com Thu Sep 14 01:32:45 2006 From: blake at near-time.com (Blake Watters) Date: Thu, 14 Sep 2006 01:32:45 -0400 Subject: [raleigh.rb] Any Regex Wizards Out There? Message-ID: <1BDDBAEB-734F-48DA-8FC1-FE710393ACC1@near-time.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I've spent the last several hours fighting with a seriously nasty regular expression and I am utterly baffled by Ruby's behavior in this case. The situation is this: I have a giant regular expression that is responsible for matching naked URL's in the body of wiki text and automatically turning them into hotlinks. It works for me in all cases except when the hotlink appears at the end of a paragraph, right next to an

tag. Here is what I'm working with. Full Monty: (?x-mi:(!|\"\:|\"|\'|\]\()?(?:([a-zA-Z][-+.a-zA-Z\d]*):\/{0,2})?(?: ((?:[-_.!~*'()a-zA-Z\d;:&=+$,]|%[a-fA-F\d]{2})+)@)?((?:(?:[a-zA-Z\d] (?:[-a-zA-Z\d]*[a-zA-Z\d])?)\.)+(?:aero|biz|com|coop|edu|gov|info|int| mil|museum|name|net|org|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw| az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cf| cd|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec| ee|eg|eh|er|es|et|fi|fj|fk|fm|fo|fr|fx|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn| gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|io|iq|ir|is|it| jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu| lv|ly|ma|mc|md|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz| na|nc|ne|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn| pr|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so| sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua| ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zr|zw)) (?::(\d*))?(\/(?:[-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[- _.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*)*(?:\/(?:[-_.!~*'()a-zA-Z \d:@&=+$,]|%[a-fA-F\d]{2})*(?:;(?:[-_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F \d]{2})*)*)*)?(?:\?((?:[-_.~*'(a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d] {2})*))?(?:\#((?:[-_.~*'(a-zA-Z\d;\/?:@&=+$,\[\]]|%[a-fA-F\d]{2})*))? (?=\.?(?:\s|\)|\z|\ \;?))) Bits in question: (?=\.?(?:\s|\)|\z|\ \;?))) This final lookahead assertion is where the issue is. When I add an alternative match for

, the regex fails to stop at the   border and breaks the another interesting case. It then includes nbsp; in the autolinked URL and produces a bad link (and broken tests). Here are some alternatives I have tried unsuccessfully: '(?:(?=\.?(?:\s|\)|\z)|(?:\<\/p\>))|(?=\ ))' '(?:(?= )|(?=\.?(?:\s|\)|\z|(?:

)))?)' '(?=\.?(?:\s|\)|\z|(?:\<\/p\>)|(?:\ \;))?)?' And finally I dropped the lookahead back to the basics: '(?=(\ |

))' '(?:(?=\ )|(?=

))' '(?:(?=

)|(?=\ ))' I've read all about alternation in Mastering Regular Expressions and as far as I can tell, the Ruby regular expression engine does not match any of the alternation behaviors described there in. I've screwed with it for hours and as yet have no success in changing the match -- all varieties produce the same result, with hotlinks produced that include the bloody   Anyway, any insight into alternation wonkiness or alternate strategies for producing the match would be much appreciated. Cheers, Blake -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (Darwin) iD8DBQFFCOl+qvuZB2zXNU0RAlqOAJ9KSjo4wcZAEEuQyJQbT0bU9dI3RwCdHiGx X2lviiLpOm/sCEQKr4FLqvQ= =S2Fw -----END PGP SIGNATURE----- From nathaniel at talbott.ws Thu Sep 14 08:27:10 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Thu, 14 Sep 2006 08:27:10 -0400 Subject: [raleigh.rb] Any Regex Wizards Out There? In-Reply-To: <1BDDBAEB-734F-48DA-8FC1-FE710393ACC1@near-time.com> References: <1BDDBAEB-734F-48DA-8FC1-FE710393ACC1@near-time.com> Message-ID: <1007DA90-B77F-4599-8E64-143FE9F790C5@talbott.ws> On Sep 14, 2006, at 01:32 , Blake Watters wrote: > I've spent the last several hours fighting with a seriously nasty > regular expression and I am utterly baffled by Ruby's behavior in > this case. The situation is this: I have a giant regular expression > that is responsible for matching naked URL's in the body of wiki text > and automatically turning them into hotlinks. It works for me in all > cases except when the hotlink appears at the end of a paragraph, > right next to an

tag. Here is what I'm working with. Blake, Do you have a few test cases you can share for this so we can fiddle with it and see the behavior? That would help me at least to figure out what's going on here. -- Nathaniel Talbott <:((>< From nathaniel at talbott.ws Thu Sep 14 11:03:43 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Thu, 14 Sep 2006 11:03:43 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: References: <908AF717-CD31-4B6B-A673-B660B8AC0B22@talbott.ws> <4E1A44AA-B5BA-4A8A-ABBB-252564DC4D29@talbott.ws> <1F2129CD-6602-4C70-B304-FEC29092B179@talbott.ws> Message-ID: <63D42938-C016-421C-8A8E-ACD924CBE729@talbott.ws> On Sep 9, 2006, at 18:16 , Kevin Olbrich wrote: > I'd have to disagree with you about the database adapters. If the > behavior of the class is tied in an important way to the format of the > output of another class, it better darn well make sure that it is > getting that format, or at least complain loudly when it doesn't. > > Part of the problem with this particular bug is that it fails > silently. It took me the better part of a day to even figure out why > it wasn't working in the first place. I agree that the silent failure is bad. I wonder if we should pin that on Rails or on the database, though - it seems either or both of them should be choking on a malformed date, so perhaps both. > Maybe rails shouldn't let people change the default, but there is no > reason why the database adapter can't explicitly format the date in a > way that the DB will understand it. I think Rails makes it too easy to change the default while at the same time being oblivious to the consequences (i.e. not protecting the database adapters). OTOH, I like that in Ruby everything is always changeable at some level :-) So... are you going to post your first ticket? ;-) -- Nathaniel Talbott <:((>< From kevin.olbrich at gmail.com Thu Sep 14 11:17:00 2006 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Thu, 14 Sep 2006 11:17:00 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: <63D42938-C016-421C-8A8E-ACD924CBE729@talbott.ws> References: <908AF717-CD31-4B6B-A673-B660B8AC0B22@talbott.ws> <4E1A44AA-B5BA-4A8A-ABBB-252564DC4D29@talbott.ws> <1F2129CD-6602-4C70-B304-FEC29092B179@talbott.ws> <63D42938-C016-421C-8A8E-ACD924CBE729@talbott.ws> Message-ID: On 9/14/06, Nathaniel Talbott wrote: > On Sep 9, 2006, at 18:16 , Kevin Olbrich wrote: > > > I'd have to disagree with you about the database adapters. If the > > behavior of the class is tied in an important way to the format of the > > output of another class, it better darn well make sure that it is > > getting that format, or at least complain loudly when it doesn't. > > > > Part of the problem with this particular bug is that it fails > > silently. It took me the better part of a day to even figure out why > > it wasn't working in the first place. > > I agree that the silent failure is bad. I wonder if we should pin > that on Rails or on the database, though - it seems either or both of > them should be choking on a malformed date, so perhaps both. > > > > Maybe rails shouldn't let people change the default, but there is no > > reason why the database adapter can't explicitly format the date in a > > way that the DB will understand it. > > I think Rails makes it too easy to change the default while at the > same time being oblivious to the consequences (i.e. not protecting > the database adapters). OTOH, I like that in Ruby everything is > always changeable at some level :-) > > So... are you going to post your first ticket? ;-) > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > Ticket URL: It's actually not my first either. Someone seems to have patched it, but I haven't had a chance to test it out yet. In this case I place the blame on Rails because MySQL documents the behavior, IIRC. The good news about ruby is that it gives you enough rope to hang yourself and six of your closest friends. -- Kevin Olbrich kevin.olbrich at gmail.com CONFIDENTIAL Unless otherwise indicated or obvious from the nature of the following communication, the information contained herein is a privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. It the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies, electronic, paper, or otherwise, which you may have of this communication. From nathaniel at talbott.ws Thu Sep 14 11:42:03 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Thu, 14 Sep 2006 11:42:03 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: References: <908AF717-CD31-4B6B-A673-B660B8AC0B22@talbott.ws> <4E1A44AA-B5BA-4A8A-ABBB-252564DC4D29@talbott.ws> <1F2129CD-6602-4C70-B304-FEC29092B179@talbott.ws> <63D42938-C016-421C-8A8E-ACD924CBE729@talbott.ws> Message-ID: <84099DD6-9D9D-4FCD-BB85-6CC45EA9171B@talbott.ws> On Sep 14, 2006, at 11:17 , Kevin Olbrich wrote: > Ticket URL: > > It's actually not my first either. Wow - you've got quite a few in there! > Someone seems to have patched it, > but I haven't had a chance to test it out yet. > > In this case I place the blame on Rails because MySQL documents the > behavior, IIRC. So if Rails had documented it, it would be OK? I suppose documenting it is better than nothing, but it seems like bogus behavior on MySQL's part. Not that MySQL is known for being very strict... > The good news about ruby is that it gives you enough rope to hang > yourself and six of your closest friends. Indeed :-) -- Nathaniel Talbott <:((>< From kevin.olbrich at gmail.com Thu Sep 14 11:52:32 2006 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Thu, 14 Sep 2006 11:52:32 -0400 Subject: [raleigh.rb] Problems with ActiveRecord handling of date columns In-Reply-To: <84099DD6-9D9D-4FCD-BB85-6CC45EA9171B@talbott.ws> References: <908AF717-CD31-4B6B-A673-B660B8AC0B22@talbott.ws> <4E1A44AA-B5BA-4A8A-ABBB-252564DC4D29@talbott.ws> <1F2129CD-6602-4C70-B304-FEC29092B179@talbott.ws> <63D42938-C016-421C-8A8E-ACD924CBE729@talbott.ws> <84099DD6-9D9D-4FCD-BB85-6CC45EA9171B@talbott.ws> Message-ID: On 9/14/06, Nathaniel Talbott wrote: > On Sep 14, 2006, at 11:17 , Kevin Olbrich wrote: > > > Ticket URL: > > > > It's actually not my first either. > > Wow - you've got quite a few in there! > > > > Someone seems to have patched it, > > but I haven't had a chance to test it out yet. > > > > In this case I place the blame on Rails because MySQL documents the > > behavior, IIRC. > > So if Rails had documented it, it would be OK? I suppose documenting > it is better than nothing, but it seems like bogus behavior on > MySQL's part. Not that MySQL is known for being very strict... > > > > The good news about ruby is that it gives you enough rope to hang > > yourself and six of your closest friends. > > Indeed :-) > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > The way I see it, if you are going to build a database adapter then it should behave in a manner consistent with the documented behavior of the database. In this case MySQL made a design choice to return a nil date rather than an error when handed a malformed date. The database adapter just fails to handle that particular case in an elegant manner. So I would say that the database adapter is at fault in this case. Not that it's particularly important where the fault lies, so long as it works as expected. The solution of forcing the date to be a particular format before writing it to the DB avoids this particular problem and lets Rails handle the error if one crops up. One of these days I'll get around to actually patching some of my Tickets. -- Kevin Olbrich kevin.olbrich at gmail.com CONFIDENTIAL Unless otherwise indicated or obvious from the nature of the following communication, the information contained herein is a privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. It the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies, electronic, paper, or otherwise, which you may have of this communication. From lists-jared at nc.rr.com Fri Sep 15 05:34:24 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Fri, 15 Sep 2006 05:34:24 -0400 Subject: [raleigh.rb] Ruby on Rails Software Engineer Opportunities-Baltimore MD Message-ID: <61E4CA4D-555C-4B0B-BD46-B0326762086A@nc.rr.com> FYI... btw, is forwarding this sort of thing around acceptable? I have no ties to the recruiter in question... it was a "cold call" email that I thought might be of interest to group members. What say you all? Jared http://jaredrichardson.net Begin forwarded message: On Sep 14, 2006, at 1:18 PM, Barbara L. Keihm wrote: Only if that person was open to coming to Baltimore for 3-6 months at the start and then could work remotely. Is that an option for you? Barbara Keihm ReSearch Connection 678-468-9037 bkeihm at research-connection.com www.research-connection.com From: Jared Richardson [mailto:jared-richardson at nc.rr.com] Sent: Thursday, September 14, 2006 1:16 PM To: bkeihm at research-connection.com Subject: Re: Ruby on Rails Software Engineer Opportunities-Baltimore MD Hi Barbara, Would your client be interested in someone working remotely? Jared http://jaredrichardson.net On Sep 14, 2006, at 12:36 PM, Barbara L. Keihm wrote: Hi there! I am hoping you can assist me!!! I am searching for Ruby, Ruby on Rails Software Engineers for the Baltimore MD area. I will consider local candidates as well as those willing to consider relocation. Would you know of anyone who may be looking and could pass my way? I have added a brief description of what my client is seeking below. Any assistance would be greatly appreciated. Thank you in advance for your time! ************************************************************************ ******************************************************************** Ruby on Rails Senior Software Engineer We are looking for highly motivated Ruby on Rails senior software engineers with a passion for software development and who enjoy learning and applying knowledge. You must be able to conceptualize multiple layers of abstractions and models and have solid working knowledge of object-oriented methodologies. Experience in logic programming is not essential, but is desirable. We focus Web application systems using Model Driven Development approaches combined with logic programming and knowledge representation components. Our models are derived from public health, biomedical research, clinical practice, and computer science. Our products are built with multi-tier enterprise frameworks based upon Ruby on Rails, AJAX, XSB, and run on Linux servers. Education and Experience: * Bachelors degree in computer science (or closely related field). * 12 months Ruby on Rails or 2 or more years predominantly in Ruby Language. Technical: * Strong object-oriented design and development skills. * Systematic software development processes. * Experience with UML, EMF and design patterns. * Model Driven Architecture. * Database design/development (Oracle, MS-SQL, MySQL). * Experience with multiple programming languages, especially Ruby, JavaScript, and XSB/PROLOG Personal: * Excellent written and verbal communication skills. * Enthusiasm, commitment, and drive. * Strong analytical and problem-solving skills. * Ability to work independently & with a team. * Adaptability to changing client needs and company expansion. * Ability to work on multiple projects simultaneously. * Ability to monitor project progress and notify others of real and potential problems Barbara Keihm ReSearch Connection 678-468-9037 bkeihm at research-connection.com www.research-connection.com Barbara Keihm ReSearch Connection 678-468-9037 bkeihm at research-connection.com www.research-connection.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060915/6e25dc2a/attachment.html From nathaniel at talbott.ws Fri Sep 15 07:26:33 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Fri, 15 Sep 2006 07:26:33 -0400 Subject: [raleigh.rb] Ruby on Rails Software Engineer Opportunities-Baltimore MD In-Reply-To: <61E4CA4D-555C-4B0B-BD46-B0326762086A@nc.rr.com> References: <61E4CA4D-555C-4B0B-BD46-B0326762086A@nc.rr.com> Message-ID: <27DBF987-AADF-4890-AE57-06391743521E@talbott.ws> On Sep 15, 2006, at 05:34 , Jared Richardson wrote: > FYI... > > btw, is forwarding this sort of thing around acceptable? I have no > ties to the recruiter in question... it was a "cold call" email > that I thought might be of interest to group members. > > What say you all? I say go for it. As long as we take a second to consider whether pitches are of "general interest" I think it's a valuable service. -- Nathaniel Talbott <:((>< From charlesmbowman at gmail.com Sat Sep 16 12:10:02 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Sat, 16 Sep 2006 12:10:02 -0400 Subject: [raleigh.rb] rmagic problem Message-ID: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:248:in `load_missing_constant': uninitialized constant Magick::Enum (NameError) The above error occurs each time I try to boot webrick or mongrel. I'm kind of lost as to where to search for the cause of this error. My install of imagemagick, rmagick, and acts_as_attachment went smoothly. I'm on fedora core 4 with edge rails. Thanks for any help -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060916/43f66a14/attachment.html From charlesmbowman at gmail.com Mon Sep 18 10:14:00 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Mon, 18 Sep 2006 10:14:00 -0400 Subject: [raleigh.rb] rmagic problem In-Reply-To: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> Message-ID: <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> I have kind of narrowed the problem down to the gem of rmagick. If I remove the line: require 'RMagick' the app loads fine. Again I installed imagemagick from source (it went smoothly) I installed the gem of RMagick and it went smooth. Any ideas? On 9/16/06, Charlie Bowman wrote: > > ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:248:in > `load_missing_constant': uninitialized constant Magick::Enum (NameError) > > The above error occurs each time I try to boot webrick or mongrel. I'm > kind of lost as to where to search for the cause of this error. My install > of imagemagick, rmagick, and acts_as_attachment went smoothly. I'm on > fedora core 4 with edge rails. Thanks for any help > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060918/708794cc/attachment.html From lists-jared at nc.rr.com Mon Sep 18 13:17:15 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Mon, 18 Sep 2006 13:17:15 -0400 Subject: [raleigh.rb] rmagic problem In-Reply-To: <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> Message-ID: <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> Are you sure the gem installed cleanly? I had issues last week with the gem and there were error messages hidden in the gem's output. It ran to completion but it didn't install completely? Check in the gem folder and look at the log files. I think they are mkmf.log or ext.log See if there were any errors that didn't make the console. Also, be sure you have the Image Magic libraries (and the correct version) in your library path. Otherwise the compile or run time might have trouble running. Jared http://jaredrichardson.net On Sep 18, 2006, at 10:14 AM, Charlie Bowman wrote: > I have kind of narrowed the problem down to the gem of rmagick. > If I remove the line: > require 'RMagick' the app loads fine. Again I installed > imagemagick from source (it went smoothly) > I installed the gem of RMagick and it went smooth. Any ideas? > > On 9/16/06, Charlie Bowman wrote: > ./script/../config/../vendor/rails/activesupport/lib/active_support/ > dependencies.rb:248:in `load_missing_constant': uninitialized > constant Magick::Enum (NameError) > > The above error occurs each time I try to boot webrick or mongrel. > I'm kind of lost as to where to search for the cause of this > error. My install of imagemagick, rmagick, and acts_as_attachment > went smoothly. I'm on fedora core 4 with edge rails. Thanks for > any help > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060918/6f56bbbd/attachment.html From nathaniel at talbott.ws Mon Sep 18 13:42:46 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Mon, 18 Sep 2006 13:42:46 -0400 Subject: [raleigh.rb] rmagic problem In-Reply-To: <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> Message-ID: <044C497D-EB94-41B8-95E9-89ECACDEA2DA@talbott.ws> On Sep 18, 2006, at 10:14 , Charlie Bowman wrote: > I have kind of narrowed the problem down to the gem of rmagick. > If I remove the line: > require 'RMagick' the app loads fine. Again I installed > imagemagick from source (it went smoothly) > I installed the gem of RMagick and it went smooth. Any ideas? I found someone with similar troubles: http://rubyforge.org/forum/forum.php?thread_id=6851&forum_id=33 My guess is that there's another c library (perhaps GraphicsMagick?) that is getting loaded or that RMagick is being built against and that other library differs from your compiled ImageMagick library. I'd be trying to mess around with paths and perhaps building RMagick from source (instead of using the gem) to try to figure out the problem. Sorry I can't help more, -- Nathaniel Talbott <:((>< From charlesmbowman at gmail.com Mon Sep 18 14:10:26 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Mon, 18 Sep 2006 14:10:26 -0400 Subject: [raleigh.rb] rmagic problem In-Reply-To: <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> Message-ID: <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> thanks, as my day job doesn't allow/prefer ruby, I'll check both those logs when I get home On 9/18/06, Jared Richardson wrote: > > Are you sure the gem installed cleanly? I had issues last week with the > gem and there were error messages hidden in the gem's output. > It ran to completion but it didn't install completely? > > Check in the gem folder and look at the log files. I think they are > mkmf.log or ext.log See if there were any errors that didn't make the > console. > > Also, be sure you have the Image Magic libraries (and the correct version) > in your library path. Otherwise the compile or run time might have trouble > running. > > Jared > http://jaredrichardson.net > > On Sep 18, 2006, at 10:14 AM, Charlie Bowman wrote: > > I have kind of narrowed the problem down to the gem of rmagick. If I > remove the line: > require 'RMagick' the app loads fine. Again I installed imagemagick from > source (it went smoothly) > I installed the gem of RMagick and it went smooth. Any ideas? > > On 9/16/06, Charlie Bowman wrote: > > > > ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:248:in > > `load_missing_constant': uninitialized constant Magick::Enum (NameError) > > > > The above error occurs each time I try to boot webrick or mongrel. I'm > > kind of lost as to where to search for the cause of this error. My install > > of imagemagick, rmagick, and acts_as_attachment went smoothly. I'm on > > fedora core 4 with edge rails. Thanks for any help > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060918/b7f2058d/attachment.html From nathaniel at talbott.ws Mon Sep 18 14:24:04 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Mon, 18 Sep 2006 14:24:04 -0400 Subject: [raleigh.rb] Pre-Meeting Chow Message-ID: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> Anyone who's available is invited to join me at 5:30 tomorrow (Tuesday) night at Baja Burrito (http://rubyurl.com/CGF) to grab dinner and some Ruby chatter before heading over to Red Hat for the meeting. While by no means required, a quick RSVP (just reply to this email with "In!" or somesuch) would be great. Looking forward to it, -- Nathaniel Talbott <:((>< From atomgiant at gmail.com Mon Sep 18 15:37:37 2006 From: atomgiant at gmail.com (Tom Davies) Date: Mon, 18 Sep 2006 15:37:37 -0400 Subject: [raleigh.rb] rmagic problem In-Reply-To: <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> Message-ID: If all else fails, you can use the MiniMagick plugin which is just a wrapper around the RMagick command line tools (assuming just plain RMagick works for you). It is supposed to be less of a memory hog too, but I haven't done much profiling. I have been using it for a couple of months with no problems. I wrote up a brief article on using MiniMagick here: http://atomgiant.com/articles/2006/07/19/resizing-images-with-minimagick Good Luck, Tom On 9/18/06, Charlie Bowman wrote: > thanks, as my day job doesn't allow/prefer ruby, I'll check both those logs > when I get home > > > On 9/18/06, Jared Richardson < lists-jared at nc.rr.com> wrote: > > > > > > Are you sure the gem installed cleanly? I had issues last week with the > gem and there were error messages hidden in the gem's output. > > > > > > It ran to completion but it didn't install completely? > > > > > > Check in the gem folder and look at the log files. I think they are > mkmf.log or ext.log See if there were any errors that didn't make the > console. > > > > > > Also, be sure you have the Image Magic libraries (and the correct version) > in your library path. Otherwise the compile or run time might have trouble > running. > > > > > > Jared > > http://jaredrichardson.net > > > > > > > > > > On Sep 18, 2006, at 10:14 AM, Charlie Bowman wrote: > > > > > > > > I have kind of narrowed the problem down to the gem of rmagick. If I > remove the line: > > require 'RMagick' the app loads fine. Again I installed imagemagick from > source (it went smoothly) > > I installed the gem of RMagick and it went smooth. Any ideas? > > > > > > On 9/16/06, Charlie Bowman wrote: > > > > > > > ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:248:in > `load_missing_constant': uninitialized constant Magick::Enum (NameError) > > > > > > The above error occurs each time I try to boot webrick or mongrel. I'm > kind of lost as to where to search for the cause of this error. My install > of imagemagick, rmagick, and acts_as_attachment went smoothly. I'm on > fedora core 4 with edge rails. Thanks for any help > > > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -- Tom Davies http://atomgiant.com http://gifthat.com From philomousos at gmail.com Mon Sep 18 15:38:10 2006 From: philomousos at gmail.com (Hugh Cayless) Date: Mon, 18 Sep 2006 15:38:10 -0400 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> References: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> Message-ID: <74BDB98A-A4CB-4810-AF38-883344F896C9@gmail.com> In! Hugh On Sep 18, 2006, at 2:24 PM, Nathaniel Talbott wrote: > Anyone who's available is invited to join me at 5:30 tomorrow > (Tuesday) night at Baja Burrito (http://rubyurl.com/CGF) to grab > dinner and some Ruby chatter before heading over to Red Hat for the > meeting. > > While by no means required, a quick RSVP (just reply to this email > with "In!" or somesuch) would be great. > > Looking forward to it, > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From atomgiant at gmail.com Mon Sep 18 15:38:25 2006 From: atomgiant at gmail.com (Tom Davies) Date: Mon, 18 Sep 2006 15:38:25 -0400 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> References: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> Message-ID: I'm in. On 9/18/06, Nathaniel Talbott wrote: > Anyone who's available is invited to join me at 5:30 tomorrow > (Tuesday) night at Baja Burrito (http://rubyurl.com/CGF) to grab > dinner and some Ruby chatter before heading over to Red Hat for the > meeting. > > While by no means required, a quick RSVP (just reply to this email > with "In!" or somesuch) would be great. > > Looking forward to it, > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Tom Davies http://atomgiant.com http://gifthat.com From ryan.daigle at gmail.com Mon Sep 18 16:54:35 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Mon, 18 Sep 2006 16:54:35 -0400 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> References: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> Message-ID: <450F078B.2050003@gmail.com> in Nathaniel Talbott wrote: > Anyone who's available is invited to join me at 5:30 tomorrow > (Tuesday) night at Baja Burrito (http://rubyurl.com/CGF) to grab > dinner and some Ruby chatter before heading over to Red Hat for the > meeting. > > While by no means required, a quick RSVP (just reply to this email > with "In!" or somesuch) would be great. > > Looking forward to it, > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > From devpotato at gmail.com Mon Sep 18 19:01:54 2006 From: devpotato at gmail.com (Kevin Smith) Date: Mon, 18 Sep 2006 19:01:54 -0400 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> References: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> Message-ID: <3560cf6d0609181601g573bf480h86c4757f87bcb4@mail.gmail.com> I'm in. On 9/18/06, Nathaniel Talbott wrote: > > Anyone who's available is invited to join me at 5:30 tomorrow > (Tuesday) night at Baja Burrito (http://rubyurl.com/CGF) to grab > dinner and some Ruby chatter before heading over to Red Hat for the > meeting. > > While by no means required, a quick RSVP (just reply to this email > with "In!" or somesuch) would be great. > > Looking forward to it, > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060918/c15b76bb/attachment.html From cyclists at nc.rr.com Mon Sep 18 17:58:19 2006 From: cyclists at nc.rr.com (Timothy Hunter) Date: Mon, 18 Sep 2006 17:58:19 -0400 Subject: [raleigh.rb] rmagic problem In-Reply-To: <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> Message-ID: It might be useful to determine if you have a problem with RMagick itself, or if the problem is confined to using RMagick in a Rails app. Have you tried using RMagick outside of Rails? A very simple test is ruby -r RMagick -e "puts Magick::Long_version" If you installed RMagick from source (http://rmagick.rubyforge.org/ install-linux.html) RMagick runs 175 test programs during the install. If you get more than 5 errors from those examples then the installation aborts. Did you get any error messages? Can you run a plain old ImageMagick command, like this: convert myimage.jpg myimage.gif identify myimage.jpg If you can't run a plain ImageMagick command then we need to address the ImageMagick installation. If you can't run a plain RMagick script then we need to address the RMagick installation. If you can do both of those, then it seems to me that the problem is either in your Rails configuration or your webserver configuration. On Sep 18, 2006, at 2:10 PM, Charlie Bowman wrote: > thanks, as my day job doesn't allow/prefer ruby, I'll check both > those logs when I get home > > On 9/18/06, Jared Richardson < lists-jared at nc.rr.com> wrote: > Are you sure the gem installed cleanly? I had issues last week with > the gem and there were error messages hidden in the gem's output. > > It ran to completion but it didn't install completely? > > Check in the gem folder and look at the log files. I think they are > mkmf.log or ext.log See if there were any errors that didn't make > the console. > > Also, be sure you have the Image Magic libraries (and the correct > version) in your library path. Otherwise the compile or run time > might have trouble running. > > Jared > http://jaredrichardson.net > > On Sep 18, 2006, at 10:14 AM, Charlie Bowman wrote: > > I have kind of narrowed the problem down to the gem of rmagick. > If I remove the line: > require 'RMagick' the app loads fine. Again I installed > imagemagick from source (it went smoothly) > I installed the gem of RMagick and it went smooth. Any ideas? > > On 9/16/06, Charlie Bowman wrote: > ./script/../config/../vendor/rails/activesupport/lib/active_support/ > dependencies.rb:248:in `load_missing_constant': uninitialized > constant Magick::Enum (NameError) > > The above error occurs each time I try to boot webrick or mongrel. > I'm kind of lost as to where to search for the cause of this > error. My install of imagemagick, rmagick, and acts_as_attachment > went smoothly. I'm on fedora core 4 with edge rails. Thanks for > any help > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060918/0b5385ff/attachment.html From jjeffers at nc.rr.com Mon Sep 18 19:43:17 2006 From: jjeffers at nc.rr.com (James Jeffers) Date: Mon, 18 Sep 2006 19:43:17 -0400 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: References: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> Message-ID: <1158622997.1481.130.camel@localhost> If Tom's going - so am I. James On Mon, 2006-09-18 at 15:38 -0400, Tom Davies wrote: > I'm in. > > On 9/18/06, Nathaniel Talbott wrote: > > Anyone who's available is invited to join me at 5:30 tomorrow > > (Tuesday) night at Baja Burrito (http://rubyurl.com/CGF) to grab > > dinner and some Ruby chatter before heading over to Red Hat for the > > meeting. > > > > While by no means required, a quick RSVP (just reply to this email > > with "In!" or somesuch) would be great. > > > > Looking forward to it, > > > > > > -- > > Nathaniel Talbott > > > > <:((>< > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > From dsnider at objectdomain.com Mon Sep 18 20:30:36 2006 From: dsnider at objectdomain.com (Dan Snider) Date: Mon, 18 Sep 2006 20:30:36 -0400 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> Message-ID: <00dd01c6db82$d3f5ca90$0660a8c0@Newton> I will try and make it > -----Original Message----- > From: raleigh-rb-members-bounces at rubyforge.org > [mailto:raleigh-rb-members-bounces at rubyforge.org] On Behalf > Of Nathaniel Talbott > Sent: Monday, September 18, 2006 2:24 PM > To: The mailing list of raleigh.rb > Subject: [raleigh.rb] Pre-Meeting Chow > > Anyone who's available is invited to join me at 5:30 tomorrow > (Tuesday) night at Baja Burrito (http://rubyurl.com/CGF) to > grab dinner and some Ruby chatter before heading over to Red > Hat for the meeting. > > While by no means required, a quick RSVP (just reply to this > email with "In!" or somesuch) would be great. > > Looking forward to it, > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > From will.g at usa.net Mon Sep 18 21:39:40 2006 From: will.g at usa.net (Will Gwaltney) Date: Mon, 18 Sep 2006 21:39:40 -0400 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> References: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> Message-ID: <450F4A5C.30800@usa.net> I'm in. Nathaniel Talbott wrote: >Anyone who's available is invited to join me at 5:30 tomorrow >(Tuesday) night at Baja Burrito (http://rubyurl.com/CGF) to grab >dinner and some Ruby chatter before heading over to Red Hat for the >meeting. > >While by no means required, a quick RSVP (just reply to this email >with "In!" or somesuch) would be great. > >Looking forward to it, > > >-- >Nathaniel Talbott > ><:((>< > >_______________________________________________ >raleigh-rb-members mailing list >raleigh-rb-members at rubyforge.org >http://rubyforge.org/mailman/listinfo/raleigh-rb-members > >. > > > From outtenr at gmail.com Tue Sep 19 11:01:28 2006 From: outtenr at gmail.com (Richard Outten) Date: Tue, 19 Sep 2006 11:01:28 -0400 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> References: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> Message-ID: <905212740609190801w5ee97b92p117d84b8acf3598c@mail.gmail.com> in On 9/18/06, Nathaniel Talbott wrote: > Anyone who's available is invited to join me at 5:30 tomorrow > (Tuesday) night at Baja Burrito (http://rubyurl.com/CGF) to grab > dinner and some Ruby chatter before heading over to Red Hat for the > meeting. > > While by no means required, a quick RSVP (just reply to this email > with "In!" or somesuch) would be great. > > Looking forward to it, > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From lists-jared at nc.rr.com Tue Sep 19 13:22:57 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Tue, 19 Sep 2006 13:22:57 -0400 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> References: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> Message-ID: <99E06248-BC4D-4867-AEC1-BCEDEC4FA852@nc.rr.com> In On Sep 18, 2006, at 2:24 PM, Nathaniel Talbott wrote: > Anyone who's available is invited to join me at 5:30 tomorrow > (Tuesday) night at Baja Burrito (http://rubyurl.com/CGF) to grab > dinner and some Ruby chatter before heading over to Red Hat for the > meeting. > > While by no means required, a quick RSVP (just reply to this email > with "In!" or somesuch) would be great. > > Looking forward to it, > > > -- > Nathaniel Talbott > > <:((>< > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From pelargir at gmail.com Tue Sep 19 14:33:54 2006 From: pelargir at gmail.com (Matthew) Date: Tue, 19 Sep 2006 14:33:54 -0400 Subject: [raleigh.rb] Pre-Meeting Chow In-Reply-To: <99E06248-BC4D-4867-AEC1-BCEDEC4FA852@nc.rr.com> References: <14D3A150-EB44-4C18-ABA6-B527C0E108D0@talbott.ws> <99E06248-BC4D-4867-AEC1-BCEDEC4FA852@nc.rr.com> Message-ID: All these movers and shakers under one roof? You betcha I'm in. On 9/19/06, Jared Richardson wrote: > > In > > On Sep 18, 2006, at 2:24 PM, Nathaniel Talbott wrote: > > > Anyone who's available is invited to join me at 5:30 tomorrow > > (Tuesday) night at Baja Burrito (http://rubyurl.com/CGF) to grab > > dinner and some Ruby chatter before heading over to Red Hat for the > > meeting. > > > > While by no means required, a quick RSVP (just reply to this email > > with "In!" or somesuch) would be great. > > > > Looking forward to it, > > > > > > -- > > Nathaniel Talbott > > > > <:((>< > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060919/314f4e94/attachment.html From charlesmbowman at gmail.com Tue Sep 19 19:07:40 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Tue, 19 Sep 2006 19:07:40 -0400 Subject: [raleigh.rb] rmagic problem In-Reply-To: References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> Message-ID: <298c4d2a0609191607q60f7b804lf87c7c443025bd69@mail.gmail.com> Thank you guys for the help. It appears that installing RMagick from source is the way to go (at least for me). running gem install rmagick resulted in the system telling me that the install went fine. When installing rmagick from source I was alerted to the error 'unable to find libMagic.so' I added the path to my libray load path and all was well export LD_LIBRARY_PATH=/usr/local/lib On 9/18/06, Timothy Hunter wrote: > > It might be useful to determine if you have a problem with RMagick itself, > or if the problem is confined to using RMagick in a Rails app. Have you > tried using RMagick outside of Rails? A very simple test is > > ruby -r RMagick -e "puts Magick::Long_version" > > If you installed RMagick from source ( > http://rmagick.rubyforge.org/install-linux.html) RMagick runs 175 test > programs during the install. If you get more than 5 errors from those > examples then the installation aborts. Did you get any error messages? > > Can you run a plain old ImageMagick command, like this: > > convert myimage.jpg myimage.gif > identify myimage.jpg > > If you can't run a plain ImageMagick command then we need to address the > ImageMagick installation. If you can't run a plain RMagick script then we > need to address the RMagick installation. If you can do both of those, then > it seems to me that the problem is either in your Rails configuration or > your webserver configuration. > > On Sep 18, 2006, at 2:10 PM, Charlie Bowman wrote: > > thanks, as my day job doesn't allow/prefer ruby, I'll check both those > logs when I get home > > On 9/18/06, Jared Richardson < lists-jared at nc.rr.com> wrote: > > > > Are you sure the gem installed cleanly? I had issues last week with the > > gem and there were error messages hidden in the gem's output. > > It ran to completion but it didn't install completely? > > > > Check in the gem folder and look at the log files. I think they are > > mkmf.log or ext.log See if there were any errors that didn't make the > > console. > > > > Also, be sure you have the Image Magic libraries (and the correct > > version) in your library path. Otherwise the compile or run time might have > > trouble running. > > > > Jared > > http://jaredrichardson.net > > > > On Sep 18, 2006, at 10:14 AM, Charlie Bowman wrote: > > > > I have kind of narrowed the problem down to the gem of rmagick. If I > > remove the line: > > require 'RMagick' the app loads fine. Again I installed imagemagick > > from source (it went smoothly) > > I installed the gem of RMagick and it went smooth. Any ideas? > > > > On 9/16/06, Charlie Bowman wrote: > > > > > > ./script/../config/../vendor/rails/activesupport/lib/active_support/dependencies.rb:248:in > > > `load_missing_constant': uninitialized constant Magick::Enum (NameError) > > > > > > The above error occurs each time I try to boot webrick or mongrel. > > > I'm kind of lost as to where to search for the cause of this error. My > > > install of imagemagick, rmagick, and acts_as_attachment went smoothly. I'm > > > on fedora core 4 with edge rails. Thanks for any help > > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060919/49b84ab4/attachment.html From cyclists at nc.rr.com Tue Sep 19 21:19:46 2006 From: cyclists at nc.rr.com (Timothy Hunter) Date: Tue, 19 Sep 2006 21:19:46 -0400 Subject: [raleigh.rb] rmagic problem In-Reply-To: <298c4d2a0609191607q60f7b804lf87c7c443025bd69@mail.gmail.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> <298c4d2a0609191607q60f7b804lf87c7c443025bd69@mail.gmail.com> Message-ID: <44217C96-1874-4702-8575-487303E2BE45@nc.rr.com> Thanks for letting me know, Charlie. Rubygems is bad about not reporting any errors that occur during installation. Building from source is always my choice. On Sep 19, 2006, at 7:07 PM, Charlie Bowman wrote: > Thank you guys for the help. It appears that installing RMagick > from source is the way to go (at least for me). running gem > install rmagick resulted in the system telling me that the install > went fine. When installing rmagick from source I was alerted to > the error 'unable to find libMagic.so' I added the path to my > libray load path and all was well > > export LD_LIBRARY_PATH=/usr/local/lib > > > On 9/18/06, Timothy Hunter < cyclists at nc.rr.com> wrote: > It might be useful to determine if you have a problem with RMagick > itself, or if the problem is confined to using RMagick in a Rails > app. Have you tried using RMagick outside of Rails? A very simple > test is > > ruby -r RMagick -e "puts Magick::Long_version" > > If you installed RMagick from source ( http://rmagick.rubyforge.org/ > install-linux.html) RMagick runs 175 test programs during the > install. If you get more than 5 errors from those examples then the > installation aborts. Did you get any error messages? > > Can you run a plain old ImageMagick command, like this: > > convert myimage.jpg myimage.gif > identify myimage.jpg > > If you can't run a plain ImageMagick command then we need to > address the ImageMagick installation. If you can't run a plain > RMagick script then we need to address the RMagick installation. If > you can do both of those, then it seems to me that the problem is > either in your Rails configuration or your webserver configuration. > > On Sep 18, 2006, at 2:10 PM, Charlie Bowman wrote: > >> thanks, as my day job doesn't allow/prefer ruby, I'll check both >> those logs when I get home >> >> On 9/18/06, Jared Richardson < lists-jared at nc.rr.com > wrote: >> Are you sure the gem installed cleanly? I had issues last week >> with the gem and there were error messages hidden in the gem's >> output. >> >> It ran to completion but it didn't install completely? >> >> Check in the gem folder and look at the log files. I think they >> are mkmf.log or ext.log See if there were any errors that didn't >> make the console. >> >> Also, be sure you have the Image Magic libraries (and the correct >> version) in your library path. Otherwise the compile or run time >> might have trouble running. >> >> Jared >> http://jaredrichardson.net >> >> On Sep 18, 2006, at 10:14 AM, Charlie Bowman wrote: >> >> I have kind of narrowed the problem down to the gem of rmagick. >> If I remove the line: >> require 'RMagick' the app loads fine. Again I installed >> imagemagick from source (it went smoothly) >> I installed the gem of RMagick and it went smooth. Any ideas? >> >> On 9/16/06, Charlie Bowman < charlesmbowman at gmail.com> wrote: >> ./script/../config/../vendor/rails/activesupport/lib/ >> active_support/dependencies.rb:248:in `load_missing_constant': >> uninitialized constant Magick::Enum (NameError) >> >> The above error occurs each time I try to boot webrick or >> mongrel. I'm kind of lost as to where to search for the cause of >> this error. My install of imagemagick, rmagick, and >> acts_as_attachment went smoothly. I'm on fedora core 4 with edge >> rails. Thanks for any help >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060919/f46dd8dd/attachment-0001.html From lists-jared at nc.rr.com Wed Sep 20 10:02:23 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Wed, 20 Sep 2006 10:02:23 -0400 Subject: [raleigh.rb] Rela.tv open sourced! In-Reply-To: <298c4d2a0609191607q60f7b804lf87c7c443025bd69@mail.gmail.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> <298c4d2a0609191607q60f7b804lf87c7c443025bd69@mail.gmail.com> Message-ID: <524861E8-2456-4FD7-B8B4-90B48F1AC815@nc.rr.com> I just saw this float by on the Artima Ruby RSS feed. http://www.ryandaigle.com/articles/2006/09/20/rela-tv-open-sourced Last night you saw the demo. Today, you can get the code! Jared http://jaredrichardson.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060920/b9a076cb/attachment.html From ryan.daigle at gmail.com Wed Sep 20 13:16:36 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Wed, 20 Sep 2006 13:16:36 -0400 Subject: [raleigh.rb] Rela.tv open sourced! In-Reply-To: <524861E8-2456-4FD7-B8B4-90B48F1AC815@nc.rr.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> <298c4d2a0609191607q60f7b804lf87c7c443025bd69@mail.gmail.com> <524861E8-2456-4FD7-B8B4-90B48F1AC815@nc.rr.com> Message-ID: <45117774.8030905@gmail.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060920/18f9f87f/attachment.html From rick.denatale at gmail.com Wed Sep 20 15:22:48 2006 From: rick.denatale at gmail.com (Rick DeNatale) Date: Wed, 20 Sep 2006 15:22:48 -0400 Subject: [raleigh.rb] Hpricot questions, building php visualization/conversion tools. Message-ID: So, Ryan's talk last night got me interested in Hpricot. I mentioned to a few folks that I've recently 'inherited' a job of maintaining a large poorly structured PHP system. I'm in the throes of trying to analyze what's there, so I'm looking for tools, or to write some, in Ruby of course. The ultimate goal is to get the client to agree to start replacing the code with modules rewritten in rails, but first I need to suss out the stuff that's there. What I'd like to do is something like traverse the php and html files in the site and build up a cross-reference, so I can see what links where, what php code calls what other php code, and what code touches the database. I figured I could store the xref info in a db using ActiveRecord, but first I need to extract the info. It occured to me that Hpricot might be a good starting point. My first step was to hack together a quick little file to let open-uri handle scp urls. The machine the code resides on is kind of old, and doesn't have ruby installed, and I don't want to copy the whole code base. Actually, I'm not sure exactly what the semantics of an SCP uri is supposed to be, my implementation doesn't really use scp underneath, but instead opens a pipe to ssh to cat the file so that it can be read using IO.popen. I couldn't find an existing implementation but my hack seems to work. Now I can do doc = Hpricot(open("scp://guy at somehost.com/path/to/file") and I can search for say a elements to find links. But I'm not sure what to do about the php. It shows up as Hpricot::ProcIns objects (for processing instructions), but I can't seem to figure out how to find those with an xpath which Hpricot understands, or how to work with them once I've got them. Any ideas? Better approaches? Existing tools? -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From lists-jared at nc.rr.com Wed Sep 20 15:33:06 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Wed, 20 Sep 2006 15:33:06 -0400 Subject: [raleigh.rb] Ruby and JUnit output In-Reply-To: <524861E8-2456-4FD7-B8B4-90B48F1AC815@nc.rr.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> <298c4d2a0609191607q60f7b804lf87c7c443025bd69@mail.gmail.com> <524861E8-2456-4FD7-B8B4-90B48F1AC815@nc.rr.com> Message-ID: <86C7EA9F-81AC-49B3-AFAE-E9F37276F811@nc.rr.com> Thanks to Nathaniel's tip at the last night's meeting, I can now get my Ruby tests to provide JUnit XML and HTML. :) http://www.jaredrichardson.net/blog/2006/09/20/#ruby-test-as-junit Here's the direct project link, but it didn't work out of the box for me, so you might want to read my blog posting if you download it before the issues are fixed. They're minor though and I've sent them to the author. http://test-report.rubyforge.org/ Jared http://jaredrichardson.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060920/6da8094b/attachment.html From ryan.daigle at gmail.com Wed Sep 20 19:46:03 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Wed, 20 Sep 2006 19:46:03 -0400 Subject: [raleigh.rb] Ruby and JUnit output In-Reply-To: <86C7EA9F-81AC-49B3-AFAE-E9F37276F811@nc.rr.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> <298c4d2a0609191607q60f7b804lf87c7c443025bd69@mail.gmail.com> <524861E8-2456-4FD7-B8B4-90B48F1AC815@nc.rr.com> <86C7EA9F-81AC-49B3-AFAE-E9F37276F811@nc.rr.com> Message-ID: <4511D2BB.1080000@gmail.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060920/6905393a/attachment.html From ryan.daigle at gmail.com Wed Sep 20 20:56:18 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Wed, 20 Sep 2006 20:56:18 -0400 Subject: [raleigh.rb] Hpricot questions, building php visualization/conversion tools. In-Reply-To: References: Message-ID: <4511E332.1040902@gmail.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060920/9aaf5a62/attachment.html From lists-jared at nc.rr.com Wed Sep 20 22:04:00 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Wed, 20 Sep 2006 22:04:00 -0400 Subject: [raleigh.rb] Ruby and JUnit output In-Reply-To: <4511D2BB.1080000@gmail.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> <298c4d2a0609191607q60f7b804lf87c7c443025bd69@mail.gmail.com> <524861E8-2456-4FD7-B8B4-90B48F1AC815@nc.rr.com> <86C7EA9F-81AC-49B3-AFAE-E9F37276F811@nc.rr.com> <4511D2BB.1080000@gmail.com> Message-ID: I still like the infrastructure, reporting, etc that you get with a product as mature as Cruise Control, but I think you're right... a "native" Ruby solution isn't far away. btw, Alex mailed me and says that all the issues I encountered are fixed in the Subversion trunk version. I'll try to verify that tomorrow. Jared http://jaredrichardson.net On Sep 20, 2006, at 7:46 PM, Ryan Daigle wrote: > nice pointer. > > I have tried in the past to get a reasonable continuous integration > service going, but as you said, the ruby tools aren't quite there > yet: http://ryandaigle.com/articles/2006/05/24/continuous- > integration-w-rails > > Jared Richardson wrote: >> Thanks to Nathaniel's tip at the last night's meeting, I can now >> get my Ruby tests to provide JUnit XML and HTML. :) >> >> http://www.jaredrichardson.net/blog/2006/09/20/#ruby-test-as-junit >> >> Here's the direct project link, but it didn't work out of the box >> for me, so you might want to read my blog posting if you download >> it before the issues are fixed. They're minor though and I've sent >> them to the author. >> >> http://test-report.rubyforge.org/ >> >> Jared >> http://jaredrichardson.net >> >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060920/7c90cca2/attachment-0001.html From lists-jared at nc.rr.com Fri Sep 22 09:19:49 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Fri, 22 Sep 2006 09:19:49 -0400 Subject: [raleigh.rb] Ruby Code Jam in Charlottesville, VA In-Reply-To: References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> <298c4d2a0609191607q60f7b804lf87c7c443025bd69@mail.gmail.com> <524861E8-2456-4FD7-B8B4-90B48F1AC815@nc.rr.com> <86C7EA9F-81AC-49B3-AFAE-E9F37276F811@nc.rr.com> <4511D2BB.1080000@gmail.com> Message-ID: <23EC3049-40DA-4B84-8378-534B2B06BC84@nc.rr.com> I work with Nick Laiacona and he told me about a meeting he's hosting. I'll be out of town that weekend, but if anyone wants to attend, you'd be welcome. http://www.rubycodejam.com/ From an IM chat: "Nick: We built a bunch of projects, they are up on rubyforge... it is in an executive meeting space up above a coffee house.. nice chairs lots of light, internet, projection screen Jared: Is it just to do open source work or anything? Nick: anything really. we put a bunch of project ideas up on the whiteboard and people formed teams around the ideas that interested them" jared http://jaredrichardson.net -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060922/f44eef3e/attachment.html From ryan.daigle at gmail.com Fri Sep 22 14:03:58 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Fri, 22 Sep 2006 14:03:58 -0400 Subject: [raleigh.rb] Ruby Code Jam in Charlottesville, VA In-Reply-To: <23EC3049-40DA-4B84-8378-534B2B06BC84@nc.rr.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> <298c4d2a0609191607q60f7b804lf87c7c443025bd69@mail.gmail.com> <524861E8-2456-4FD7-B8B4-90B48F1AC815@nc.rr.com> <86C7EA9F-81AC-49B3-AFAE-E9F37276F811@nc.rr.com> <4511D2BB.1080000@gmail.com> <23EC3049-40DA-4B84-8378-534B2B06BC84@nc.rr.com> Message-ID: <23591180-A095-4F47-84E1-371A1FF57147@gmail.com> Just to be clear this is not in Raleigh...yeah? On Sep 22, 2006, at 9:19 AM, Jared Richardson wrote: I work with Nick Laiacona and he told me about a meeting he's hosting. I'll be out of town that weekend, but if anyone wants to attend, you'd be welcome. http://www.rubycodejam.com/ From an IM chat: "Nick: We built a bunch of projects, they are up on rubyforge... it is in an executive meeting space up above a coffee house.. nice chairs lots of light, internet, projection screen Jared: Is it just to do open source work or anything? Nick: anything really. we put a bunch of project ideas up on the whiteboard and people formed teams around the ideas that interested them" jared http://jaredrichardson.net _______________________________________________ raleigh-rb-members mailing list raleigh-rb-members at rubyforge.org http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060922/6d17588f/attachment.html From rick.denatale at gmail.com Fri Sep 22 14:31:26 2006 From: rick.denatale at gmail.com (Rick DeNatale) Date: Fri, 22 Sep 2006 14:31:26 -0400 Subject: [raleigh.rb] Hpricot questions, building php visualization/conversion tools. In-Reply-To: <4511E332.1040902@gmail.com> References: <4511E332.1040902@gmail.com> Message-ID: On 9/20/06, Ryan Daigle wrote: > > To better understand the issue at hand can you give a couple of lines as to > why you want to build a graph of cross referenced html and code? It seems > that just knowing what files use other files and what links where doesn't > really give you much meat (I realize I am, in effect, questioning the very > concept of rela.tv, but I digress). Maybe my question is how are you going > to use the data ultimately collected? I'm really just trying to build a tool for visualizing the relationships in what's a pretty large wad of code. What I have in mind is building a kind of classical cross-reference, what files have links to what other files, what files hit what tables and columns in the database, things like that. I'm thinking that I'd acually build a simple database using ActiveRecord to hold the info, and use a rails app to visualize it. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From lists-jared at nc.rr.com Fri Sep 22 17:00:56 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Fri, 22 Sep 2006 17:00:56 -0400 Subject: [raleigh.rb] Ruby Code Jam in Charlottesville, VA In-Reply-To: <23591180-A095-4F47-84E1-371A1FF57147@gmail.com> References: <298c4d2a0609160910w6008dd94v72909928bff71f3c@mail.gmail.com> <298c4d2a0609180714m5dc5d68el369285dadd668f04@mail.gmail.com> <916A7F7A-2BDB-48CA-8539-FB96588FACDF@nc.rr.com> <298c4d2a0609181110l722b856egf57fe977c522fe70@mail.gmail.com> <298c4d2a0609191607q60f7b804lf87c7c443025bd69@mail.gmail.com> <524861E8-2456-4FD7-B8B4-90B48F1AC815@nc.rr.com> <86C7EA9F-81AC-49B3-AFAE-E9F37276F811@nc.rr.com> <4511D2BB.1080000@gmail.com> <23EC3049-40DA-4B84-8378-534B2B06BC84@nc.rr.com> <23591180-A095-4F47-84E1-371A1FF57147@gmail.com> Message-ID: <57369431-AB60-44F1-90B7-62258C810468@nc.rr.com> Sorry! That is an important detail. :) The meeting is in Charlottesville, Virginia. Jared http://jaredrichardson.net On Sep 22, 2006, at 2:03 PM, Ryan Daigle wrote: > Just to be clear this is not in Raleigh...yeah? > > > On Sep 22, 2006, at 9:19 AM, Jared Richardson wrote: > > I work with Nick Laiacona and he told me about a meeting he's > hosting. I'll be out of town that weekend, but if anyone wants to > attend, you'd be welcome. > > http://www.rubycodejam.com/ > > From an IM chat: > > "Nick: We built a bunch of projects, they are up on rubyforge... it > is in an executive meeting space up above a coffee house.. nice > chairs lots of light, internet, projection screen > > Jared: Is it just to do open source work or anything? > > Nick: anything really. we put a bunch of project ideas up on the > whiteboard and people formed teams around the ideas that interested > them" > > > jared > http://jaredrichardson.net > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060922/e5932770/attachment.html From ryan.daigle at gmail.com Sat Sep 23 09:52:46 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Sat, 23 Sep 2006 09:52:46 -0400 Subject: [raleigh.rb] Hpricot questions, building php visualization/conversion tools. In-Reply-To: References: <4511E332.1040902@gmail.com> Message-ID: <25AA97D1-96AC-4302-A0FE-6EE6CA47C93E@gmail.com> So the issue is that hpricot doesn't know what to do with the php sections of the source files, yeah? Can you pop out of hpricot on those elements and manually look for the "includes" or whatever else it is that denotes a 'use' of another file? On Sep 22, 2006, at 2:31 PM, Rick DeNatale wrote: On 9/20/06, Ryan Daigle wrote: > > To better understand the issue at hand can you give a couple of > lines as to > why you want to build a graph of cross referenced html and code? > It seems > that just knowing what files use other files and what links where > doesn't > really give you much meat (I realize I am, in effect, questioning > the very > concept of rela.tv, but I digress). Maybe my question is how are > you going > to use the data ultimately collected? I'm really just trying to build a tool for visualizing the relationships in what's a pretty large wad of code. What I have in mind is building a kind of classical cross-reference, what files have links to what other files, what files hit what tables and columns in the database, things like that. I'm thinking that I'd acually build a simple database using ActiveRecord to hold the info, and use a rails app to visualize it. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ _______________________________________________ raleigh-rb-members mailing list raleigh-rb-members at rubyforge.org http://rubyforge.org/mailman/listinfo/raleigh-rb-members From rick.denatale at gmail.com Sun Sep 24 09:29:47 2006 From: rick.denatale at gmail.com (Rick DeNatale) Date: Sun, 24 Sep 2006 09:29:47 -0400 Subject: [raleigh.rb] Hpricot questions, building php visualization/conversion tools. In-Reply-To: <25AA97D1-96AC-4302-A0FE-6EE6CA47C93E@gmail.com> References: <4511E332.1040902@gmail.com> <25AA97D1-96AC-4302-A0FE-6EE6CA47C93E@gmail.com> Message-ID: On 9/23/06, Ryan Daigle wrote: > So the issue is that hpricot doesn't know what to do with the php > sections of the source files, yeah? Can you pop out of hpricot on > those elements and manually look for the "includes" or whatever else > it is that denotes a 'use' of another file? > Yes. My main stumbling block, is that I haven't really turned up much in the way of documentation on Hpricot. The gem doesn't have doc. Mostly I've just found the examples on Why's site. Any advice on where to find doc, besides the source code? IIRC, you talked about using Hpricot much like Sax, and listening to parse events, rather than traversing the DOM. Is that right, or did Iconfuse what you said with something else? -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From devpotato at gmail.com Sun Sep 24 15:36:12 2006 From: devpotato at gmail.com (Kevin Smith) Date: Sun, 24 Sep 2006 15:36:12 -0400 Subject: [raleigh.rb] RubyConf anyone? Message-ID: <3560cf6d0609241236p4745e811id7a0cabd7f24fc86@mail.gmail.com> I just finalized my travel plans for RubyConf and was wondering if anyone else from the area is planning on going. --Kevin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060924/47506c33/attachment.html From ryan.daigle at gmail.com Sun Sep 24 16:25:32 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Sun, 24 Sep 2006 16:25:32 -0400 Subject: [raleigh.rb] Hpricot questions, building php visualization/conversion tools. In-Reply-To: References: <4511E332.1040902@gmail.com> <25AA97D1-96AC-4302-A0FE-6EE6CA47C93E@gmail.com> Message-ID: Rick, I think you got the wrong guy as far as IRC goes. Hpricot uses more of a XPath/CSS selector way of accessing the DOM. From my casual looking their docs seems standard for such a library: http:// code.whytheluckystiff.net/hpricot/wiki/HpricotBasics. -Ryan On Sep 24, 2006, at 9:29 AM, Rick DeNatale wrote: On 9/23/06, Ryan Daigle wrote: > So the issue is that hpricot doesn't know what to do with the php > sections of the source files, yeah? Can you pop out of hpricot on > those elements and manually look for the "includes" or whatever else > it is that denotes a 'use' of another file? > Yes. My main stumbling block, is that I haven't really turned up much in the way of documentation on Hpricot. The gem doesn't have doc. Mostly I've just found the examples on Why's site. Any advice on where to find doc, besides the source code? IIRC, you talked about using Hpricot much like Sax, and listening to parse events, rather than traversing the DOM. Is that right, or did Iconfuse what you said with something else? -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ _______________________________________________ raleigh-rb-members mailing list raleigh-rb-members at rubyforge.org http://rubyforge.org/mailman/listinfo/raleigh-rb-members From pelargir at gmail.com Sun Sep 24 19:54:08 2006 From: pelargir at gmail.com (Matthew) Date: Sun, 24 Sep 2006 19:54:08 -0400 Subject: [raleigh.rb] RubyConf anyone? In-Reply-To: <3560cf6d0609241236p4745e811id7a0cabd7f24fc86@mail.gmail.com> References: <3560cf6d0609241236p4745e811id7a0cabd7f24fc86@mail.gmail.com> Message-ID: I'll be going. Does anyone need a roommate? Matthew On 9/24/06, Kevin Smith wrote: > > I just finalized my travel plans for RubyConf and was wondering if anyone > else from the area is planning on going. > > --Kevin > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060924/006443af/attachment.html From adam at thewilliams.ws Sun Sep 24 21:03:21 2006 From: adam at thewilliams.ws (Adam Williams) Date: Sun, 24 Sep 2006 21:03:21 -0400 Subject: [raleigh.rb] RubyConf anyone? In-Reply-To: <3560cf6d0609241236p4745e811id7a0cabd7f24fc86@mail.gmail.com> References: <3560cf6d0609241236p4745e811id7a0cabd7f24fc86@mail.gmail.com> Message-ID: I plan to be there. aiwilliams On Sep 24, 2006, at 3:36 PM, Kevin Smith wrote: > I just finalized my travel plans for RubyConf and was wondering if > anyone else from the area is planning on going. > > --Kevin > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From nathaniel at talbott.ws Mon Sep 25 16:58:29 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Mon, 25 Sep 2006 16:58:29 -0400 Subject: [raleigh.rb] RubyConf anyone? In-Reply-To: <3560cf6d0609241236p4745e811id7a0cabd7f24fc86@mail.gmail.com> References: <3560cf6d0609241236p4745e811id7a0cabd7f24fc86@mail.gmail.com> Message-ID: <6788BFD9-BCFB-4B09-ADD1-8FECA0FF82A0@talbott.ws> On Sep 24, 2006, at 15:36 , Kevin Smith wrote: > I just finalized my travel plans for RubyConf and was wondering if > anyone else from the area is planning on going. I'll be there... can't wait! -- Nathaniel Talbott <:((>< From rick.denatale at gmail.com Mon Sep 25 17:34:41 2006 From: rick.denatale at gmail.com (Rick DeNatale) Date: Mon, 25 Sep 2006 17:34:41 -0400 Subject: [raleigh.rb] SVN setup question Message-ID: Not REALLY ruby related, but since ruby and svn often seem to go hand in hand: I'm trying set up so that I can access svn repositories using svn+ssh Plain old svn works: rick at bill:~$ svn co svn://frodo/repository/depot depot svn: /usr/local/svn/repository/depot/conf/svnserve.conf:12: Option expected rick at bill:~$ svn co svn://frodo/repository/depot depot A depot/test ... lots of files snipped ... A depot/public/favicon.ico Checked out revision 1. But svn+ssh doesn't: rick at bill:~$ rm -rf depot/ rick at bill:~$ svn co svn+ssh://frodo/repository/depot depot svn: No repository found in 'svn+ssh://frodo/repository/depot' I can ssh from bill to frodo. The how-tos I've run across imply that there's no additional setup for svn+ssh access, but it doesn't seem to be working for me. Any ideas? And yes, my test project is the depot app from Agile Web Development using Rails. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From ryan.daigle at gmail.com Mon Sep 25 19:46:10 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Mon, 25 Sep 2006 19:46:10 -0400 Subject: [raleigh.rb] SVN setup question In-Reply-To: References: Message-ID: I know in the past when I've used svn+ssh I've had to use the full path to the repository in the url (unless I set up an alias), i.e.: svn+ssh://frodo/var/repository/depot if the repo lived at /var/repository/depot -Ryan On Sep 25, 2006, at 5:34 PM, Rick DeNatale wrote: Not REALLY ruby related, but since ruby and svn often seem to go hand in hand: I'm trying set up so that I can access svn repositories using svn+ssh Plain old svn works: rick at bill:~$ svn co svn://frodo/repository/depot depot svn: /usr/local/svn/repository/depot/conf/svnserve.conf:12: Option expected rick at bill:~$ svn co svn://frodo/repository/depot depot A depot/test ... lots of files snipped ... A depot/public/favicon.ico Checked out revision 1. But svn+ssh doesn't: rick at bill:~$ rm -rf depot/ rick at bill:~$ svn co svn+ssh://frodo/repository/depot depot svn: No repository found in 'svn+ssh://frodo/repository/depot' I can ssh from bill to frodo. The how-tos I've run across imply that there's no additional setup for svn+ssh access, but it doesn't seem to be working for me. Any ideas? And yes, my test project is the depot app from Agile Web Development using Rails. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ _______________________________________________ raleigh-rb-members mailing list raleigh-rb-members at rubyforge.org http://rubyforge.org/mailman/listinfo/raleigh-rb-members From kevin.olbrich at gmail.com Mon Sep 25 20:20:34 2006 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Mon, 25 Sep 2006 20:20:34 -0400 Subject: [raleigh.rb] SVN setup question In-Reply-To: References: Message-ID: Take a look at these tutorials You might be able to patch something usable togther from them. http://forums.site5.com/showthread.php?t=11008 http://forums.site5.com/showthread.php?t=11009 http://forums.site5.com/showthread.php?t=7348&highlight=svn Who is your hosting provider, and do they support svn+ssh? You may need to startup svnserve in tunnel mode. _Kevin On 9/25/06, Rick DeNatale wrote: > Not REALLY ruby related, but since ruby and svn often seem to go hand in hand: > > I'm trying set up so that I can access svn repositories using svn+ssh > > Plain old svn works: > rick at bill:~$ svn co svn://frodo/repository/depot depot > svn: /usr/local/svn/repository/depot/conf/svnserve.conf:12: Option expected > rick at bill:~$ svn co svn://frodo/repository/depot depot > A depot/test > ... lots of files snipped ... > A depot/public/favicon.ico > Checked out revision 1. > > But svn+ssh doesn't: > > rick at bill:~$ rm -rf depot/ > rick at bill:~$ svn co svn+ssh://frodo/repository/depot depot > svn: No repository found in 'svn+ssh://frodo/repository/depot' > > I can ssh from bill to frodo. > > The how-tos I've run across imply that there's no additional setup for > svn+ssh access, but it doesn't seem to be working for me. > > Any ideas? > > And yes, my test project is the depot app from Agile Web Development > using Rails. > > > -- > Rick DeNatale > > My blog on Ruby > http://talklikeaduck.denhaven2.com/ > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Kevin Olbrich kevin.olbrich at gmail.com CONFIDENTIAL Unless otherwise indicated or obvious from the nature of the following communication, the information contained herein is a privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. It the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies, electronic, paper, or otherwise, which you may have of this communication. From fatcatt316 at yahoo.com Mon Sep 25 23:11:32 2006 From: fatcatt316 at yahoo.com (Joe Peck) Date: Mon, 25 Sep 2006 20:11:32 -0700 (PDT) Subject: [raleigh.rb] getting Ruby On Rails to work with GoDaddy Hosting Message-ID: <20060926031132.61098.qmail@web61219.mail.yahoo.com> Hi everybody, I've been trying to get RoR to work on my website (hosted by GoDaddy), but to no avail. I called them up today, and the guy eventually admitted he didn't know what to do, except that I should check the "htaccess" file and also to change its configurations maybe. Has anyone had experience setting up RoR for GoDaddy? Even if not, are there any common mistakes when setting up RoR on a non-local host? Joe --------------------------------- How low will we go? Check out Yahoo! Messenger?s low PC-to-Phone call rates. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060925/fb0f2e72/attachment.html From nathaniel at talbott.ws Tue Sep 26 08:38:34 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Tue, 26 Sep 2006 08:38:34 -0400 Subject: [raleigh.rb] getting Ruby On Rails to work with GoDaddy Hosting In-Reply-To: <20060926031132.61098.qmail@web61219.mail.yahoo.com> References: <20060926031132.61098.qmail@web61219.mail.yahoo.com> Message-ID: <45647AB7-FDC0-41A7-9F27-9DB5BF03CACA@talbott.ws> On Sep 25, 2006, at 23:11 , Joe Peck wrote: > I've been trying to get RoR to work on my website (hosted by > GoDaddy), but to no avail. I called them up today, and the guy > eventually admitted he didn't know what to do, except that I should > check the "htaccess" file and also to change its configurations maybe. > > Has anyone had experience setting up RoR for GoDaddy? Even if not, > are there any common mistakes when setting up RoR on a non-local host? I haven't set things up on GoDaddy, but I do have some experience setting up RoR on shared hosts. What exactly is breaking? Are you getting an error message, either in production.log, fastcgi.crash.log, or Apache's error.log? -- Nathaniel Talbott <:((>< From rick.denatale at gmail.com Tue Sep 26 12:14:32 2006 From: rick.denatale at gmail.com (Rick DeNatale) Date: Tue, 26 Sep 2006 12:14:32 -0400 Subject: [raleigh.rb] SVN setup question In-Reply-To: References: Message-ID: On 9/25/06, Ryan Daigle wrote: > I know in the past when I've used svn+ssh I've had to use the full > path to the repository in the url (unless I set up an alias), i.e.: > > svn+ssh://frodo/var/repository/depot > > if the repo lived at /var/repository/depot Thanks Ryan. That's the problem. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From rick.denatale at gmail.com Tue Sep 26 12:36:46 2006 From: rick.denatale at gmail.com (Rick DeNatale) Date: Tue, 26 Sep 2006 12:36:46 -0400 Subject: [raleigh.rb] SVN setup question In-Reply-To: References: Message-ID: On 9/25/06, Kevin Olbrich wrote: > Take a look at these tutorials > You might be able to patch something usable togther from them. > > http://forums.site5.com/showthread.php?t=11008 > http://forums.site5.com/showthread.php?t=11009 > http://forums.site5.com/showthread.php?t=7348&highlight=svn Thanks, although those all seem to be windoze centric using Putty. > Who is your hosting provider, and do they support svn+ssh? I'm my own hosting provider, this is running on one of my Linux servers. Ryan's suggestion that svn+ssh needs to use a full path to the repository was the key. I also worked this out with help from TriLUG. I'd LIKE to combine svnserve's capability to effectively change the root of the repository structure so that instead of svn+ssh://usr/local/svn/repository/project I could use: svn+ssh://repository/project I want to use svn+ssh both for authentication (I've already got ssh set up to require authentication via keys), and to encrypt the traffic, should I be doing this from outside my lan. > You may need to startup svnserve in tunnel mode. The svnserve documentation for tunnel mode confuses me. It says that i "this mode assumes that a remote-service program such as RSH or SSH has successfully authenticated a user and is now invoking a private svnserve process as that user. " I've got no idea what that means from the client side of things, how do you configure the svn client programs to connect to svnserve through a tunnel? -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From ryan.daigle at gmail.com Tue Sep 26 15:08:40 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Tue, 26 Sep 2006 15:08:40 -0400 Subject: [raleigh.rb] SVN setup question In-Reply-To: References: Message-ID: Cool. It's usually something small like that that nobody every feels the need to specify... On Sep 26, 2006, at 12:14 PM, Rick DeNatale wrote: On 9/25/06, Ryan Daigle wrote: > I know in the past when I've used svn+ssh I've had to use the full > path to the repository in the url (unless I set up an alias), i.e.: > > svn+ssh://frodo/var/repository/depot > > if the repo lived at /var/repository/depot Thanks Ryan. That's the problem. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ _______________________________________________ raleigh-rb-members mailing list raleigh-rb-members at rubyforge.org http://rubyforge.org/mailman/listinfo/raleigh-rb-members From lists-jared at nc.rr.com Tue Sep 26 16:30:03 2006 From: lists-jared at nc.rr.com (Jared Richardson) Date: Tue, 26 Sep 2006 16:30:03 -0400 Subject: [raleigh.rb] SVN setup question References: Message-ID: <000401c6e1ac$4a0d54d0$6402a8c0@Kristel> You're hosting? Have you thought about using Apache instead and using https ? I set that up last month on an OS X box and I found tons of docs. Jared http://jaredrichardson.net ----- Original Message ----- From: "Rick DeNatale" To: "The mailing list of raleigh.rb" Sent: Tuesday, September 26, 2006 12:36 PM Subject: Re: [raleigh.rb] SVN setup question > On 9/25/06, Kevin Olbrich wrote: >> Take a look at these tutorials >> You might be able to patch something usable togther from them. >> >> http://forums.site5.com/showthread.php?t=11008 >> http://forums.site5.com/showthread.php?t=11009 >> http://forums.site5.com/showthread.php?t=7348&highlight=svn > > Thanks, although those all seem to be windoze centric using Putty. > > >> Who is your hosting provider, and do they support svn+ssh? > > I'm my own hosting provider, this is running on one of my Linux servers. > > Ryan's suggestion that svn+ssh needs to use a full path to the > repository was the key. I also worked this out with help from TriLUG. > > I'd LIKE to combine svnserve's capability to effectively change the > root of the repository structure so that instead of > > svn+ssh://usr/local/svn/repository/project > > I could use: > svn+ssh://repository/project > > I want to use svn+ssh both for authentication (I've already got ssh > set up to require authentication via keys), and to encrypt the > traffic, should I be doing this from outside my lan. > >> You may need to startup svnserve in tunnel mode. > > The svnserve documentation for tunnel mode confuses me. It says that i > "this mode assumes that a remote-service program such as RSH or SSH > has successfully authenticated a user and is now invoking a private > svnserve process as that user. " > > I've got no idea what that means from the client side of things, how > do you configure the svn client programs to connect to svnserve > through a tunnel? > > -- > Rick DeNatale > > My blog on Ruby > http://talklikeaduck.denhaven2.com/ > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > From mark.bennett.mail at gmail.com Wed Sep 27 22:40:17 2006 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Wed, 27 Sep 2006 22:40:17 -0400 Subject: [raleigh.rb] favorite plugins Message-ID: What are some of the plugins that you all find most useful? acts_as_taggable, ...? Thanks! Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060927/43ce498a/attachment.html From kevin.olbrich at gmail.com Thu Sep 28 00:00:51 2006 From: kevin.olbrich at gmail.com (Kevin Olbrich) Date: Thu, 28 Sep 2006 00:00:51 -0400 Subject: [raleigh.rb] favorite plugins In-Reply-To: References: Message-ID: I use the KRJS plugin quite a lot. In fact, I've been working with the author to make it better. _Kevin On 9/27/06, Mark Bennett wrote: > > What are some of the plugins that you all find most useful? > acts_as_taggable, ...? > > Thanks! > > Mark > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -- Kevin Olbrich kevin.olbrich at gmail.com CONFIDENTIAL Unless otherwise indicated or obvious from the nature of the following communication, the information contained herein is a privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. It the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies, electronic, paper, or otherwise, which you may have of this communication. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060928/a4d757a5/attachment.html From ryan.daigle at gmail.com Thu Sep 28 07:49:24 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Thu, 28 Sep 2006 07:49:24 -0400 Subject: [raleigh.rb] favorite plugins In-Reply-To: References: Message-ID: I usually always use acts_as_authenticated, though it takes some tweaking to get it how I like it.. Ryan Daigle Lead Engineer, RTP Region ALTERthought rdaigle at alterthought.com O: (919) 424-4413 M: (919) 260-7179 On Sep 28, 2006, at 12:00 AM, Kevin Olbrich wrote: I use the KRJS plugin quite a lot. In fact, I've been working with the author to make it better. _Kevin On 9/27/06, Mark Bennett < mark.bennett.mail at gmail.com> wrote: What are some of the plugins that you all find most useful? acts_as_taggable, ...? Thanks! Mark _______________________________________________ raleigh-rb-members mailing list raleigh-rb-members at rubyforge.org http://rubyforge.org/mailman/listinfo/raleigh-rb-members -- Kevin Olbrich kevin.olbrich at gmail.com CONFIDENTIAL Unless otherwise indicated or obvious from the nature of the following communication, the information contained herein is a privileged and confidential information/work product. The communication is intended for the use of the individual or entity named above. It the reader of this transmission is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error or are not sure whether it is privileged, please immediately notify us by return e-mail and destroy any copies, electronic, paper, or otherwise, which you may have of this communication. _______________________________________________ raleigh-rb-members mailing list raleigh-rb-members at rubyforge.org http://rubyforge.org/mailman/listinfo/raleigh-rb-members -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060928/604d12e0/attachment.html From tj at stank.us Thu Sep 28 08:07:36 2006 From: tj at stank.us (TJ Stankus) Date: Thu, 28 Sep 2006 08:07:36 -0400 Subject: [raleigh.rb] favorite plugins In-Reply-To: References: Message-ID: file column On 9/28/06, Kevin Olbrich wrote: > I use the KRJS plugin quite a lot. In fact, I've been working with the > author to make it better. > > _Kevin > > > On 9/27/06, Mark Bennett < mark.bennett.mail at gmail.com> wrote: > > > > What are some of the plugins that you all find most useful? > acts_as_taggable, ...? > > > > Thanks! > > > > Mark > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > > -- > Kevin Olbrich > kevin.olbrich at gmail.com > > CONFIDENTIAL > Unless otherwise indicated or obvious from the nature of the following > communication, the information contained herein is a privileged and > confidential information/work product. The communication is intended for the > use of the individual or entity named above. It the reader of this > transmission is not the intended recipient, you are hereby notified that any > dissemination, distribution, or copying of this communication is strictly > prohibited. If you have received this communication in error or are not sure > whether it is privileged, please immediately notify us by return e-mail and > destroy any copies, electronic, paper, or otherwise, which you may have of > this communication. > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > From charlesmbowman at gmail.com Thu Sep 28 08:58:11 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Thu, 28 Sep 2006 08:58:11 -0400 Subject: [raleigh.rb] favorite plugins In-Reply-To: References: Message-ID: <298c4d2a0609280558q2857d07cq38ddbf9ec601ed9a@mail.gmail.com> I know I'm biased but I use broomstick on every app I make. I've also just began using acts_as_votable. It works quite well On 9/28/06, TJ Stankus wrote: > > file column > > On 9/28/06, Kevin Olbrich wrote: > > I use the KRJS plugin quite a lot. In fact, I've been working with the > > author to make it better. > > > > _Kevin > > > > > > On 9/27/06, Mark Bennett < mark.bennett.mail at gmail.com> wrote: > > > > > > What are some of the plugins that you all find most useful? > > acts_as_taggable, ...? > > > > > > Thanks! > > > > > > Mark > > > > > > _______________________________________________ > > > raleigh-rb-members mailing list > > > raleigh-rb-members at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > > > > > > > > -- > > Kevin Olbrich > > kevin.olbrich at gmail.com > > > > CONFIDENTIAL > > Unless otherwise indicated or obvious from the nature of the following > > communication, the information contained herein is a privileged and > > confidential information/work product. The communication is intended for > the > > use of the individual or entity named above. It the reader of this > > transmission is not the intended recipient, you are hereby notified that > any > > dissemination, distribution, or copying of this communication is > strictly > > prohibited. If you have received this communication in error or are not > sure > > whether it is privileged, please immediately notify us by return e-mail > and > > destroy any copies, electronic, paper, or otherwise, which you may have > of > > this communication. > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060928/5debb644/attachment.html From mark.bennett.mail at gmail.com Thu Sep 28 09:13:44 2006 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Thu, 28 Sep 2006 09:13:44 -0400 Subject: [raleigh.rb] favorite plugins In-Reply-To: References: Message-ID: Cool, thanks for all the replies! Mark On 9/28/06, TJ Stankus wrote: > > file column > > On 9/28/06, Kevin Olbrich wrote: > > I use the KRJS plugin quite a lot. In fact, I've been working with the > > author to make it better. > > > > _Kevin > > > > > > On 9/27/06, Mark Bennett < mark.bennett.mail at gmail.com> wrote: > > > > > > What are some of the plugins that you all find most useful? > > acts_as_taggable, ...? > > > > > > Thanks! > > > > > > Mark > > > > > > _______________________________________________ > > > raleigh-rb-members mailing list > > > raleigh-rb-members at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > > > > > > > > -- > > Kevin Olbrich > > kevin.olbrich at gmail.com > > > > CONFIDENTIAL > > Unless otherwise indicated or obvious from the nature of the following > > communication, the information contained herein is a privileged and > > confidential information/work product. The communication is intended for > the > > use of the individual or entity named above. It the reader of this > > transmission is not the intended recipient, you are hereby notified that > any > > dissemination, distribution, or copying of this communication is > strictly > > prohibited. If you have received this communication in error or are not > sure > > whether it is privileged, please immediately notify us by return e-mail > and > > destroy any copies, electronic, paper, or otherwise, which you may have > of > > this communication. > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060928/a163a56f/attachment.html From atomgiant at gmail.com Thu Sep 28 09:23:14 2006 From: atomgiant at gmail.com (Tom Davies) Date: Thu, 28 Sep 2006 09:23:14 -0400 Subject: [raleigh.rb] favorite plugins In-Reply-To: References: Message-ID: exception_notification - for emailing you application errors mini_magick - an image magick wrapper request_routing - for additional routing options (although I am really just adding a custom routing environment variable to it to route by username) Tom On 9/28/06, TJ Stankus wrote: > file column > > On 9/28/06, Kevin Olbrich wrote: > > I use the KRJS plugin quite a lot. In fact, I've been working with the > > author to make it better. > > > > _Kevin > > > > > > On 9/27/06, Mark Bennett < mark.bennett.mail at gmail.com> wrote: > > > > > > What are some of the plugins that you all find most useful? > > acts_as_taggable, ...? > > > > > > Thanks! > > > > > > Mark > > > > > > _______________________________________________ > > > raleigh-rb-members mailing list > > > raleigh-rb-members at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > > > > > > > > -- > > Kevin Olbrich > > kevin.olbrich at gmail.com > > > > CONFIDENTIAL > > Unless otherwise indicated or obvious from the nature of the following > > communication, the information contained herein is a privileged and > > confidential information/work product. The communication is intended for the > > use of the individual or entity named above. It the reader of this > > transmission is not the intended recipient, you are hereby notified that any > > dissemination, distribution, or copying of this communication is strictly > > prohibited. If you have received this communication in error or are not sure > > whether it is privileged, please immediately notify us by return e-mail and > > destroy any copies, electronic, paper, or otherwise, which you may have of > > this communication. > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Tom Davies http://atomgiant.com http://gifthat.com From geoff at geoffdavis.net Thu Sep 28 10:10:15 2006 From: geoff at geoffdavis.net (Geoff Davis) Date: Thu, 28 Sep 2006 10:10:15 -0400 Subject: [raleigh.rb] favorite plugins In-Reply-To: References: Message-ID: <1159452616.4021.20.camel@test> Interesting plugin. Does it make attempted AJAX calls on every single event? Or does a a list of available controller methods get sent? If you like KRJS, you might also like Unobtrusive Javascript (UJS) or Dan Webb's Low Pro javascript library. UJS: http://www.ujs4rails.com/ Low Pro: http://www.danwebb.net/2006/9/3/low-pro-unobtrusive-scripting- for-prototype On Thu, 2006-09-28 at 00:00 -0400, Kevin Olbrich wrote: > I use the KRJS plugin quite a lot. In fact, I've been working with > the author to make it better. > > _Kevin > > On 9/27/06, Mark Bennett wrote: > What are some of the plugins that you all find most useful? > acts_as_taggable, ...? > > Thanks! > > Mark > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > -- > Kevin Olbrich > kevin.olbrich at gmail.com > > CONFIDENTIAL > Unless otherwise indicated or obvious from the nature of the following > communication, the information contained herein is a privileged and > confidential information/work product. The communication is intended > for the use of the individual or entity named above. It the reader of > this transmission is not the intended recipient, you are hereby > notified that any dissemination, distribution, or copying of this > communication is strictly prohibited. If you have received this > communication in error or are not sure whether it is privileged, > please immediately notify us by return e-mail and destroy any copies, > electronic, paper, or otherwise, which you may have of this > communication. > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members From mark.bennett.mail at gmail.com Thu Sep 28 10:34:49 2006 From: mark.bennett.mail at gmail.com (Mark Bennett) Date: Thu, 28 Sep 2006 10:34:49 -0400 Subject: [raleigh.rb] favorite plugins In-Reply-To: <298c4d2a0609280558q2857d07cq38ddbf9ec601ed9a@mail.gmail.com> References: <298c4d2a0609280558q2857d07cq38ddbf9ec601ed9a@mail.gmail.com> Message-ID: Why the need to expire actions or controllers in every app? Mark On 9/28/06, Charlie Bowman wrote: > > I know I'm biased but I use broomstick on every app I make. I've also > just began using acts_as_votable. It works quite well > > On 9/28/06, TJ Stankus < tj at stank.us> wrote: > > > > file column > > > > On 9/28/06, Kevin Olbrich < kevin.olbrich at gmail.com> wrote: > > > I use the KRJS plugin quite a lot. In fact, I've been working with > > the > > > author to make it better. > > > > > > _Kevin > > > > > > > > > On 9/27/06, Mark Bennett < mark.bennett.mail at gmail.com> wrote: > > > > > > > > What are some of the plugins that you all find most useful? > > > acts_as_taggable, ...? > > > > > > > > Thanks! > > > > > > > > Mark > > > > > > > > _______________________________________________ > > > > raleigh-rb-members mailing list > > > > raleigh-rb-members at rubyforge.org > > > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > > > > > > > > > > > > > > -- > > > Kevin Olbrich > > > kevin.olbrich at gmail.com > > > > > > CONFIDENTIAL > > > Unless otherwise indicated or obvious from the nature of the following > > > > > communication, the information contained herein is a privileged and > > > confidential information/work product. The communication is intended > > for the > > > use of the individual or entity named above. It the reader of this > > > transmission is not the intended recipient, you are hereby notified > > that any > > > dissemination, distribution, or copying of this communication is > > strictly > > > prohibited. If you have received this communication in error or are > > not sure > > > whether it is privileged, please immediately notify us by return > > e-mail and > > > destroy any copies, electronic, paper, or otherwise, which you may > > have of > > > this communication. > > > _______________________________________________ > > > raleigh-rb-members mailing list > > > raleigh-rb-members at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > > > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060928/38920504/attachment-0001.html From ryan.daigle at gmail.com Thu Sep 28 10:51:20 2006 From: ryan.daigle at gmail.com (Ryan Daigle) Date: Thu, 28 Sep 2006 10:51:20 -0400 Subject: [raleigh.rb] favorite plugins In-Reply-To: References: Message-ID: <126B5D27-DD50-4AA5-AC8B-C474586D2EE8@gmail.com> I second exception_notification.. On Sep 28, 2006, at 9:23 AM, Tom Davies wrote: exception_notification - for emailing you application errors mini_magick - an image magick wrapper request_routing - for additional routing options (although I am really just adding a custom routing environment variable to it to route by username) Tom On 9/28/06, TJ Stankus wrote: > file column > > On 9/28/06, Kevin Olbrich wrote: >> I use the KRJS plugin quite a lot. In fact, I've been working >> with the >> author to make it better. >> >> _Kevin >> >> >> On 9/27/06, Mark Bennett < mark.bennett.mail at gmail.com> wrote: >>> >>> What are some of the plugins that you all find most useful? >> acts_as_taggable, ...? >>> >>> Thanks! >>> >>> Mark >>> >>> _______________________________________________ >>> raleigh-rb-members mailing list >>> raleigh-rb-members at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >>> >>> >> >> >> >> -- >> Kevin Olbrich >> kevin.olbrich at gmail.com >> >> CONFIDENTIAL >> Unless otherwise indicated or obvious from the nature of the >> following >> communication, the information contained herein is a privileged and >> confidential information/work product. The communication is >> intended for the >> use of the individual or entity named above. It the reader of this >> transmission is not the intended recipient, you are hereby >> notified that any >> dissemination, distribution, or copying of this communication is >> strictly >> prohibited. If you have received this communication in error or >> are not sure >> whether it is privileged, please immediately notify us by return e- >> mail and >> destroy any copies, electronic, paper, or otherwise, which you may >> have of >> this communication. >> _______________________________________________ >> raleigh-rb-members mailing list >> raleigh-rb-members at rubyforge.org >> http://rubyforge.org/mailman/listinfo/raleigh-rb-members >> >> > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -- Tom Davies http://atomgiant.com http://gifthat.com _______________________________________________ raleigh-rb-members mailing list raleigh-rb-members at rubyforge.org http://rubyforge.org/mailman/listinfo/raleigh-rb-members From charlesmbowman at gmail.com Thu Sep 28 13:07:04 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Thu, 28 Sep 2006 13:07:04 -0400 Subject: [raleigh.rb] favorite plugins In-Reply-To: References: <298c4d2a0609280558q2857d07cq38ddbf9ec601ed9a@mail.gmail.com> Message-ID: <298c4d2a0609281007r45b56aabr6ecbda49d18d1531@mail.gmail.com> On 9/28/06, Mark Bennett wrote: > > Why the need to expire actions or controllers in every app? > > > because I use page_caching at every possible chance -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060928/0b33bd8c/attachment.html From rick.denatale at gmail.com Fri Sep 29 13:14:30 2006 From: rick.denatale at gmail.com (Rick DeNatale) Date: Fri, 29 Sep 2006 13:14:30 -0400 Subject: [raleigh.rb] Stumbling block with DOM element replacement in Firefox AND Internet Explorer Message-ID: I'm working through the new edition of AWDWR. I'm working on the 'homework' at the end of the chapter on Ajax for the depot app, and I'm stuck. I've added code in the partial for cart_items which adds one or two buttons to each cart_item one to remove the whole item, and another to decrease the quantity of the item by one, if the item represents an order for multiple copies. I've got that all working for non-Ajax. After mucking around, and reading the new chapter on Web 2.0 by Justin, I'm still stuck. I figure that what I want to do is to generate a
containing the cart contents in a partial, and use code like: <%= form_remote_tag :url => {:action => :remove_all_from_cart, :id => cart_item.product }, :update => "cart-wrapper" %> <%= submit_tag "Remove#{" All" if cart_item.quantity > 1}" %> <%= end_form_tag %> In app/views/store/_cart_items.rhtml In my controller I have the action methods which affect the cart call a method: def render_cart @cart = find_cart if request.xhr? render :partial => 'cart' else redirect_to_index end end And app/views/store/_cart.rhtml in turn renders the _cart_items.rhtml The problem is that this is inserting the html being rendered inside the div tag with the id of cart-wrapper, instead of replacing it. Justin's chapter says that if :position isn't specified that "the entire innerHTML will be replaced by the server's response", but that doesn't seem to be what's happening. Okay, this just in. I'm using Firefox to test the java-script enabled behavior, and Konqueror with javascript disabled to make sure that I'm not breaking the javascript deprived. I just decided to enable javascript on Konqueror and this code seems to be working. I just tried it on Internet Exploder, and it doesn't work there. Now assuming that Mozilla and IE browers are at least as important as Konqueror, maybe even more important what's the right way to replace/delete an element using prototype? Where right is in the sense that it's portable. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/ From charlesmbowman at gmail.com Fri Sep 29 15:18:35 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Fri, 29 Sep 2006 15:18:35 -0400 Subject: [raleigh.rb] Stumbling block with DOM element replacement in Firefox AND Internet Explorer In-Reply-To: References: Message-ID: <298c4d2a0609291218u260e8344v5cb6e47fdcf93749@mail.gmail.com> I'm not at home, so here's a little sudo code. What I would to do is use rjs. rather than render :partial => 'cart'. you would use rjs like ( page.replace_html "cart-wrapper", :partial => 'cart' ) The above code would need to be in a rjs template. On 9/29/06, Rick DeNatale wrote: > > I'm working through the new edition of AWDWR. > > I'm working on the 'homework' at the end of the chapter on Ajax for > the depot app, and I'm stuck. > > I've added code in the partial for cart_items which adds one or two > buttons to each cart_item one to remove the whole item, and another to > decrease the quantity of the item by one, if the item represents an > order for multiple copies. > > I've got that all working for non-Ajax. > > After mucking around, and reading the new chapter on Web 2.0 by > Justin, I'm still stuck. I figure that what I want to do is to > generate a
containing the cart contents in a partial, and use > code like: > > <%= form_remote_tag :url => {:action => :remove_all_from_cart, > :id => cart_item.product > }, > :update => "cart-wrapper" > %> > <%= submit_tag "Remove#{" All" if > cart_item.quantity > 1}" %> > <%= end_form_tag %> > > In app/views/store/_cart_items.rhtml > > In my controller I have the action methods which affect the cart call a > method: > > def render_cart > @cart = find_cart > if request.xhr? > render :partial => 'cart' > else > redirect_to_index > end > end > > And app/views/store/_cart.rhtml in turn renders the _cart_items.rhtml > > The problem is that this is inserting the html being rendered inside > the div tag with the id of cart-wrapper, instead of replacing it. > Justin's chapter says that if :position isn't specified that "the > entire innerHTML will be replaced by the server's response", but that > doesn't seem to be what's happening. > > Okay, this just in. I'm using Firefox to test the java-script enabled > behavior, and Konqueror with javascript disabled to make sure that I'm > not breaking the javascript deprived. I just decided to enable > javascript on Konqueror and this code seems to be working. > > I just tried it on Internet Exploder, and it doesn't work there. > > Now assuming that Mozilla and IE browers are at least as important as > Konqueror, maybe even more important what's the right way to > replace/delete an element using prototype? Where right is in the sense > that it's portable. > > -- > Rick DeNatale > > My blog on Ruby > http://talklikeaduck.denhaven2.com/ > _______________________________________________ > raleigh-rb-members mailing list > raleigh-rb-members at rubyforge.org > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060929/5ec55e8e/attachment.html From charlesmbowman at gmail.com Fri Sep 29 15:59:29 2006 From: charlesmbowman at gmail.com (Charlie Bowman) Date: Fri, 29 Sep 2006 15:59:29 -0400 Subject: [raleigh.rb] Stumbling block with DOM element replacement in Firefox AND Internet Explorer In-Reply-To: <298c4d2a0609291218u260e8344v5cb6e47fdcf93749@mail.gmail.com> References: <298c4d2a0609291218u260e8344v5cb6e47fdcf93749@mail.gmail.com> Message-ID: <298c4d2a0609291259i348ecf6ak83c05db35ef6b1b2@mail.gmail.com> after reading your question again, I see my advice isn't going to work. you would also need to modify the form_remote tag in not include the update. On 9/29/06, Charlie Bowman wrote: > > I'm not at home, so here's a little sudo code. What I would to do is use > rjs. rather than render :partial => 'cart'. you would use rjs like ( > > page.replace_html "cart-wrapper", :partial => 'cart' > > > ) > > The above code would need to be in a rjs template. > > > On 9/29/06, Rick DeNatale < rick.denatale at gmail.com> wrote: > > > > I'm working through the new edition of AWDWR. > > > > I'm working on the 'homework' at the end of the chapter on Ajax for > > the depot app, and I'm stuck. > > > > I've added code in the partial for cart_items which adds one or two > > buttons to each cart_item one to remove the whole item, and another to > > decrease the quantity of the item by one, if the item represents an > > order for multiple copies. > > > > I've got that all working for non-Ajax. > > > > After mucking around, and reading the new chapter on Web 2.0 by > > Justin, I'm still stuck. I figure that what I want to do is to > > generate a
containing the cart contents in a partial, and use > > code like: > > > > <%= form_remote_tag :url => {:action => :remove_all_from_cart, > > :id => > > cart_item.product }, > > :update => > > "cart-wrapper" > > %> > > <%= submit_tag "Remove#{" All" if > > cart_item.quantity > 1}" %> > > <%= end_form_tag %> > > > > In app/views/store/_cart_items.rhtml > > > > In my controller I have the action methods which affect the cart call a > > method: > > > > def render_cart > > @cart = find_cart > > if request.xhr? > > render :partial => 'cart' > > else > > redirect_to_index > > end > > end > > > > And app/views/store/_cart.rhtml in turn renders the _cart_items.rhtml > > > > The problem is that this is inserting the html being rendered inside > > the div tag with the id of cart-wrapper, instead of replacing it. > > Justin's chapter says that if :position isn't specified that "the > > entire innerHTML will be replaced by the server's response", but that > > doesn't seem to be what's happening. > > > > Okay, this just in. I'm using Firefox to test the java-script enabled > > behavior, and Konqueror with javascript disabled to make sure that I'm > > not breaking the javascript deprived. I just decided to enable > > javascript on Konqueror and this code seems to be working. > > > > I just tried it on Internet Exploder, and it doesn't work there. > > > > Now assuming that Mozilla and IE browers are at least as important as > > Konqueror, maybe even more important what's the right way to > > replace/delete an element using prototype? Where right is in the sense > > that it's portable. > > > > -- > > Rick DeNatale > > > > My blog on Ruby > > http://talklikeaduck.denhaven2.com/ > > _______________________________________________ > > raleigh-rb-members mailing list > > raleigh-rb-members at rubyforge.org > > http://rubyforge.org/mailman/listinfo/raleigh-rb-members > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060929/0e1a1f53/attachment-0001.html From nospam at tonyspencer.com Fri Sep 29 17:43:35 2006 From: nospam at tonyspencer.com (Tony Spencer) Date: Fri, 29 Sep 2006 17:43:35 -0400 Subject: [raleigh.rb] Contract job opening for RoR developer in Raleigh In-Reply-To: Message-ID: Hi, I hope job openings are ok on this list. If not, I apologize. We have a opening for an experienced Ruby on Rails developer for a 1 to 2 month contract in our Raleigh office. You?ll be responsible for building a custom CMS for management and delivery of video content. The app will feature common social networking features such as tagging and a Digg.com style vote up/vote down. We are interested in looking at Radiant CMS for a code base that we extend. If that is not feasible we?ll build from scratch. The contract position requires working on site in our comfortable office featuring free coffee and a relaxed group of motivated geeks. You can choose to bring your own machine or we?ll provide you with one. We work on a variety of OS?s in our flexible environment and you can choose your flavor so long as you can commit changes to our subversion repository. If the contract goes well it may be extended. Please send your ruby on rails history, hourly rate, resume and references to : Tony Spencer tony **AT** notsleepy.com This contract is available for start beginning October 11th. Thanks! Tony NotSleepy Inc. is a young, fast paced, search engine optimization firm developing content management systems for small to large organizations. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/raleigh-rb-members/attachments/20060929/76b51841/attachment.html From nathaniel at talbott.ws Fri Sep 29 18:36:39 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Fri, 29 Sep 2006 18:36:39 -0400 Subject: [raleigh.rb] favorite plugins In-Reply-To: References: Message-ID: <5B48CFAC-D14F-430C-995E-499B7CE23ABA@talbott.ws> On Sep 27, 2006, at 22:40 , Mark Bennett wrote: > What are some of the plugins that you all find most useful? > acts_as_taggable, ...? http://estound.com/svn/rails/plugins/custom_validation_messages/ query_trace ;-) textmate_footnotes -- Nathaniel Talbott <:((>< From nathaniel at talbott.ws Fri Sep 29 18:54:06 2006 From: nathaniel at talbott.ws (Nathaniel Talbott) Date: Fri, 29 Sep 2006 18:54:06 -0400 Subject: [raleigh.rb] Contract job opening for RoR developer in Raleigh In-Reply-To: References: Message-ID: <03C49366-2F1B-4C65-B4CB-DF770D153E0D@talbott.ws> On Sep 29, 2006, at 17:43 , Tony Spencer wrote: > I hope job openings are ok on this list. If not, I apologize. Just FYI for everyone on the list, Ruby job postings are *encouraged* on the list, both "I'm available" and "I need help". So please don't hesitate to start your search here - one of the great benefits of having a thriving hobbyist community is that it can enable more of us to get paid to do what we love. End Public Service Announcement - we now return you to your regularly scheduled mailing list chatter :-) -- Nathaniel Talbott <:((>< From rick.denatale at gmail.com Sat Sep 30 10:03:07 2006 From: rick.denatale at gmail.com (Rick DeNatale) Date: Sat, 30 Sep 2006 10:03:07 -0400 Subject: [raleigh.rb] Stumbling block with DOM element replacement in Firefox AND Internet Explorer In-Reply-To: <298c4d2a0609291259i348ecf6ak83c05db35ef6b1b2@mail.gmail.com> References: <298c4d2a0609291218u260e8344v5cb6e47fdcf93749@mail.gmail.com> <298c4d2a0609291259i348ecf6ak83c05db35ef6b1b2@mail.gmail.com> Message-ID: On 9/29/06, Charlie Bowman wrote: > after reading your question again, I see my advice isn't going to work. you > would also need to modify the form_remote tag in not include the update. > > > On 9/29/06, Charlie Bowman < charlesmbowman at gmail.com > wrote: > > I'm not at home, so here's a little sudo code. What I would to do is use > rjs. rather than render :partial => 'cart'. you would use rjs like ( > > page.replace_html "cart-wrapper", :partial => 'cart' > > > > > > ) > > > > The above code would need to be in a rjs template. Thanks Charlie. I also had to change the render_cart method in my controller to render the rjs template. I've lost my 'yellow' fade effect when I add something to an already open cart, but I can probably figure out how to get that back. -- Rick DeNatale My blog on Ruby http://talklikeaduck.denhaven2.com/