rake

Hudson results one step behind

I'm using the filesytem plugin for Hudson, and when a build happens it looks for new/modified files, copies them to the Workspace, runs tests using Rake, and then publishes those junit xml result files. However, the updated junit xml result files don't get pushed to the workspace until the next build. This means that when the publishin...

How to solve rake tasks deprecation on the rails plugin?

Because of the concept introduced in here, Rails::Plugin is nothing more than a Rails::Engine, but since it's loaded too late in the boot process, it does not have the same configuration powers as a bare Rails::Engine. Opposite to Rails::Railtie and Rails::Engine, you are not supposed to inherit from Rails::Plugin. ...

Rails: How to write to a custom log file from within a rake task in production mode?

Hey, I'm trying to write to my log files while running a rake task. It works fine in development mode, but as soon as I switch to the production environment, nothing is written to the log files. I read here http://stackoverflow.com/questions/1022093/how-do-i-use-a-custom-log-for-my-rake-tasks-in-ruby-on-rails/1648159#1648159 that thi...

Rake - failing builds for warnings

Hi, I am trying to automate our build system and one of the task is to fail the builds if a warnings is thrown in the compiler. we are using sh rake command to compile. How one can fail on warnings, is there any way i can capture the output from compiler to a buffer and do a pattern search? Thanks, Prabhu ...

Rake tasks in other files

Im trying to use rake in a project, and if I put everything into Rakefile it will be huge and hard to read/find things, so I tried to stick each namesapce in its own file in lib/rake, i added this to the top of my rake file: Dir['#{File.dirname(__FILE__)}/lib/rake/*.rake'].map { |f| require f } it loads the file no problem, but doesn'...

Using Routing helpers in a Rake task

I have a rake task that sends out the next 'x' invitations to join a beta it uses this code: desc "This will send out the next batch of invites for the beta" task :send_invites => :environment do limit = ENV['limit'] c = 0 invitation = Invitation.all(:conditions => { :sent_at => nil, :sender_id => nil }, :limit => limit).each do |...

Why does Ruby 1.9.2 remove "." from LOAD_PATH, and what's the alternative?

The latest changesets to Ruby 1.9.2 no longer make the current directory . part of your LOAD_PATH. I have a non-trivial number of Rakefiles that assume that . is part of the LOAD_PATH, so this broke them. Was there a particular justification for doing this? As for a fix, adding $: << "." everywhere works, but seems incredibly hacky and ...

Using ActiveRecord::Base.transaction in a rake task?

I am writing a rake task which, at one point, uses a custom YAML file import method to seed the database. The rake task looks like: desc "Seed the database with production/ data." task :production => :environment do import_yaml 'seed/production' end At one point in the import code, I have: ActiveRecord::Base.transaction do ...

Passing arguments to an Rspec SpecTask

Rake allows for the following syntax: task :my_task, :arg1, :arg2 do |t, args| puts "Args were: #{args}" end I'd like to be able to do the same, but with RSpecs SpecTask. The following unfortunately fails: desc "Run example with argument" SpecTask.new('my_task'), :datafile do |t, args| t.spec_files = FileList['*_spec.rb -datafil...

Repeated Rake Task Using Delayed Job

Hello, I am currently using the delayed_job gem and I was wondering how to run a rake task every 5 minutes. I want to run "rake ts:reindex RAILS_ENV=production" every 5 minutes but I'm not sure where to start. I really don't have much more I can say about this because I am VERY inexperienced in this area of rails development. ...

Versioning CommonAssemblyInfo.cs and MSBuild

So I have a CommonAssemblyInfo.cs linked into all the projects in my solution and is dynamically generated by my rake/albacore scripts which is not checked into source control. I also have a CommonAssemblyInfo.cs.local for use when there is no ruby available, mainly to be used by devs. Is it possible to have a msbuild task or something...

Shortcut for rake db:migrate:down for ruby-on-rails

Hi, I want to know if there is a short way to do the migrations down equivalent to rake db:migrate (for the migrations up). Instead of doing : rake db:migrate:up VERSION=1, rake db:migrate:up VERSION=2, ... we can do : rake db:migrate! But for : rake db:migrate:down VERSION=10, rake db:migrate:down VERSION=..., rake db:migrate:down VERS...

Avoiding duplication in setting properties on the task in Rake tasks

I have a bunch of rake building tasks. They each have unique input / output properties, but the majority of the properties I set on the tasks are the same each time. Currently I'm doing that via simple repetition like this: task :buildThisModule => "bin/modules/thisModule.swf" mxmlc "bin/modules/thisModule.swf" do |t| t.input = "s...

rake throws an error: undefined method `reserved=' for #<FriendlyId

I run rake and I get this error. What's that supposed to mean? Sorry I'm newbie to RoR sb please help. Thanks a lot. undefined method `reserved=' for #<FriendlyId::ActiveRecordAdapter::Configuration:0x2b1ae5c2ec70> ...

Is there a way to programmatically count RSpec tests?

Given a Rakefile that executes some RSpec tests by way of a Spec::Rake::SpecTask, how can I programmatically determine the number of tests that passed, failed, and are pending once the task that ran the tests is finished? ...

Installing rake

we tried to install rake on our pc but there were following errors.. We even tried updating gems but in vain. We need to run some tasks on rake and dont know how to go abt it. C:\Documents and Settings\nemanich\My Documents\gems>gem install rake-compi 0 .7.0.gem ERROR: http://gems.rubyforge.org/ does not appear to be a repository ER...

Running rake migrate gives Mysql error schema_migrations.frm

I am running 5.1 on Ubuntu 10.04, and the remote server is running 5.0.51, is this a problem? Mysql::Error: Incorrect information in file: './user/schema_migrations.frm': SELECT version FROM schema_migrations I should say that trying to install it gives the error of the package (mysql-server-5.0 referenced but not available). I believe...

[Ruby] Confirm existance of executable (script, bat, cmd, exe) via a ruby file.

Using a ruby file (or any rake facility) I need to find out if the user who executes my script is able to execute certain shell commands. In particular g++ etc. Hopefully system independent so if there is some g++.bat, g++.exe or just g++ (etc) it should say yes nevertheless, as long as its on the path and executable on the users system....

"getaddrinfo: Name or service not known" while rake db:migrate

# rake db:migrate --trace (in /www/rails_app) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate rake aborted! getaddrinfo: Name or service not known /usr/local/lib/ruby/gems/1.9.1/gems/postgres-pr-0.6.3/lib/postgres-pr/connection.rb:165:in `initialize' /usr/local/lib/ruby/ge...

Rake uninitialized constant RDoc::RDoc

When ever I run make I get this 'uninitialized constant RDoc::RDoc' error rake -T (in Main) rake aborted! uninitialized constant RDoc::RDoc C:/Ruby186/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2383:in `raw_load_rakefile' (See full trace by running task with --trace) --edit Running --trace it ...