rake

How to call rake target twice

限于喜欢 提交于 2019-12-10 19:33:39
问题 I generate two different sets of DLL files from my .sln by modifying the .csproj files to include an extra compilation symbol. I'm using rake to build the solution, and have the following Build task: #========================================================== desc "Builds the DPSF.sln in Release mode." msbuild :Build do |msb| puts 'Building the DPSF solution...' msb.properties :configuration => :Release msb.targets [:Clean, :Rebuild] msb.solution = DPSF_SOLUTION_FILE_PATH msb.parameters "

Rake custom arguments for all tasks?

橙三吉。 提交于 2019-12-10 19:15:42
问题 I want to pass in an argument to rake independent of the task I run. For example: rake my_arg=foo rake my_arg=foo :install rake my_arg=foo :upgrade rake my_arg=foo :bar Is there a way to do this? 回答1: You can send arguments in like this: rake some_task arg1=value arg2=value Then pull the named parameters out of ENV inside your rake task: arg1 = ENV['arg1'] arg2 = ENV['arg2'] You can also supply more traditional command line switches like this: rake some_task -- --arg1=value --arg2=value And

Rails - Rake error: Library not loaded

痞子三分冷 提交于 2019-12-10 18:51:39
问题 I have read just about every post regarding rails errors looking for the solution to my issues and while I have resolved some, I come up with more. I upgraded to Snow Leopard and installed RVM and Rails according to the Agile Development with Rails book. However once I create my app folders and do RAKE, I get this error and I just can not figure out how to fix it. I've tried re-installing everything several times to no avail. Is this an architecture problem? or do I need to find a library and

Running Rails code/initializers but not via Rake

时间秒杀一切 提交于 2019-12-10 18:26:36
问题 I keep running into a recurring issue with my application. Basically, I have certain code that I want it to run when it first starts up the server to check whether certain things have been defined e.g. a schedule, particular columns in the database, existence of files, etc. and then act accordingly. However, I definitely don't want this code to run when I'm starting a Rake task (or doing a 'generate', etc. For example, I don't want the database fields to be checked under Rake because the Rake

Rails - execute rake tasks at startup

a 夏天 提交于 2019-12-10 17:57:22
问题 I have the following code in config/application.rb config.after_initialize do IndividualProject::Application.load_tasks #load File.join(Rails.root, 'lib', 'tasks', 'download_csv.rake') Rake::Task[ 'download_csv:get_files' ].invoke Rake::Task[ 'download_csv:place_in_database' ].invoke end My problem is that if I try to execute migrations, I get a database error which says that one of tables I'm referencing in the rake task does not exist. ActiveRecord::StatementInvalid: PG::UndefinedTable:

Bundler's rake release with geminabox?

我们两清 提交于 2019-12-10 17:47:19
问题 Is there a way to configure bundler so that when I do rake release it would submit the gem to my own gem server (a gem in a box instance) rather than to rubygems? Ideally this configuration would be something I can omit from my git repository. 回答1: Rubygems is actually hard-coded into bundler and I've found only one way around it. The following monkeypatch should get you what you want: module Bundler class GemHelper protected def rubygem_push(path) if Pathname.new("~/.gem/nexus").expand_path

Rake Default Task and Namespaces

梦想的初衷 提交于 2019-12-10 17:45:37
问题 I have read through the docs and looked at quite a few examples but I am not clear on defaults and namespaces. (using rake, version 10.0.3) First it seems, though I do not recall seeing this explicitly, that there can be only ONE default task regardless of how many are defined. Apparently the load order (PROJECT_NAME::Application.load_tasks) determines the winner. When I have struggled to create a namespaced default I have found that I have sometimes overridden the normal default for a rails

Testing a rake task with passed parameters in rspec

怎甘沉沦 提交于 2019-12-10 17:19:24
问题 In rspec, i want to test a rake task with some parameters passed in, so in the command line you would run this: rake commissions:create_price_points options=1,2,3 and in the rake task i use ENV['options']. In my rspec I have rake = get_rake_environment(RAKE_FILE) rake["commissions:create_price_points"].invoke(options=1,2,3) This runs the rake fine but this, and other attempts that I've made with invoke and execute, do not pass the options into it. Just wondering if anyone has any insight on

rake release hangs when releasing a gem

血红的双手。 提交于 2019-12-10 15:10:34
问题 I'm trying to release my first gem to Ruby Gems. The gem is working great locally. I'm releasing it using: $rake release Which gives me this in the console: example_gem 0.0.3 built to pkg/example_gem-0.0.1.gem Tagged v0.0.1 Pushed git commits and tags Then the process hangs. I waited 20 mins, then cancelled. When I tried to release again I got: rake aborted! This tag has already been committed to the repo. So I assumed the gem had been successfully submitted, however 16 hours later, the gem

Rake / Rspec: How to suppress / quiet / silent the first output line showing the command with --pattern ?

牧云@^-^@ 提交于 2019-12-10 14:55:16
问题 Problem: If I run ServerSpec (based on RSpec ) through Rake with one of the following commands: rake rake spec rake spec:all rake spec:<host> bundle exec rake ... Rake prints the command it executes to stdout before the serverspec output: /usr/bin/ruby1.9.1 -I/var/lib/gems/1.9.1/gems/rspec-core-3.1.6/lib:/var/lib/gems/1.9.1/gems/rspec-support-3.1.2/lib /var/lib/gems/1.9.1/gems/rspec-core-3.1.6/exe/rspec --pattern spec/<host>/\*_spec.rb If I pass the target host manually to rspec like this ...