websms 0.0.2 → 0.0.3

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: a773716cbf4f45ededa7bcb9300425ad153bf413
4
- data.tar.gz: 3cc62629f2566fb6c8b0483e705728488a1ade68
3
+ metadata.gz: 7316a7da74d90c862c19ff0d7b6bd4fc304f8dae
4
+ data.tar.gz: a9e2dfc7b4feb7d9a612c3190521bc02ff7ffab5
5
5
  SHA512:
6
- metadata.gz: 680f157631d2762a85071f0e98fa953b9b232ed8841551f86dfc076a04b5e07b9a9be02666d375b5c42973089a33c6f7f22ff428fda52b36ea1e1d6523dea08d
7
- data.tar.gz: 24d57e4ae9eaaf22cc7081180b97d4a2fd11f10447db806a6356eb57831396311900ec8ac453041ee9e85843c85fd2c086aaf7693aa9efc24463412e1a526221
6
+ metadata.gz: 8a5a16963a1e2065f7c14eb3cf0e9e82b678e6f9ba65e898f90fe4e69b4631c46e7aa71f9b0748996f9f21132f42d46120213bfc3cad422ad51bb010f0a36383
7
+ data.tar.gz: 43b180772ad749c0432271c0339a92935ff7a870483a5f910ca200eca1c4a50dee1fc6ca825e5fc6829ca0a78d544a602bae6fa42a349a2fef535aaa3626d026
data/README.md CHANGED
@@ -24,6 +24,7 @@ Add into environments/environment.rb after app configuration
24
24
  c.api_user = 'your_user_name'
25
25
  c.api_password = 'your_api_password'
26
26
  c.client_id = '' # optional. If set will be shown first.
27
+ c.alfanum_from = 'YourFrom' # optional. To set from if you are using it.
27
28
  end
28
29
 
29
30
  When you need to send sms call
@@ -1,11 +1,13 @@
1
1
  class Configuration
2
2
  attr_accessor :api_user,
3
3
  :api_password,
4
- :client_id
4
+ :client_id,
5
+ :alfanum_from
5
6
 
6
7
  def initialize
7
8
  self.api_user = ''
8
9
  self.api_password = ''
9
10
  self.client_id = nil
11
+ self.alfanum_from = nil
10
12
  end
11
13
  end
data/lib/websms/sender.rb CHANGED
@@ -22,11 +22,13 @@ module Websms
22
22
  text = "#{c.client_id}: #{text}" if c.client_id
23
23
  etext = text.gsub(' ', '%20')
24
24
  etext = Iconv.conv('windows-1251', 'utf-8', etext)
25
+
26
+ from_phone = c.alfanum_from ? "&fromPhone=#{c.alfanum_from}" : ''
25
27
  # Send request
26
- request = "#{sms_gateway}?fromPhone=LocumRu&http_username=#{sms_user}&http_password=#{sms_password}&Phone_list=#{number}&Message=#{etext}"
28
+ request = "#{sms_gateway}?http_username=#{sms_user}&http_password=#{sms_password}#{from_phone}&Phone_list=#{number}&Message=#{etext}"
27
29
  c = Curl::Easy.perform(request)
28
30
  end
29
31
 
30
32
  end
31
33
 
32
- end
34
+ end
@@ -1,3 +1,3 @@
1
1
  module Websms
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: websms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasily Shmelev