esendex4soap 0.4.28 → 0.4.30

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -2,7 +2,7 @@ source "http://rubygems.org"
2
2
  gem 'jruby-openssl' if defined?(JRUBY_VERSION)
3
3
  gem 'savon', '~> 0.9.7'
4
4
  gem 'log4r'
5
- gem 'rchardet'
5
+ gem 'wtf_lang'
6
6
  group :development do
7
7
  gem "shoulda", ">= 0"
8
8
  gem "bundler", "~> 1.0.0"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.28
1
+ 0.4.30
data/esendex4soap.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{esendex4soap}
8
- s.version = "0.4.28"
8
+ s.version = "0.4.30"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Voip Scout}]
12
- s.date = %q{2011-11-29}
12
+ s.date = %q{2011-11-30}
13
13
  s.description = %q{thanks to savon library}
14
14
  s.email = %q{voipscout@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -41,7 +41,7 @@ Gem::Specification.new do |s|
41
41
  s.add_runtime_dependency(%q<jruby-openssl>, [">= 0"])
42
42
  s.add_runtime_dependency(%q<savon>, ["~> 0.9.7"])
43
43
  s.add_runtime_dependency(%q<log4r>, [">= 0"])
44
- s.add_runtime_dependency(%q<rchardet>, [">= 0"])
44
+ s.add_runtime_dependency(%q<wtf_lang>, [">= 0"])
45
45
  s.add_development_dependency(%q<shoulda>, [">= 0"])
46
46
  s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
47
47
  s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
@@ -50,7 +50,7 @@ Gem::Specification.new do |s|
50
50
  s.add_dependency(%q<jruby-openssl>, [">= 0"])
51
51
  s.add_dependency(%q<savon>, ["~> 0.9.7"])
52
52
  s.add_dependency(%q<log4r>, [">= 0"])
53
- s.add_dependency(%q<rchardet>, [">= 0"])
53
+ s.add_dependency(%q<wtf_lang>, [">= 0"])
54
54
  s.add_dependency(%q<shoulda>, [">= 0"])
55
55
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
56
56
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
@@ -60,7 +60,7 @@ Gem::Specification.new do |s|
60
60
  s.add_dependency(%q<jruby-openssl>, [">= 0"])
61
61
  s.add_dependency(%q<savon>, ["~> 0.9.7"])
62
62
  s.add_dependency(%q<log4r>, [">= 0"])
63
- s.add_dependency(%q<rchardet>, [">= 0"])
63
+ s.add_dependency(%q<wtf_lang>, [">= 0"])
64
64
  s.add_dependency(%q<shoulda>, [">= 0"])
65
65
  s.add_dependency(%q<bundler>, ["~> 1.0.0"])
66
66
  s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
data/lib/esendex4soap.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  require 'savon'
3
3
  require 'log4r'
4
- require 'rchardet'
4
+ require 'wtf_lang'
5
5
 
6
6
  module Esendex
7
7
  class Client
@@ -35,22 +35,20 @@ module Esendex
35
35
 
36
36
  def send_message(recipient, text)
37
37
  text = text.lstrip.rstrip
38
- @log.debug "TO:#{recipient} text size:#{text.size}"
38
+ @log.debug "TO:#{recipient} text size:#{text.size} in #{text.full_lang} language"
39
39
 
40
- if CharDet.detect(text)['encoding'] == 'ascii'
40
+ unless text.full_lang == 'russian'
41
41
  sms_parts = text.scan(/.{610}/mu)
42
42
  sms_parts << text[sms_parts.to_s.size..text.size]
43
43
  @message_kind = 'Text'
44
44
  @log.debug "#{@message_kind}:#{text.scan(/./mu)} = #{text.size}. #{sms_parts.size} part/s."
45
45
  sms(recipient, sms_parts)
46
- elsif CharDet.detect(text)['encoding'] == 'utf-8'
46
+ else
47
47
  sms_parts = text.scan(/.{70}/mu)
48
48
  sms_parts << text[sms_parts.to_s.size..text.size]
49
49
  @message_kind = 'Unicode'
50
50
  @log.debug "#{@message_kind}:#{text.scan(/./mu)} != #{text.size}. #{sms_parts.size} part/s."
51
51
  sms(recipient, sms_parts)
52
- else
53
- @log.debug "Unsupported encoding: #{CharDet.detect(text)['encoding']}"
54
52
  end
55
53
  end
56
54
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: esendex4soap
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.4.28
5
+ version: 0.4.30
6
6
  platform: ruby
7
7
  authors:
8
8
  - Voip Scout
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-11-29 00:00:00 Z
13
+ date: 2011-11-30 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: jruby-openssl
@@ -46,7 +46,7 @@ dependencies:
46
46
  prerelease: false
47
47
  type: :runtime
48
48
  - !ruby/object:Gem::Dependency
49
- name: rchardet
49
+ name: wtf_lang
50
50
  version_requirements: &id004 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements: