From edpratomo at yahoo.co.id Sun May 11 05:14:40 2008 From: edpratomo at yahoo.co.id (Edwin Pratomo) Date: Sun, 11 May 2008 16:14:40 +0700 (ICT) Subject: [Rake-devel] [discussion] non-destructive option parsing Message-ID: <70463.48854.qm@web76401.mail.sg1.yahoo.com> good day jim and all currently rake uses getoptlong to parse command line options. the problem with this is that getoptlong destructively consumes ARGV, which means checking ARGV in a rakefile won't find any previously passed options. why would we need to check ARGV in rakefile? one possible case is to make use of rake's options such as -q or -v. so users might pass -qq or -vvv and a rakefile will print as much (or as little) output as those options are given. so i'd suggest to use optparse instead, as optparse supports non-destructive parsing. rgds, Edwin. ________________________________________________________ Kunjungi halaman depan Yahoo! Indonesia yang baru! http://id.yahoo.com/ From dsisnero at gmail.com Wed May 14 21:05:17 2008 From: dsisnero at gmail.com (Dominic Sisneros) Date: Wed, 14 May 2008 19:05:17 -0600 Subject: [Rake-devel] rake system() and windows Message-ID: What is the best way to invoke ruby system commands on a windows box? desc "Install the merb-more sub-gems" task :install_gems do gems.each do |dir| Dir.chdir(dir){ sh "rake install" } end end This fails because it actually needs rake.bat files If I do the following, it works rake_cmd = (PLATFORM == "i386-mswin32") ? "rake.bat" : "rake" desc "Install the merb-more sub-gems" task :install_gems do gems.each do |dir| Dir.chdir(dir){ sh "#{rake_cmd} install" } end end The problem with this is this needs to be done for every ruby/bin command that you want to use -------------- next part -------------- An HTML attachment was scrubbed... URL: From luislavena at gmail.com Wed May 14 21:21:07 2008 From: luislavena at gmail.com (Luis Lavena) Date: Wed, 14 May 2008 22:21:07 -0300 Subject: [Rake-devel] rake system() and windows In-Reply-To: References: Message-ID: <71166b3b0805141821q72fa8c55n824ca97607644894@mail.gmail.com> On Wed, May 14, 2008 at 10:05 PM, Dominic Sisneros wrote: > What is the best way to invoke ruby system commands on a windows box? > > desc "Install the merb-more sub-gems" > task :install_gems do > gems.each do |dir| > Dir.chdir(dir){ sh "rake install" } > end > end > > This fails because it actually needs rake.bat files > > If I do the following, it works > > rake_cmd = (PLATFORM == "i386-mswin32") ? "rake.bat" : "rake" > desc "Install the merb-more sub-gems" > task :install_gems do > gems.each do |dir| > Dir.chdir(dir){ sh "#{rake_cmd} install" } > end > end > > The problem with this is this needs to be done for every ruby/bin command > that you want to use > I replied to your post on merb group, but also copy it here for the record (and google) ;-) This is a old a known problem of Ruby on Windows. Thankfully Nobu committed a fix for it a few weeks back to the ruby svn repository. ruby-core thread start: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/16517 and more details of this here: http://blog.mmediasys.com/2008/04/24/contributions-speedup-and-less-quirks-for-us Regards, -- Luis Lavena AREA 17 - Human beings, who are almost unique in having the ability to learn from the experience of others, are also remarkable for their apparent disinclination to do so. Douglas Adams From edpratomo at yahoo.co.id Sat May 17 14:35:46 2008 From: edpratomo at yahoo.co.id (Edwin Pratomo) Date: Sun, 18 May 2008 01:35:46 +0700 (ICT) Subject: [Rake-devel] Balasan: [patch] non-destructive option parsing In-Reply-To: <70463.48854.qm@web76401.mail.sg1.yahoo.com> Message-ID: <631407.47933.qm@web76412.mail.sg1.yahoo.com> --- Edwin Pratomo wrote: > good day jim and all > > currently rake uses getoptlong to parse command line options. the problem > with > this is that getoptlong destructively consumes ARGV, which means checking > ARGV > in a rakefile won't find any previously passed options. > > why would we need to check ARGV in rakefile? one possible case is to make use > of rake's options such as -q or -v. so users might pass -qq or -vvv and a > rakefile will print as much (or as little) output as those options are given. > > so i'd suggest to use optparse instead, as optparse supports non-destructive > parsing. attached is a patch for this. against svn trunk, rev 642. rgds, Edwin. ________________________________________________________ Bergabunglah dengan orang-orang yang berwawasan, di di bidang Anda! Kunjungi Yahoo! Answers saat ini juga di http://id.answers.yahoo.com/ -------------- next part -------------- A non-text attachment was scrubbed... Name: rake-optparse.patch Type: application/octet-stream Size: 7675 bytes Desc: 51425519-rake-optparse.patch URL: From jftucker at gmail.com Wed May 21 07:48:44 2008 From: jftucker at gmail.com (James Tucker) Date: Wed, 21 May 2008 12:48:44 +0100 Subject: [Rake-devel] rake task descriptions and display width Message-ID: <237EB508-5F01-479D-B2F5-08F9DD51D61C@gmail.com> Hi anyone/all, Minor one, but it's been bugging me for a while. I want to see the full descriptions of rake tasks sometimes, or at least, a lot more of the description than 60 something chars. I had a look in rake.rb around the various things, spotted the fact that there is code for full descriptions, but that it's currently defaulted to false, I think all the time. Anyway, more useful than this, to me at least, is to be able to use a known width of the screen where possible, so I added the following code starting at line 2012 of rake.rb. I would have provided a patch (and test cases), but I threw this together fast and dirty (inside the gem install), so the procedure would have been significantly longer. The following code is useful under environments where the user has: * shopt -s checkwinsize (bash, or some other equivalent in other shells (sets COLUMNS and ROWS)). * export COLUMNS It works as it previously did under conditions where the environment variable is not available. Thanks for Rake, it's awesome, James. Code: ===== # if ENV['COLUMNS'] is nil, we want to supply 80 to Integer(), else we get 0 for nil. # if ENV['COLUMNS'] if for some reason 'foo', we need to rescue and return 80. display_cols = Integer(ENV['COLUMNS'] || 80) rescue 80 max_column = display_cols - name.size - width - 7 From jason.lapier at gmail.com Wed May 21 10:01:21 2008 From: jason.lapier at gmail.com (Jason LaPier) Date: Wed, 21 May 2008 07:01:21 -0700 Subject: [Rake-devel] rake task descriptions and display width In-Reply-To: <237EB508-5F01-479D-B2F5-08F9DD51D61C@gmail.com> References: <237EB508-5F01-479D-B2F5-08F9DD51D61C@gmail.com> Message-ID: <93b44c1f0805210701t18f602b5i202d8b88183ed0eb@mail.gmail.com> I wrote a patch for basically the same thing (size based on an environment variable) a couple months back, and included a test: http://rubyforge.org/pipermail/rake-devel/2008-February/000410.html Alex Chaffee came up with a different approach that's meant to identify your terminal width: http://rubyforge.org/pipermail/rake-devel/2008-April/000423.html I think Jim was trying to decide the best way to go about it, and it's going to be fixed one way or another in the next release. - Jason L. On Wed, May 21, 2008 at 4:48 AM, James Tucker wrote: > Hi anyone/all, > > Minor one, but it's been bugging me for a while. I want to see the full > descriptions of rake tasks sometimes, or at least, a lot more of the > description than 60 something chars. I had a look in rake.rb around the > various things, spotted the fact that there is code for full descriptions, > but that it's currently defaulted to false, I think all the time. > > Anyway, more useful than this, to me at least, is to be able to use a known > width of the screen where possible, so I added the following code starting > at line 2012 of rake.rb. I would have provided a patch (and test cases), but > I threw this together fast and dirty (inside the gem install), so the > procedure would have been significantly longer. > > The following code is useful under environments where the user has: > * shopt -s checkwinsize (bash, or some other equivalent in other shells > (sets COLUMNS and ROWS)). > * export COLUMNS > > It works as it previously did under conditions where the environment > variable is not available. > > Thanks for Rake, it's awesome, > > James. > > Code: > ===== > > # if ENV['COLUMNS'] is nil, we want to supply 80 to Integer(), else > we get 0 for nil. > # if ENV['COLUMNS'] if for some reason 'foo', we need to rescue and > return 80. > display_cols = Integer(ENV['COLUMNS'] || 80) rescue 80 > max_column = display_cols - name.size - width - 7 > _______________________________________________ > Rake-devel mailing list > Rake-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/rake-devel > -- My Rails and Linux Blog: http://offtheline.net From jftucker at gmail.com Wed May 21 12:24:19 2008 From: jftucker at gmail.com (James Tucker) Date: Wed, 21 May 2008 17:24:19 +0100 Subject: [Rake-devel] rake task descriptions and display width In-Reply-To: <93b44c1f0805210701t18f602b5i202d8b88183ed0eb@mail.gmail.com> References: <237EB508-5F01-479D-B2F5-08F9DD51D61C@gmail.com> <93b44c1f0805210701t18f602b5i202d8b88183ed0eb@mail.gmail.com> Message-ID: <9EF19EBA-A3E9-4FAB-A7D3-55F1CEF47963@gmail.com> On 21 May 2008, at 15:01, Jason LaPier wrote: > I wrote a patch for basically the same thing (size based on an > environment variable) a couple months back, and included a test: > http://rubyforge.org/pipermail/rake-devel/2008-February/000410.html > > Alex Chaffee came up with a different approach that's meant to > identify your terminal width: > http://rubyforge.org/pipermail/rake-devel/2008-April/000423.html > > I think Jim was trying to decide the best way to go about it, and it's > going to be fixed one way or another in the next release. Ok, sorry for the noise then. Regards, J. From yves_dufour at mac.com Thu May 29 09:25:05 2008 From: yves_dufour at mac.com (Yves Dufour) Date: Thu, 29 May 2008 15:25:05 +0200 Subject: [Rake-devel] publisher.upload_port(666) Message-ID: I am testing rake file upload, running well rcp in a terminal scp -v -P 666 -q /Users/kadoudal/musicians.xml kadoudal at mydomain.com:httpdocs/var/www/html/jazz_people but when running from the rake file publisher = Rake::SshFilePublisher.new( "kadoudal@ mydomain.com", "/ httpdocs/var/www/html/jazz_people", File.dirname(__FILE__), t.prerequisites.first) publisher.upload I get an error, which quite normal as I should precise the port 666 ok solved this issue with a patch in rake/contrib/sshpublisher.rb # Upload the local directory to the remote directory on non-standard port def upload_port(port=22) @files.each do |fn| sh %{scp -P #{port} -q #{@local_dir}/#{fn} #{@host}:#{@remote_dir}} end end now I can do publisher.upload_port(666) -------------- next part -------------- An HTML attachment was scrubbed... URL: From dsisnero at gmail.com Fri May 30 16:50:38 2008 From: dsisnero at gmail.com (Dominic Sisneros) Date: Fri, 30 May 2008 14:50:38 -0600 Subject: [Rake-devel] git-svn clone? Message-ID: Has anyone done a git clone of rake trunk or should we do this so we can start adding contrib 'forks' and patches easier? If not, should I start one on github? thanks, dom -------------- next part -------------- An HTML attachment was scrubbed... URL: From jim.weirich at gmail.com Sat May 31 10:25:07 2008 From: jim.weirich at gmail.com (Jim Weirich) Date: Sat, 31 May 2008 07:25:07 -0700 Subject: [Rake-devel] git-svn clone? In-Reply-To: References: Message-ID: <4BBBD251-F1C3-4FB8-A0D0-FBC91841DF0B@gmail.com> On May 30, 2008, at 1:50 PM, Dominic Sisneros wrote: > Has anyone done a git clone of rake trunk or should we do this so we > can start adding contrib 'forks' and patches easier? If not, should > I start one on github? I've been playing with git before I make the final decision, but I'm planning on converting the rake svn repository to git on rubyforge. Then it should be easy to clone on github or elsewhere. -- -- Jim Weirich -- jim.weirich at gmail.com