2011-02-23 4 views
0

나는 범위 :(아래) 인수를 허용하는 레이크 작업이 있습니다. 나는 레이크 작업과 같이 전화 :레이크 작업으로 전달되지 않는 Arg가

rake podcast:generate_inventory["new"] 

통과하는 데이 작업 : 범위는 완벽하게 arg를하지만, 내가 인수가 더 이상 전달되는 오늘 발견하지 않습니다. 왜 이런 일이 일어나는 지 아는 사람이 있습니까? 당신이 task :generate_inventory의 당신의 정의에 [:scope] 비트 누락있는 것처럼

namespace :podcast do 

    task :itunes_top_300, [:scope] => :environment do |t,args| 
    Podcast.podcast_logger.info("BEGIN: #{Time.now}") 
    if args[:scope] == "new" 
     Podcast.podcast_logger.info("NEW PODCASTS ONLY") 
    end 
    Podcast.itunes_top_rss 
    end 

    task :itunes_genres_top_300 => :itunes_top_300 do 
    Podcast.itunes_genre_rss 
    end 

    task :site_and_feed_discovery, [:scope] => :itunes_genres_top_300 do |t,args| 
    if args[:scope] == "new" 
     Podcast.site_and_feed_discovery(:new_podcasts_only => true) 
    else 
     Podcast.site_and_feed_discovery 
    end 
    end 

    task :social_discovery, [:scope] => :site_and_feed_discovery do |t,args| 
    if args[:scope] == "new" 
     Podcast.social_discovery(:new_podcasts_only => true) 
    else 
     Podcast.social_discovery 
    end 
    end 

    task :fetch_episodes => :social_discovery do |t,args| 
    Episode.episode_logger.info("BEGIN: #{Time.now}") 
    Podcast.fetch_episodes 
    Episode.episode_logger.info("END: #{Time.now}") 
    end 

    task :generate_inventory => :fetch_episodes do |t,args| 
    Podcast.podcast_logger.info("Successful Rake") 
    Podcast.podcast_logger.info("END #{Time.now}") 
    Rake::Task['maintenance:daily'].invoke 
    end 
end 

답변

1

보인다. 나는 그 모든 것을 돌볼 것이라고 덧붙였다.

희망 하시겠습니까?

+0

감사합니다. 매력처럼 작동 :) – lightyrs

관련 문제