smsc 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +5 -0
- data/Gemfile +4 -0
- data/Rakefile +1 -0
- data/lib/smsc.rb +22 -0
- data/lib/smsc/sender.rb +5 -0
- data/lib/smsc/version.rb +3 -0
- data/smsc.gemspec +25 -0
- metadata +63 -0
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/lib/smsc.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'httparty'
|
2
|
+
|
3
|
+
require "smsc/sender"
|
4
|
+
require "smsc/version"
|
5
|
+
|
6
|
+
module Smsc
|
7
|
+
class Sms
|
8
|
+
attr_reader :login, :password, :charset
|
9
|
+
|
10
|
+
def initialize(login, password, charset = 'utf-8')
|
11
|
+
@login = login
|
12
|
+
@password = password
|
13
|
+
@charset = charset
|
14
|
+
end
|
15
|
+
|
16
|
+
def message(message, phones)
|
17
|
+
message = message
|
18
|
+
phones = phones.map { |p| p }.join(",")
|
19
|
+
Smsc::Sender.post('https://smsc.ru/sys/send.php', :query => { :login => login, :psw => password, :phones => phones, :mes => message, :charset => charset })
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/smsc/sender.rb
ADDED
data/lib/smsc/version.rb
ADDED
data/smsc.gemspec
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "smsc/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "smsc"
|
7
|
+
s.version = Smsc::VERSION
|
8
|
+
s.authors = ["Andrey Voronkov"]
|
9
|
+
s.email = ["voronkovaa@gmail.com"]
|
10
|
+
s.homepage = "http://github.com/Antiarchitect/smsc"
|
11
|
+
s.summary = %q{Simple client for sending SMS via smsc.ru}
|
12
|
+
s.description = %q{Simple client for sending SMS via smsc.ru}
|
13
|
+
|
14
|
+
s.rubyforge_project = "smsc"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
# specify any dependencies here; for example:
|
22
|
+
# s.add_development_dependency "rspec"
|
23
|
+
# s.add_runtime_dependency "rest-client"
|
24
|
+
s.add_dependency "httparty", "~> 0.8.1"
|
25
|
+
end
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: smsc
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Andrey Voronkov
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2011-11-02 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: httparty
|
16
|
+
requirement: &9517760 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.8.1
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *9517760
|
25
|
+
description: Simple client for sending SMS via smsc.ru
|
26
|
+
email:
|
27
|
+
- voronkovaa@gmail.com
|
28
|
+
executables: []
|
29
|
+
extensions: []
|
30
|
+
extra_rdoc_files: []
|
31
|
+
files:
|
32
|
+
- .gitignore
|
33
|
+
- Gemfile
|
34
|
+
- Rakefile
|
35
|
+
- lib/smsc.rb
|
36
|
+
- lib/smsc/sender.rb
|
37
|
+
- lib/smsc/version.rb
|
38
|
+
- smsc.gemspec
|
39
|
+
homepage: http://github.com/Antiarchitect/smsc
|
40
|
+
licenses: []
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options: []
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
none: false
|
47
|
+
requirements:
|
48
|
+
- - ! '>='
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0'
|
51
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
|
+
none: false
|
53
|
+
requirements:
|
54
|
+
- - ! '>='
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0'
|
57
|
+
requirements: []
|
58
|
+
rubyforge_project: smsc
|
59
|
+
rubygems_version: 1.8.10
|
60
|
+
signing_key:
|
61
|
+
specification_version: 3
|
62
|
+
summary: Simple client for sending SMS via smsc.ru
|
63
|
+
test_files: []
|