Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Removed rails 3 deprecations

  • Loading branch information...
commit 23b13c2cadb9f49d8f434ec3ac42c3e392d51701 1 parent 56af72b
@ramigg authored
View
8 README
@@ -123,21 +123,21 @@ APN on Rails has the following default configurations that you change as you see
configatron.apn.passphrase # => ''
configatron.apn.port # => 2195
configatron.apn.host # => 'gateway.sandbox.push.apple.com'
- configatron.apn.cert #=> File.join(RAILS_ROOT, 'config', 'apple_push_notification_development.pem')
+ configatron.apn.cert #=> File.join(::Rails.root, 'config', 'apple_push_notification_development.pem')
# production (delivery):
configatron.apn.host # => 'gateway.push.apple.com'
- configatron.apn.cert #=> File.join(RAILS_ROOT, 'config', 'apple_push_notification_production.pem')
+ configatron.apn.cert #=> File.join(::Rails.root, 'config', 'apple_push_notification_production.pem')
# development (feedback):
configatron.apn.feedback.passphrase # => ''
configatron.apn.feedback.port # => 2196
configatron.apn.feedback.host # => 'feedback.sandbox.push.apple.com'
- configatron.apn.feedback.cert #=> File.join(RAILS_ROOT, 'config', 'apple_push_notification_development.pem')
+ configatron.apn.feedback.cert #=> File.join(::Rails.root, 'config', 'apple_push_notification_development.pem')
# production (feedback):
configatron.apn.feedback.host # => 'feedback.push.apple.com'
- configatron.apn.feedback.cert #=> File.join(RAILS_ROOT, 'config', 'apple_push_notification_production.pem')
+ configatron.apn.feedback.cert #=> File.join(::Rails.root, 'config', 'apple_push_notification_production.pem')
That's it, now you're ready to start creating notifications.
View
8 README.textile
@@ -141,21 +141,21 @@ see fit:
configatron.apn.passphrase # => ''
configatron.apn.port # => 2195
configatron.apn.host # => 'gateway.sandbox.push.apple.com'
- configatron.apn.cert #=> File.join(RAILS_ROOT, 'config', 'apple_push_notification_development.pem')
+ configatron.apn.cert #=> File.join(::Rails.root, 'config', 'apple_push_notification_development.pem')
# production (delivery):
configatron.apn.host # => 'gateway.push.apple.com'
- configatron.apn.cert #=> File.join(RAILS_ROOT, 'config', 'apple_push_notification_production.pem')
+ configatron.apn.cert #=> File.join(::Rails.root, 'config', 'apple_push_notification_production.pem')
# development (feedback):
configatron.apn.feedback.passphrase # => ''
configatron.apn.feedback.port # => 2196
configatron.apn.feedback.host # => 'feedback.sandbox.push.apple.com'
- configatron.apn.feedback.cert #=> File.join(RAILS_ROOT, 'config', 'apple_push_notification_development.pem')
+ configatron.apn.feedback.cert #=> File.join(::Rails.root, 'config', 'apple_push_notification_development.pem')
# production (feedback):
configatron.apn.feedback.host # => 'feedback.push.apple.com'
- configatron.apn.feedback.cert #=> File.join(RAILS_ROOT, 'config', 'apple_push_notification_production.pem')
+ configatron.apn.feedback.cert #=> File.join(::Rails.root, 'config', 'apple_push_notification_production.pem')
</pre></code>
That's it, now you're ready to start creating notifications.
View
8 lib/apn_on_rails/apn_on_rails.rb
@@ -3,13 +3,13 @@
require 'configatron'
rails_root = File.join(FileUtils.pwd, 'rails_root')
-if defined?(RAILS_ROOT)
- rails_root = RAILS_ROOT
+if defined?(::Rails.root)
+ rails_root = ::Rails.root
end
rails_env = 'development'
-if defined?(RAILS_ENV)
- rails_env = RAILS_ENV
+if defined?(::Rails.env)
+ rails_env = ::Rails.env
end
configatron.apn.set_default(:passphrase, '')
View
2  lib/apn_on_rails/app/models/apn/app.rb
@@ -8,7 +8,7 @@ class APN::App < APN::Base
has_many :unsent_group_notifications, :through => :groups
def cert
- (RAILS_ENV == 'production' ? apn_prod_cert : apn_dev_cert)
+ (::Rails.env.production? ? apn_prod_cert : apn_dev_cert)
end
# Opens a connection to the Apple APN server and attempts to batch deliver
Please sign in to comment.
Something went wrong with that request. Please try again.