|
Here's a script I created to add all new files to the repo. It's good for non-generated content like javascripts and stylesheets: #!/bin/sh svn add `svn status | grep "^\?.*" | sed "s/^\? *//"`
|
# ? Sep 30, 2007 15:35 |
|
|
# ? Apr 23, 2024 15:15 |
|
If you're working in textmate, you also have a bundle that lets you do most subversion commands easily. It's called by hitting ctrl+shift+a from inside a file window or by selecting a file or folder from the drawer. This makes it easy to add a new file then add it to subversion: fruit+shift+n => type name => ctrl+shift+a => 1.
|
# ? Sep 30, 2007 20:39 |
I am extremely slowly picking my way through deployment with Capistrano, and I've already hit a snag. The (really shittily sparse) manual tells you to create a Capfile for a project with `capify ~/project`. What I don't understand is, this creates a config/deploy.rb file in your project. But - Capistrano is supposed to be getting the latest project from Subversion. How come the deploy.rb is linked to a checkout of the pristine code? I'm sorry if I'm being difficult to understand - it just seems like there's a disconnect there. If you have a deployment system that's looking to checkout your code from source control and place it on a server, how come it's not completely removed from the code?
|
|
# ? Oct 2, 2007 02:39 |
|
shopvac4christ posted:I am extremely slowly picking my way through deployment with Capistrano, and I've already hit a snag. The (really shittily sparse) manual tells you to create a Capfile for a project with `capify ~/project`. What I don't understand is, this creates a config/deploy.rb file in your project. But - Capistrano is supposed to be getting the latest project from Subversion. How come the deploy.rb is linked to a checkout of the pristine code?
|
# ? Oct 2, 2007 07:10 |
Yossarian22 posted:You theoretically dont need to commit your deploy.rb file to your repo to get it to work. Cap deploy reads off your local copy so whatever is in your local deploy.rb file is what gets executed. Right. But what I'm asking is why is there a deploy.rb file at all? Why aren't the deployment instructions completely independent of whether or not there's a copy of the source code checked out?
|
|
# ? Oct 2, 2007 18:46 |
|
shopvac4christ posted:Right. But what I'm asking is why is there a deploy.rb file at all? Why aren't the deployment instructions completely independent of whether or not there's a copy of the source code checked out? The way Capistrano works is that it tunnels through SSH and executes a series of instructions on a remote machine. It needs to be run FROM somewhere, usually on a development machine that has a copy of the source locally. If it were a server process you could just notify it to deploy itself, sure. The deploy.rb is part of the instructions you're running that in turn execute remote SSH commands.
|
# ? Oct 2, 2007 19:04 |
Grob posted:The way Capistrano works is that it tunnels through SSH and executes a series of instructions on a remote machine. It needs to be run FROM somewhere, usually on a development machine that has a copy of the source locally. What I'm trying to say is, why can't we have something along the lines of a deployments directory, that has deploy.rb's and subdirectories for all the applications we can deploy, which is completely unrelated to any local checked out copies of the source? For example, code:
|
|
# ? Oct 2, 2007 19:10 |
|
I think the reasoning is that it allows all project files to fall under one folder. Your method spreads them out--whether that is better or not is probably up to individual opinions. I like having everything in one place. Anyone who checks out the project can make changes, commit to the repo, and deploy to the webserver all from one place. You could achieve what you want with some rake tasks, though.
|
# ? Oct 2, 2007 19:35 |
|
shopvac4christ posted:What I'm trying to say is, why can't we have something along the lines of a deployments directory, that has deploy.rb's and subdirectories for all the applications we can deploy, which is completely unrelated to any local checked out copies of the source?
|
# ? Oct 2, 2007 20:31 |
|
shopvac4christ posted:What I'm trying to say is, why can't we have something along the lines of a deployments directory, that has deploy.rb's and subdirectories for all the applications we can deploy, which is completely unrelated to any local checked out copies of the source? This is true and you don't technically need to follow the way capistrano does things. It would really help if you did, though, because cap is opinionated (but configurable) software. Given your example, I'm not sure I see the benefit in having ~/Deployments/MyApp1/deploy.rb vs ~/Apps/MyApp1/config/deploy.rb. You've traded having a deployments directory for having a directory with access to the source code. Also, you may want to have custom recipes which may be easier to remember why the functions do what they do if they're right there in the app. Also, since is the RoR love in thread, I just started a RoR news podcast. Shameless self promotion at http://www.railsenvy.com/podcast.
|
# ? Oct 3, 2007 07:40 |
|
I find my helpers are generally empty, with things like this going in my model:code:
|
# ? Oct 10, 2007 19:38 |
|
atastypie posted:I find my helpers are generally empty, with things like this going in my model: I tend to do the same thing.
|
# ? Oct 10, 2007 20:59 |
|
atastypie posted:I find my helpers are generally empty, with things like this going in my model: That's definitely content for the model, your helpers should be used moreso for html junk that you repeat over and over again that doesn't really fit into partials.
|
# ? Oct 10, 2007 21:04 |
|
I'm very suddenly having a very odd problem. I'm running instant rails on vista, and as of last night, I can't start up mySql because code:
|
# ? Oct 10, 2007 23:26 |
|
MrSaturn posted:I'm very suddenly having a very odd problem. I'm running instant rails on vista, and as of last night, I can't start up mySql because Mysql's port is 3306, Apache's is 80 (unless you changed the ports they listen on). You might have another web server running on port 80 or something, check that first.
|
# ? Oct 10, 2007 23:58 |
|
vg8000 posted:Mysql's port is 3306, Apache's is 80 (unless you changed the ports they listen on). You might have another web server running on port 80 or something, check that first. i.e. make sure IIS isn't stealing 80.
|
# ? Oct 11, 2007 00:45 |
|
IIS is definitely off. I just checked.
|
# ? Oct 11, 2007 04:30 |
|
Bumping this so that it can get some Caverns of Cobol loving
|
# ? Oct 25, 2007 05:05 |
|
I'm trying to write a test for a controller which handles AJAX requests and renders a partial in response. However, the locals I pass to the partial don't seem to be available to the test via the "assigns" hash. Is there any way to get at those?
|
# ? Oct 28, 2007 23:32 |
|
I have a feature which lets a user make a mailing list, then send a notice to everyone telling them to take an online student survey. The mailing list consists only of email addresses, so what I figured on doing is assigning a unique (and unguessable) string to each invitation, so that I can tell which email address responded. What's the best way to approach the string generation with Rails (using MySQL)? I'm assuming that I'll either be making some sort of sequence on the database, or I'll be keeping a counter, then salting and hashing it. Alternatively, is there a better way of tracking which students have responded short of requiring their own login?
|
# ? Oct 31, 2007 04:13 |
|
How about some sort of digest (md5 or sha2 or whatever) of their email address and some random salt you store with the address?
|
# ? Oct 31, 2007 06:57 |
|
Anal Wink posted:How about some sort of digest (md5 or sha2 or whatever) of their email address and some random salt you store with the address? That'll work too; I'll probably be using that until I find a better solution. Ultimately, though, I'm worried about collisions, so I'm trying to find a more elegant solution. I've found a module for Rails called usesguid, but it seems to only work on the primary key column, and based on the sample GUIDs, I think one could guess a GUID by incrementing a number or two.
|
# ? Oct 31, 2007 07:36 |
|
Argue posted:Ultimately, though, I'm worried about collisions, so I'm trying to find a more elegant solution. For md5/sha1 assuming no malicious input?
|
# ? Oct 31, 2007 20:23 |
I have a rake task that is supposed to download and extract a '.zip' file. I'm running system commands, so something likecode:
Someone I spoke to suggested a permissions error, but I doubt I would get this message if it were a permissions error: quote:End-of-central-directory signature not found. Either this file is not Of course, that last line is also bullshit, since that's exactly where the archive is.
|
|
# ? Nov 1, 2007 01:51 |
|
floWenoL posted:For md5/sha1 assuming no malicious input? I guess I'm being paranoid, but if the two of you are saying it's an acceptable solution, then I'll gladly stick with that; it's much easier to implement after all.
|
# ? Nov 1, 2007 07:22 |
|
Argue posted:I guess I'm being paranoid, but if the two of you are saying it's an acceptable solution, then I'll gladly stick with that; it's much easier to implement after all. That's what I use for a similar requirement. code:
|
# ? Nov 9, 2007 20:50 |
|
shopvac4christ posted:I have a rake task that is supposed to download and extract a '.zip' file. I'm running system commands, so something like Sounds more like you've got a space in your path name (or some other character that needs escaping). Wrap your paths in single-quotes.
|
# ? Nov 9, 2007 22:34 |
|
Trabisnikof posted:That's what I use for a similar requirement. If you're worried even in the slightest, just store a new random salt for each email address. That would prevent any sort of rainbow tables and isn't hard to do at all.
|
# ? Nov 10, 2007 05:16 |
|
Anal Wink posted:If you're worried even in the slightest, just store a new random salt for each email address. That would prevent any sort of rainbow tables and isn't hard to do at all. Actually, that is a good idea. Although, isn't that still weak to Rainbow Tables, just each hash requires a new lookup? I may not have my concept of Rainbow Tables right though.
|
# ? Nov 10, 2007 07:51 |
|
Trabisnikof posted:Actually, that is a good idea. Although, isn't that still weak to Rainbow Tables, just each hash requires a new lookup? I may not have my concept of Rainbow Tables right though. No, they would have to make a new rainbow table for each salt, which makes the whole reason to make a rainbow table worthless.
|
# ? Nov 10, 2007 08:48 |
|
I've been using my free time to code some RoR apps, and it's going fairly well. I have a dreamhost account that uses FastCGI to run the rails apps. When I deploy using Capistrano, there's a 10-15 second delay which is I'm assuming the FastCGI processes restarting because of the application change. However, if I check the deployed site after an hour or two of inactivity, I get the same delay. In both cases, the site runs snappy after the first hit to the webapp. Is there a way to force the FastCGI processes to stay running (assuming that this is the cause of the delay)?
|
# ? Nov 10, 2007 19:52 |
|
Hop Pocket posted:I've been using my free time to code some RoR apps, and it's going fairly well. I have a dreamhost account that uses FastCGI to run the rails apps. When I deploy using Capistrano, there's a 10-15 second delay which is I'm assuming the FastCGI processes restarting because of the application change. However, if I check the deployed site after an hour or two of inactivity, I get the same delay. That is the cause of the delay and the solution is a script that loads the site every X minutes. From the Dreamhost wiki: http://wiki.dreamhost.com/Ruby_on_Rails#Switching_to_FCGI_with_Dreamhost See the section "Preventing timeouts using curl and cron" freeb0rn fucked around with this message at 20:41 on Nov 10, 2007 |
# ? Nov 10, 2007 20:37 |
|
It seems Active Record will not save grandchildren and their parent at the same time, am I doing something wrong or is it something to do with my polymorphic association?code:
It's not really relevant but here is a pastie of my models if someone needs to see. http://pastie.caboo.se/116397
|
# ? Nov 11, 2007 00:54 |
|
Just throwing an idea out there, but have you tried manually adding save? code:
|
# ? Nov 11, 2007 01:00 |
|
In this example SideColumn would not have been created yet so it would undoubtedly throw an error since ColumnImage would not have a row in the database to reference. I would have to save ColumnImage separately afterwards, but I'm trying to get it all into one nice neat transaction.
|
# ? Nov 11, 2007 01:14 |
|
I'm trying to style my XML with XSL and then spit it out as html using REXML and Ruby-XSLT... problem being, I can't seem to open up my files. This is my model: code:
code:
How exactly are you supposed to open a file in public from model?
|
# ? Nov 11, 2007 08:07 |
|
copla posted:How exactly are you supposed to open a file in public from model? You don't want to do that. Not in the model, at least. The entire point of splitting your code into model, view, and controller is to keep your logic separate from your presentation. The public folder is for the web layer, so if you open files from public in your model, that means that when you modify the presentation layer, you'll have to worry about not accidentally screwing up the internals of the application.
|
# ? Nov 11, 2007 08:26 |
|
Argue posted:You don't want to do that. Not in the model, at least. The entire point of splitting your code into model, view, and controller is to keep your logic separate from your presentation. The public folder is for the web layer, so if you open files from public in your model, that means that when you modify the presentation layer, you'll have to worry about not accidentally screwing up the internals of the application. Then I can work on pulling down the XML and somehow saving it, as it comes in as pure text, so it would need to have a declaration added at the beginning, then I can transform that, in turn, with the XSL. And THEN I can hopefully get it so that all of it happens serverside, updated hourly, and cached. But... now I need to open up the local file so I can test the first step.
|
# ? Nov 11, 2007 08:45 |
|
If you're just testing why not use the absolute path? Or an environmental variable if for some reason you want to deploy it to stage or production.
|
# ? Nov 11, 2007 15:28 |
|
|
# ? Apr 23, 2024 15:15 |
|
copla posted:This is my model: /blog.xml is an HTTP path, you want a path to that file on your hard drive. quote:I haven't had any issue opening and calling files from my stylesheets and my view files, from view I just do "/images/file.jpg" to call an image in public/images, but I can't do the same from model- when I do "/blog.xml" for it being in public/blog.xml, it doesn't work. You know how HTML and CSS work, right? When code in a view refers to /images/something.jpeg it's not actually opening that file, it just makes a reference to it in the HTML it generates, and the user's browser requests the file. Once you've figured out the correct path to use ("public/blog.xml" should probably work), you should just pass that straight to ruby-xslt, eg: code:
To process a remote file: code:
|
# ? Nov 11, 2007 16:27 |