mfms 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5952e234d591d0dda733300371ace75d7c97dea4
4
- data.tar.gz: 3fbb182575f1c11e1e1ec6235e46e0fdd28086c7
3
+ metadata.gz: ae0f1baaa172885bd0fbad2c3bb3e5558a7e328b
4
+ data.tar.gz: 61cd20689633cac59eb61e8210be03155d2e888a
5
5
  SHA512:
6
- metadata.gz: b305c19a59b2b01fabf61b4ff3d8cb4556576e82ec0c317e7b984d9f391783a9a6032f9bf034162be50e3db1cb0b69ffc372a70ab7ae0e0bc1488e7509d5b6dd
7
- data.tar.gz: 88079a89c0a22bfa41d56943dc6895ac0c9a178cb48f6d0b85d9472bd712d465a6bb2c6bdf87c2a79ee0fb541def60ef2bd8f19ffda845f24bc2819e74cfe8da
6
+ metadata.gz: 34b82a1e2ce10bd3ffba47995eddbcf9b97669b467d9e85166f5f11a8a0963057d8d8420f715933b644d28f4ca5d0a551850e405dd3b1f684e3f67ab0d2f0cbb
7
+ data.tar.gz: d2249789f83bb6fc35c3ec05615876b8b384601a821ba7df26e40ee7867c1b31bc3e5db86b819f20c41faf60f758995fbddc4f496aa6c4feeabc61d721614e40
data/README.md CHANGED
@@ -34,6 +34,7 @@ Define settings:
34
34
  Initialize sms:
35
35
 
36
36
  sms = Mfms::SMS.new('phone','title','text') # initialize sms
37
+ sms = Mfms::SMS.new('phone','title','text',false) # last parameter overrides 'translit' option
37
38
 
38
39
  Send it and get sent sms id and dispatch code:
39
40
 
data/lib/mfms/sms.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  require 'net/http'
3
3
  require 'openssl'
4
4
  require 'uri'
5
- require 'translit'
5
+ require 'russian'
6
6
 
7
7
  module Mfms
8
8
  class SMS
@@ -10,11 +10,12 @@ module Mfms
10
10
  attr_accessor :phone, :subject, :message
11
11
  attr_reader :id, :status
12
12
 
13
- def initialize(phone, subject, message)
13
+ def initialize(phone, subject, message, translit = @@translit)
14
14
  @phone = phone
15
15
  @subject = subject
16
16
  @message = message
17
17
  @status = 'not-sent'
18
+ @translit = translit
18
19
 
19
20
  validate!
20
21
  end
@@ -89,11 +90,6 @@ module Mfms
89
90
  @status = status
90
91
  end
91
92
 
92
- # What for?
93
- # def to_json
94
- # {:url => "#{server}:#{port}#{url}", :sms_message => message}.to_json
95
- # end
96
-
97
93
  private
98
94
 
99
95
  def self.establish_connection
@@ -130,7 +126,7 @@ module Mfms
130
126
  end
131
127
 
132
128
  def send_url
133
- message = @@translit ? Translit.convert(@message) : @message
129
+ message = @translit ? Russian.translit(@message) : @message
134
130
  "/revoup/connector0/send?login=#{@@login}&password=#{@@password}&" +
135
131
  "subject[0]=#{@subject}&address[0]=#{@phone}&text[0]=#{URI.encode(message)}"
136
132
  end
data/lib/mfms/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Mfms
2
2
  class Version
3
3
  MAJOR = 0
4
- MINOR = 3
4
+ MINOR = 4
5
5
  PATCH = 0
6
6
 
7
7
  def self.to_s
data/mfms.gemspec CHANGED
@@ -16,5 +16,5 @@ Gem::Specification.new do |spec|
16
16
  spec.files = `git ls-files`.split($/)
17
17
  spec.require_paths = ["lib"]
18
18
 
19
- spec.add_dependency 'translit'
19
+ spec.add_dependency 'russian', '0.6.0'
20
20
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mfms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fokin Eugene
@@ -12,19 +12,19 @@ cert_chain: []
12
12
  date: 2014-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: translit
15
+ name: russian
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ">="
18
+ - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: '0'
20
+ version: 0.6.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ">="
25
+ - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: '0'
27
+ version: 0.6.0
28
28
  description: This library helps to send sms via mfms service
29
29
  email:
30
30
  - e.fokin@revoup.ru