mobily-sms 0.1.1 → 0.1.2

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: b91e45e374654a97077b61ab1d9f68d3872e2b45
4
- data.tar.gz: 51f4340dc61ef209a334cc13fb6dffa4134037d1
3
+ metadata.gz: f28796d0efc719885803fe174a20b191b0dad689
4
+ data.tar.gz: a065a1b07b0fa62a461821974be453a9a998f444
5
5
  SHA512:
6
- metadata.gz: 8be6e9d7782f92ee811cfac4a988963446b18b73a85dcfe5f9f5b35e9cd77401f9c58206c4bcc7e301f0d78e0459372ae263a34b3eeb704da5e33e1efdf721e9
7
- data.tar.gz: 1b4253fc629d2c64195b3ca1297ec8f238fa47e726bbd11608edfd680ce99fc468c91308e05da8568a6cc9432a4d3ab96ff821ca57613a8fdf309ca035a44c8d
6
+ metadata.gz: f678538a889c751a768e5956d1444f20bb7c3115698c6dc18db1138382aff5e1ab285e902f33c35391d9af9a92d9303672913278d6d62de0f41f3d85fef4e6cd
7
+ data.tar.gz: 7a0222124d0f0818623fd7464110fbb5c306a5acad807b457f63953c6e353a4e94f64c71cc7d75441cfa04e99c00401d5f8573eb2ba313396d9a51292b0c0b98
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mobily-sms (0.1.1)
4
+ mobily-sms (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -0,0 +1,11 @@
1
+ module Mobily
2
+ class Configuration
3
+ attr_accessor :username, :password, :smshost
4
+
5
+ def initialize
6
+ @username = nil
7
+ @password = nil
8
+ @smshost = nil
9
+ end
10
+ end
11
+ end
@@ -1,4 +1,6 @@
1
- require "mobily/sms/version"
1
+ require 'mobily/sms/version'
2
+ # require 'configuration'
3
+
2
4
  require_relative 'mobily_api_auth'
3
5
  require_relative 'mobily_account'
4
6
  require_relative 'mobily_sms'
@@ -8,17 +10,29 @@ require_relative 'mobily_api_error'
8
10
 
9
11
  class Sms
10
12
 
11
- USERNAME = Rails.application.secrets.mobilyws[:username]
12
- PASSWORD = Rails.application.secrets.mobilyws[:password]
13
- SMSHOST = Rails.application.secrets.mobilyws[:smshost]
13
+ # class << self
14
+ # attr_accessor :configuration
15
+ # end
16
+ #
17
+ # def self.configuration
18
+ # @configuration ||= Configuration.new
19
+ # end
20
+ #
21
+ # def self.reset
22
+ # @configuration = Configuration.new
23
+ # end
24
+ #
25
+ # def self.configure
26
+ # yield(configuration)
27
+ # end
14
28
 
15
29
  def self.send(recipient_mobile, message)
16
30
  if check_can_send
17
31
  begin
18
- sms = MobilySMS.new(MobilyApiAuth.new(USERNAME, PASSWORD))
32
+ sms = MobilySMS.new( $mobily_credentials )
19
33
  sms.add_number(recipient_mobile)
20
34
 
21
- sms.sender = SMSHOST
35
+ sms.sender = $smshost
22
36
 
23
37
  sms.msg = message
24
38
  sms.send
@@ -40,7 +54,7 @@ class Sms
40
54
  def self.schedule(mobile, password, recipient_mobile)
41
55
  sms = MobilySMS.new(MobilyApiAuth.new(mobile, password))
42
56
  sms.add_number(recipient_mobile)
43
- sms.sender = SMSHOST
57
+ sms.sender = $smshost
44
58
  sms.msg = 'Testing تجريب ^&**\nFrom Ruby, scheduled'
45
59
  sms.schedule_to_send_on(25, 12, 2020, 12, 0, 0)
46
60
  sms.delete_key = '666'
@@ -50,7 +64,7 @@ class Sms
50
64
  def self.send_formatted(mobile, password, recipient_one, recipient_two)
51
65
  auth = MobilyApiAuth.new(mobile, password)
52
66
  msg = 'Hi (1), your subscription will end on (2).'
53
- sms = MobilyFormattedSMS.new(auth, [recipient_one, recipient_two], SMSHOST)
67
+ sms = MobilyFormattedSMS.new(auth, [recipient_one, recipient_two], $smshost)
54
68
 
55
69
  sms.add_variable_for_number(recipient_one, '(1)', 'Martin')
56
70
  sms.add_variable_for_number(recipient_one, '(2)', '31/12/2017')
@@ -63,7 +77,7 @@ class Sms
63
77
  auth = MobilyApiAuth.new(mobile, password)
64
78
  msg = 'Hi (1), your subscription will end on (2)..'
65
79
 
66
- sms = MobilyFormattedSMS.new(auth, [recipient_one, recipient_two], SMSHOST, msg )
80
+ sms = MobilyFormattedSMS.new(auth, [recipient_one, recipient_two], $smshost, msg )
67
81
 
68
82
  sms.add_variable_for_number(recipient_one, '(1)', 'Lee')
69
83
  sms.add_variable_for_number(recipient_one, '(2)', '31/11/2019')
@@ -1,5 +1,5 @@
1
1
  module Mobily
2
2
  module Sms
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mobily-sms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - MaJeD BoJaN
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-04-30 00:00:00.000000000 Z
11
+ date: 2018-05-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -70,6 +70,7 @@ files:
70
70
  - Rakefile
71
71
  - bin/console
72
72
  - bin/setup
73
+ - lib/mobily/configuration.rb
73
74
  - lib/mobily/mobily_account.rb
74
75
  - lib/mobily/mobily_api_auth.rb
75
76
  - lib/mobily/mobily_api_error.rb