Skip to content

Instantly share code, notes, and snippets.

@mdesantis
Last active May 28, 2023 16:11

Revisions

  1. mdesantis revised this gist Jan 1, 2018. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions schedule.rb
    Original file line number Diff line number Diff line change
    @@ -8,9 +8,9 @@
    # doesn't need modifications
    # job_type :command, ":task :output"

    job_type :rake, %q{ cd :path && PATH=:env_path:"$PATH" RAILS_ENV=:environment bundle exec rake :task --silent :output }
    job_type :runner, %q{ cd :path && PATH=:env_path:"$PATH" script/rails runner -e :environment ':task' :output }
    job_type :script, %q{ cd :path && PATH=:env_path:"$PATH" RAILS_ENV=:environment bundle exec script/:task :output }
    job_type :rake, %q{ cd :path && PATH=:env_path:"$PATH" RAILS_ENV=:environment bin/rake :task --silent :output }
    job_type :runner, %q{ cd :path && PATH=:env_path:"$PATH" bin/rails runner -e :environment ':task' :output }
    job_type :script, %q{ cd :path && PATH=:env_path:"$PATH" RAILS_ENV=:environment bundle exec bin/:task :output }

    # tasks
    every 1.day, :at => Time.now + 1.minute do
  2. mdesantis revised this gist Apr 10, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion schedule.rb
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Schedule script for using whenever toghether with rbenv
    # Schedule script for using Whenever toghether with rbenv
    #
    # Whenever: https://github.com/javan/whenever
    # rbenv: https://github.com/sstephenson/rbenv
  3. mdesantis created this gist Apr 10, 2013.
    20 changes: 20 additions & 0 deletions schedule.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    # Schedule script for using whenever toghether with rbenv
    #
    # Whenever: https://github.com/javan/whenever
    # rbenv: https://github.com/sstephenson/rbenv

    set :env_path, '"$HOME/.rbenv/shims":"$HOME/.rbenv/bin"'

    # doesn't need modifications
    # job_type :command, ":task :output"

    job_type :rake, %q{ cd :path && PATH=:env_path:"$PATH" RAILS_ENV=:environment bundle exec rake :task --silent :output }
    job_type :runner, %q{ cd :path && PATH=:env_path:"$PATH" script/rails runner -e :environment ':task' :output }
    job_type :script, %q{ cd :path && PATH=:env_path:"$PATH" RAILS_ENV=:environment bundle exec script/:task :output }

    # tasks
    every 1.day, :at => Time.now + 1.minute do
    rake "my:task"
    runner "puts 'hello from runner'"
    script 'hello'
    end