short_message 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9590f6c08f0ffbfc791be4d7c3004d8e7a796736
4
- data.tar.gz: 2f3d4f988d1ee22ea52171585897fe72eeead03f
3
+ metadata.gz: 4d535fac6775fb6f8d7c3c72e487297fb79c735d
4
+ data.tar.gz: be81a206a9b2498a0ac011cbcaeca70d31aeb730
5
5
  SHA512:
6
- metadata.gz: 6aae932d5db425590da78981d0ca6fa0c10dfb24cf7075358a93be4e161ded5b08aa7b77308c650c47cc44ab1b9194b65e80ac573d8f4320a838f1fc312274a2
7
- data.tar.gz: 6f7705d081d0ec82146ebb419b0a8cf48ba7a1edfec8107f6f525f35ca4d8f404d8aa5e44e0665afc67d0b87cc980c0885657aada62be8cc9e088c2d17e2a4af
6
+ metadata.gz: 1c54fae79d7f988c911a7db607b3a24c034abbd42a3f35038d3619c9637b39507ab1414f8502fa0fd53e950950f7e0b6641b4b1bc94f2be53cd08531df5c5ab9
7
+ data.tar.gz: a7907a2d43c22ca773a3aa075a733226569efe0219f0a610fef38b0a34a694f0aede2f3d4144cb9633ea853267547e27c2c206690b77441e74f2c6b049ada21e
@@ -1,8 +1,9 @@
1
1
  module ShortMessage
2
2
  class Message < ActiveRecord::Base
3
3
  def deliver
4
- self.sender = ShortMessage.config.default_sms_sender if self.sender.blank?
4
+ deliver_method = Rails.version.to_f > 4.2 ? "deliver_now" : "deliver"
5
5
 
6
+ self.sender = ShortMessage.config.default_sms_sender if self.sender.blank?
6
7
  unless self.recipient.blank? and self.text.blank?
7
8
  http = Net::HTTP.new(ShortMessage.config.gateway_server, ShortMessage.config.gateway_port)
8
9
  if ShortMessage.config.gateway_port == Net::HTTP.https_default_port()
@@ -16,14 +17,14 @@ module ShortMessage
16
17
 
17
18
  if response_code == 200 or response_code == 402
18
19
  if response_code == 402 and not ShortMessage.config.reload_notification_email.blank?
19
- ShortMessage::Mailer.payment_required_notification(self, response).deliver_now
20
+ eval "ShortMessage::Mailer.payment_required_notification().#{deliver_method}"
20
21
  end
21
22
 
22
23
  self.message_key = result_set[2] unless result_set[2].blank?
23
24
  ActiveSupport::Notifications.instrument('short_message.delivered', options: { key: (result_set[2] unless result_set[2].blank?) })
24
25
  return self.save
25
26
  else
26
- ShortMessage::Mailer.error_notification(self, response).deliver_now unless ShortMessage.config.admin_notification_email.blank?
27
+ eval "ShortMessage::Mailer.error_notification(self, response).#{deliver_method}" unless ShortMessage.config.admin_notification_email.blank?
27
28
  end
28
29
  else
29
30
  return false
@@ -1,3 +1,3 @@
1
1
  module ShortMessage
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: short_message
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andi Saurer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-06-07 00:00:00.000000000 Z
11
+ date: 2016-10-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -95,6 +95,7 @@ files:
95
95
  - test/dummy/config/locales/en.yml
96
96
  - test/dummy/config/routes.rb
97
97
  - test/dummy/config/secrets.yml
98
+ - test/dummy/log/development.log
98
99
  - test/dummy/public/404.html
99
100
  - test/dummy/public/422.html
100
101
  - test/dummy/public/500.html
@@ -155,6 +156,7 @@ test_files:
155
156
  - test/dummy/config/routes.rb
156
157
  - test/dummy/config/secrets.yml
157
158
  - test/dummy/config.ru
159
+ - test/dummy/log/development.log
158
160
  - test/dummy/public/404.html
159
161
  - test/dummy/public/422.html
160
162
  - test/dummy/public/500.html