Created
June 17, 2011 01:04
-
-
Save kdonovan/1030667 to your computer and use it in GitHub Desktop.
Contents of the file apn_sender's generator puts in script/apn_sender (for those on Rails 3, where the generator isn't working yet)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Daemons sets pwd to /, so we have to explicitly set RAILS_ROOT | |
RAILS_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..')) | |
require 'rubygems' | |
require 'apn' | |
require 'apn/sender_daemon' | |
APN::SenderDaemon.new(ARGV).daemonize |
Thanks for this kdonovan!
I've been using the rake task with mixed success i'll try this out :)
before require we need add on more line
require File.expand_path('../../config/application', FILE)
or else it says no such file to load -- apn (LoadError)
what is the format for apn_sender ? apn_sender.rb ? or other ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
apn_sender's generator isn't yet Rails 3 compatible. In the meantime, follow these steps: