From kim.toms at gmail.com Wed May 2 10:23:17 2007 From: kim.toms at gmail.com (Kim Toms) Date: Wed, 2 May 2007 10:23:17 -0400 Subject: [Rake-devel] Rake and directories Message-ID: <1513b3110705020723lebcb1f0x9005c9053bf5d172@mail.gmail.com> I was trying to create some rake tasks to compile some software in a directory other than where the rakefile was located. At first I tried: Dir.chdir('lib/mc_sim') { > file 'Makefile' => 'extconf.rb' do |t| > sh 'ruby extconf.rb' > end > task :build_simulator => ['Makefile', :environment] do > sh 'make install' > end > } However, the Dir.chdir didn't seem to work right. So, I changed it to be: file 'lib/mc_sim/Makefile' => 'lib/mc_sim/extconf.rb' do |t| > Dir.chdir('lib/mc_sim') { sh 'ruby extconf.rb' } > end > > task :build_simulator => ['lib/mc_sim/Makefile', :environment] do > Dir.chdir('lib/mc_sim') { sh 'make install' } > end Is there a better (i.e. less verbose) way to do this? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rake-devel/attachments/20070502/7cfeb689/attachment.html From bryan.emrys at gmail.com Fri May 11 10:47:44 2007 From: bryan.emrys at gmail.com (Peter Hiltz) Date: Fri, 11 May 2007 14:47:44 +0000 Subject: [Rake-devel] Problem with postgresql 8.2 database Message-ID: <200705111447.44545.peter@peterhiltz.com> Hi, possible newbie problem. Running rake version 0.7.3 (gem install, linux x86 box) against a postgreql 8.2 database in rails. The following error message turns up running commands such as: rake routes -v --trace rake db:schema:dump -v --trace rake extract_fixtures -v --trace Any suggestions would be appreciated. Bryan (in /var/www/localhost/htdocs/rails/railstax-dev) ** Invoke db:schema:dump (first_time) ** Invoke environment (first_time) ** Execute environment NOTICE: CREATE TABLE will create implicit sequence "aggregate_meta_datas_id_seq1" for serial column "aggregate_meta_datas.id" rake aborted! PGError: ERROR: relation "aggregate_meta_datas" already exists : CREATE TABLE aggregate_meta_datas ("id" serial primary key, "cube_name" character varying(255) DEFAULT NULL, "dimension1" character varying(255) DEFAULT NULL, "dimension1_hierarchy" character varying(255) DEFAULT NULL, "dimension2" character varying(255) DEFAULT NULL, "dimension2_hierarchy" character varying(255) DEFAULT NULL, "created_at" timestamp DEFAULT NULL, "populated_at" timestamp DEFAULT NULL) /usr/lib64/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract_adapter.rb:128:in `log' /usr/lib64/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/postgresql_adapter.rb:152:in `execute' /usr/lib64/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/connection_adapters/abstract/schema_statements.rb:104:in `create_table' /var/www/localhost/htdocs/rails/railstax-dev/config/../vendor/plugins/activewarehouse/lib/active_warehouse/aggregate_meta_data.rb:8:in `build_table' /var/www/localhost/htdocs/rails/railstax-dev/config/../vendor/plugins/activewarehouse/lib/active_warehouse/aggregate.rb:213 /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' /usr/lib64/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require' /usr/lib64/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in' /usr/lib64/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require' /var/www/localhost/htdocs/rails/railstax-dev/config/../vendor/plugins/activewarehouse/lib/active_warehouse.rb:73 /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' /usr/lib64/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require' /usr/lib64/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in' /usr/lib64/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require' /var/www/localhost/htdocs/rails/railstax-dev/config/../vendor/plugins/activewarehouse/init.rb:1:in `load_plugin' /usr/lib64/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:401:in `load_plugin' /usr/lib64/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings' /usr/lib64/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:401:in `load_plugin' /usr/lib64/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:185:in `load_plugins' /usr/lib64/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:185:in `each' /usr/lib64/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:185:in `load_plugins' /usr/lib64/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:105:in `process' /usr/lib64/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:43:in `send' /usr/lib64/ruby/gems/1.8/gems/rails-1.2.3/lib/initializer.rb:43:in `run' /var/www/localhost/htdocs/rails/railstax-dev/config/../config/environment.rb:14 /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' /usr/lib64/ruby/gems/1.8/gems/rails-1.2.3/lib/tasks/misc.rake:3 /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `call' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `each' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:392:in `execute' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:362:in `invoke' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:369:in `invoke_prerequisites' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `each' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `send' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1003:in `each' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:368:in `invoke_prerequisites' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:361:in `invoke' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `synchronize' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:355:in `invoke' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `each' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1739:in `top_level' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1733:in `top_level' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1711:in `run' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1761:in `standard_exception_handling' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/lib/rake.rb:1708:in `run' /usr/lib64/ruby/gems/1.8/gems/rake-0.7.3/bin/rake:7 /usr/bin/rake:16:in `load' /usr/bin/rake:16 L, "dimension2_hierarchy" character varying(255) DEFAULT NULL, "created_at" timestamp DEFAULT NULL, "populated_at" timestamp DEFAULT NULL) From bryan.emrys at gmail.com Fri May 11 10:55:58 2007 From: bryan.emrys at gmail.com (Peter Hiltz) Date: Fri, 11 May 2007 14:55:58 +0000 Subject: [Rake-devel] Follow to Postgresq 8.2 issue Message-ID: <200705111455.59025.peter@peterhiltz.com> I deleted the activewarehouse plugin in the rails project vendor directory. That eliminated the error message. However, running rake -v --trace db:schema:dump generates a basically blank schema: # This file is autogenerated. Instead of editing this file, please use the # migrations feature of ActiveRecord to incrementally modify your database, and # then regenerate this schema definition. ActiveRecord::Schema.define(:version => 3) do end The trace is (in /var/www/localhost/htdocs/rails/railstax-dev) ** Invoke db:schema:dump (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:schema:dump The rest of rails is perfectly happy reading the database, but rake doesn't seem to be pulling anything out. Again, looking for suggestions. Thanks, Bryan From stephen at touset.org Mon May 21 19:15:42 2007 From: stephen at touset.org (Stephen Touset) Date: Mon, 21 May 2007 19:15:42 -0400 Subject: [Rake-devel] exit 1 on SystemExit Message-ID: <1179789342.32120.3.camel@megatron> It would be a lot more useful, I think, if rake detected a SystemExit and then exited with the status in the exception, rather than just doing an exit(1). Specifically, I'm doing an early exit in one of my rake tasks where I need to return a 0 exit code. Rake intercepts this SystemExit and always returns a 1, regardless of the status. The patch for this is trivial, and included. -- Stephen Touset -------------- next part -------------- A non-text attachment was scrubbed... Name: rake.patch Type: text/x-patch Size: 513 bytes Desc: not available Url : http://rubyforge.org/pipermail/rake-devel/attachments/20070521/09911054/attachment.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://rubyforge.org/pipermail/rake-devel/attachments/20070521/09911054/attachment-0001.bin From Daniel.Berger at qwest.com Tue May 22 10:31:53 2007 From: Daniel.Berger at qwest.com (Daniel Berger) Date: Tue, 22 May 2007 08:31:53 -0600 Subject: [Rake-devel] exit 1 on SystemExit In-Reply-To: <1179789342.32120.3.camel@megatron> References: <1179789342.32120.3.camel@megatron> Message-ID: <4652FED9.1060401@qwest.com> Stephen Touset wrote: > It would be a lot more useful, I think, if rake detected a SystemExit > and then exited with the status in the exception, rather than just doing > an exit(1). > > Specifically, I'm doing an early exit in one of my rake tasks where I > need to return a 0 exit code. Rake intercepts this SystemExit and always > returns a 1, regardless of the status. > > The patch for this is trivial, and included. Seems reasonable to me. Regards, Dan From jeanpierre at gmail.com Sat May 26 16:43:30 2007 From: jeanpierre at gmail.com (jeanpierre at gmail.com) Date: Sat, 26 May 2007 13:43:30 -0700 Subject: [Rake-devel] synthesizing namespaces and tasks Message-ID: hi list - i'm wondering if there is a good way to dynamically create namespaces and tasks. currently, i have an ugly string generation to eval code that wraps an Xcode project's targets/configurations, but i would have to imagine there is a better way. looking at the rdocs (for the first time), i see a define_task method which sounds good, are there any examples of this in use? cheers, jean-pierre -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rake-devel/attachments/20070526/4841b487/attachment-0001.html From jim at weirichhouse.org Sat May 26 19:42:05 2007 From: jim at weirichhouse.org (Jim Weirich) Date: Sat, 26 May 2007 19:42:05 -0400 Subject: [Rake-devel] synthesizing namespaces and tasks In-Reply-To: References: Message-ID: <4658C5CD.9040604@weirichhouse.org> jeanpierre at gmail.com wrote: > hi list - > > i'm wondering if there is a good way to dynamically create > namespaces and tasks. currently, i have an ugly string > generation to eval code that wraps an Xcode project's > targets/configurations, but i would have to imagine > there is a better way. looking at the rdocs (for the first > time), i see a define_task method which sounds good, are there > any examples of this in use? Actually, it's much easier than that. The following bit of code synthesizes creates 10 tasks where task t(n) depends on t(n-1), except for t0 which depends on nothing: task :t0 (1..9).each do |i| task "t#{i}" => "t#{i-1}" do |t| puts t.name end end No need to delve into define_task and all that. -- -- Jim Weirich jim at weirichhouse.org http://onestepback.org -- In theory, practice and theory are the same. -- In practice, they are different. From jeanpierre at gmail.com Sat May 26 22:28:11 2007 From: jeanpierre at gmail.com (jeanpierre at gmail.com) Date: Sat, 26 May 2007 19:28:11 -0700 Subject: [Rake-devel] synthesizing namespaces and tasks In-Reply-To: <4658C5CD.9040604@weirichhouse.org> References: <4658C5CD.9040604@weirichhouse.org> Message-ID: On 5/26/07, Jim Weirich wrote: > > jeanpierre at gmail.com wrote: > > hi list - > > > > i'm wondering if there is a good way to dynamically create > > namespaces and tasks. currently, i have an ugly string > > generation to eval code that wraps an Xcode project's > > targets/configurations, but i would have to imagine > > there is a better way. looking at the rdocs (for the first > > time), i see a define_task method which sounds good, are there > > any examples of this in use? > > Actually, it's much easier than that. > > The following bit of code synthesizes creates 10 tasks where task t(n) > depends on t(n-1), except for t0 which depends on nothing: > > task :t0 > > (1..9).each do |i| > task "t#{i}" => "t#{i-1}" do |t| > puts t.name > end > end > > No need to delve into define_task and all that. amazing i overlooked the simple route and instead went so far as to create a sting to eval. the code necessary was just cut in half :0) thank you for your help and for rake! cheers, jean-pierre -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rake-devel/attachments/20070526/5b08c9ca/attachment.html