smsc 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 877c3784c035cdc69765be007b2fbb3b4c26b994
4
+ data.tar.gz: 21f8d943c4d6e268e6fecfbb9b912592889c4953
5
+ SHA512:
6
+ metadata.gz: cc3dd36cbfa95ddf3fb79bfe530f96dd67b96c9c0ac5fbdd206b834ce70ca3abbef57f08ea06643b75aeaa4acb9fe2a12df3e323a4a234d6c603d14525fb0036
7
+ data.tar.gz: 7fcfb53372a0a98b75797a742eaa4c9beaf5737aa4c2c7568504040ac78ee6562d0e65641d7bc2195557960bb8de5171e39a80c0cf0faff211917ba84ded4f4b
data/lib/smsc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Smsc
2
- VERSION = "0.0.3"
2
+ VERSION = '0.0.4'
3
3
  end
data/lib/smsc.rb CHANGED
@@ -1,22 +1,23 @@
1
1
  require 'digest/md5'
2
- require 'httparty'
3
-
4
- require "smsc/sender"
5
- require "smsc/version"
2
+ require 'faraday'
6
3
 
7
4
  module Smsc
8
5
  class Sms
9
- attr_reader :login, :password, :charset
10
6
 
11
7
  def initialize(login, password, charset = 'utf-8')
12
8
  @login = login
13
9
  @password = Digest::MD5.hexdigest(password.to_s)
14
10
  @charset = charset
11
+ @connection = Faraday.new(url: 'https://smsc.ru') do |i|
12
+ i.request :url_encoded
13
+ i.response :logger
14
+ i.adapter Faraday.default_adapter
15
+ end
15
16
  end
16
17
 
17
18
  def message(message, phones)
18
- phones = phones.join(",")
19
- Smsc::Sender.post('https://smsc.ru/sys/send.php', :query => { :login => login, :psw => password, :phones => phones, :mes => message, :charset => charset })
19
+ @connection.post '/sys/send.php', { login: @login, psw: @password, phones: phones.join(','), mes: message, charset: @charset }
20
20
  end
21
+
21
22
  end
22
23
  end
data/smsc.gemspec CHANGED
@@ -19,5 +19,5 @@ Gem::Specification.new do |s|
19
19
  s.require_paths = ["lib"]
20
20
 
21
21
  # specify any dependencies here; for example:
22
- s.add_dependency "httparty", "~> 0.9.0"
22
+ s.add_dependency 'faraday', '~> 0.8.6'
23
23
  end
metadata CHANGED
@@ -1,32 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smsc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
5
- prerelease:
4
+ version: 0.0.4
6
5
  platform: ruby
7
6
  authors:
8
7
  - Andrey Voronkov
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-11-13 00:00:00.000000000 Z
11
+ date: 2013-03-19 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- name: httparty
14
+ name: faraday
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
21
- version: 0.9.0
19
+ version: 0.8.6
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
29
- version: 0.9.0
26
+ version: 0.8.6
30
27
  description: Simple client for sending SMS via smsc.ru
31
28
  email:
32
29
  - voronkovaa@gmail.com
@@ -39,32 +36,29 @@ files:
39
36
  - README.markdown
40
37
  - Rakefile
41
38
  - lib/smsc.rb
42
- - lib/smsc/sender.rb
43
39
  - lib/smsc/version.rb
44
40
  - smsc.gemspec
45
41
  homepage: http://github.com/Antiarchitect/smsc
46
42
  licenses: []
43
+ metadata: {}
47
44
  post_install_message:
48
45
  rdoc_options: []
49
46
  require_paths:
50
47
  - lib
51
48
  required_ruby_version: !ruby/object:Gem::Requirement
52
- none: false
53
49
  requirements:
54
- - - ! '>='
50
+ - - '>='
55
51
  - !ruby/object:Gem::Version
56
52
  version: '0'
57
53
  required_rubygems_version: !ruby/object:Gem::Requirement
58
- none: false
59
54
  requirements:
60
- - - ! '>='
55
+ - - '>='
61
56
  - !ruby/object:Gem::Version
62
57
  version: '0'
63
58
  requirements: []
64
59
  rubyforge_project: smsc
65
- rubygems_version: 1.8.24
60
+ rubygems_version: 2.0.0.rc.2
66
61
  signing_key:
67
- specification_version: 3
62
+ specification_version: 4
68
63
  summary: Simple client for sending SMS via smsc.ru
69
64
  test_files: []
70
- has_rdoc:
data/lib/smsc/sender.rb DELETED
@@ -1,5 +0,0 @@
1
- module Smsc
2
- class Sender
3
- include HTTParty
4
- end
5
- end