This project is archived and is in readonly mode.
Make app templates sync output back immediately?
Reported by Sven Fuchs | February 22nd, 2009 @ 11:18 PM | in 2.x
Currently app templates use backticks to execute external commands such as git clone. With backticks the output gets buffered and then sent to nirvana.
Is there any particular reason for using backticks and not syncing stdout? Maybe some OS related thing?
Otherwise I feel it would be much nicer to directly report back the external command's output to the shell:
STDOUT.sync = true
system "git clone ..."
I've attached a patch for the git adapter. If the change would be acceptable for other app template commands as well I'll change that accordingly.
Comments and changes to this ticket
-
DHH February 27th, 2009 @ 02:01 PM
- Assigned user set to Pratik
-
Pratik May 18th, 2009 @ 09:54 PM
- State changed from new to incomplete
Looks good. But I think we should change all the instances of
with a single patch.
Thanks.
-
Sven Fuchs July 7th, 2009 @ 09:38 AM
Pratik, you mean "all the instances of backticks" ... where? allover Rails? I could look into that, too, of course.
-
Sven Fuchs August 2nd, 2009 @ 06:15 PM
- State changed from incomplete to open
Ok, I've now reworked that patch to use system() for all the git commands in that file.
I've again applied the patch and ran "rails app -m template.rb" using it. That template contained a git clone command with a rather large repository. The command's output from Github was immediately sync'ed back to my shell so I could watch the clone command's status.
Will change the ticket status to "open" again.
-
José Valim August 2nd, 2009 @ 09:21 PM
Pratik, I will handle it. It will include changes to thor.
Thanks Sven!
-
Sven Fuchs August 2nd, 2009 @ 11:57 PM
Changes to Thor? Is Thor part of the app template system in Rails?
-
José Valim August 3rd, 2009 @ 06:49 AM
Already fixed this on Thor. Rails 3 will have this fixed as soon as I update the vendored version.
-
José Valim August 3rd, 2009 @ 07:14 AM
I cannot apply to Rails 2.3, but it would be a good idea. I also replaced run() to use system instead of backticks, everything appears to be great.
-
Repository August 5th, 2009 @ 07:42 PM
- State changed from open to resolved
(from [5a0e2959117e29e6836b9f611d6ba1d3260702b7]) Make app template git adapter sync back output immediately by using system() instead of backticks [#2047 state:resolved]
Signed-off-by: Pratik Naik pratiknaik@gmail.com
http://github.com/rails/rails/commit/5a0e2959117e29e6836b9f611d6ba1...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 2047 Make app templates sync output back immediately? (from [5a0e2959117e29e6836b9f611d6ba1d3260702b7]) Make ap...