pjit-sms_api 0.1.1 → 0.1.2
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 +4 -4
- data/README.md +7 -7
- data/Rakefile +2 -2
- data/bin/console +4 -4
- data/lib/sms_api.rb +34 -35
- data/lib/sms_api/version.rb +1 -1
- data/sms_api.gemspec +20 -19
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bd614f5c0e987391029e9738a2f31b8a2108366
|
4
|
+
data.tar.gz: 73ac927c40cfc30bba944b7783089380d975b687
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b36f2af8dd455e877727466ad7afc8d1676403027412e2a8345b665998fda1efac7ae6542b6b595b184b03f4a11d326dd758852a77e7455a549115ff4a41623
|
7
|
+
data.tar.gz: b7c14efeb72e72e6ff7e03cfbaaf7b4993b02ca86e86632fd60ee7f13054bf22f5efa5aef6eca12e70e853290b9aa6f17202efe8838a87039f31fdec2c84ced6
|
data/README.md
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
Add this line to your application's Gemfile:
|
6
6
|
|
7
7
|
```ruby
|
8
|
-
gem 'sms_api'
|
8
|
+
gem 'pjit-sms_api'
|
9
9
|
```
|
10
10
|
|
11
11
|
And then execute:
|
@@ -14,7 +14,7 @@ And then execute:
|
|
14
14
|
|
15
15
|
Or install it yourself as:
|
16
16
|
|
17
|
-
$ gem install sms_api
|
17
|
+
$ gem install pjit-sms_api
|
18
18
|
|
19
19
|
## Usage
|
20
20
|
|
@@ -28,14 +28,14 @@ Then you can use by passing SmsApi.send('[phone number]', '[message]')
|
|
28
28
|
|
29
29
|
For account status you can use SmsApi.status
|
30
30
|
In case you need specified value you can use as follows:
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
* SmsApi.status['points'] - for points count
|
32
|
+
* SmsApi.status['proCount'] - for pro messages count
|
33
|
+
* SmsApi.status['ecoCount'] - for default messages count
|
34
|
+
* SmsApi.status['mmsCount'] - for MMS count
|
35
35
|
|
36
36
|
## Contributing
|
37
37
|
|
38
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
38
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/pj-it/sms_api.
|
39
39
|
|
40
40
|
## License
|
41
41
|
|
data/Rakefile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require
|
2
|
-
task :
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
task default: 'spec'
|
data/bin/console
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
require
|
4
|
-
require
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'sms_api'
|
5
5
|
|
6
6
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
7
|
# with your gem easier. You can also use a different console, if you like.
|
8
8
|
|
9
9
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require
|
10
|
+
# require 'pry'
|
11
11
|
# Pry.start
|
12
12
|
|
13
|
-
require
|
13
|
+
require 'irb'
|
14
14
|
IRB.start
|
data/lib/sms_api.rb
CHANGED
@@ -1,40 +1,39 @@
|
|
1
|
-
require
|
1
|
+
require 'sms_api/version'
|
2
2
|
require 'httparty'
|
3
|
-
module SmsApi
|
4
|
-
|
5
|
-
include HTTParty
|
6
|
-
base_uri 'https://api.smsapi.pl'
|
7
|
-
default_params username: ENV['SMSAPI_USERNAME'], password: ENV['SMSAPI_MD5'],
|
8
|
-
format: 'json'#, test: test
|
9
|
-
format :json
|
10
3
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
get('/sms.do', query: { to: to, test: test, message: text})
|
23
|
-
end
|
4
|
+
##
|
5
|
+
# TODO
|
6
|
+
# DOTO
|
7
|
+
# dubidubidu
|
8
|
+
module SmsApi
|
9
|
+
include HTTParty
|
10
|
+
base_uri 'https://api.smsapi.pl'
|
11
|
+
default_params username: ENV['SMSAPI_USERNAME'],
|
12
|
+
password: ENV['SMSAPI_MD5'],
|
13
|
+
format: 'json'
|
14
|
+
format :json
|
24
15
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
16
|
+
##
|
17
|
+
# Method to send ECO messages
|
18
|
+
# usage: SmsApi.sms('MSISDN','message')
|
19
|
+
# Some details about response
|
20
|
+
# In response you will recive ['count'] of sended messages,
|
21
|
+
# "list" of messages, on list you have some extra data:
|
22
|
+
# "id" - message id, You can use it to grab message status,
|
23
|
+
# "points" - cost of operation, "error" - error code if will ocure
|
24
|
+
def self.sms(to, text)
|
25
|
+
test = ENV['SMSAPI_TEST'] || 0
|
26
|
+
get('/sms.do', query: { to: to, test: test, message: text })
|
27
|
+
end
|
36
28
|
|
37
|
-
|
38
|
-
|
39
|
-
|
29
|
+
##
|
30
|
+
# Method will give count avaliable count/messages on account
|
31
|
+
# In case you need specified value you can use as follows:
|
32
|
+
# SmsApi.status['points'] - for points count
|
33
|
+
# SmsApi.status['proCount'] - for pro messages count
|
34
|
+
# SmsApi.status['ecoCount'] - for default messages count
|
35
|
+
# SmsApi.status['mmsCount'] - for MMS count
|
36
|
+
def self.status
|
37
|
+
get('/user.do', query: { credits: 1, details: 1 })
|
38
|
+
end
|
40
39
|
end
|
data/lib/sms_api/version.rb
CHANGED
data/sms_api.gemspec
CHANGED
@@ -4,33 +4,34 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'sms_api/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'pjit-sms_api'
|
8
8
|
spec.version = SmsApi::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = ["piotr@jarosz.it"]
|
9
|
+
spec.authors = ['Piotr Jarosz']
|
11
10
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
11
|
+
spec.summary = 'www.SmsApi.pl gem'
|
12
|
+
spec.description = 'gem relates to API of SmsApi.pl'
|
13
|
+
spec.homepage = 'https://github.com/pj-it/sms_api'
|
14
|
+
spec.license = 'MIT'
|
16
15
|
|
17
|
-
# Prevent pushing this gem to RubyGems.org.
|
18
|
-
#
|
16
|
+
# Prevent pushing this gem to RubyGems.org.
|
17
|
+
# To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this
|
19
|
+
# section to allow pushing to any host.
|
19
20
|
if spec.respond_to?(:metadata)
|
20
|
-
spec.metadata['allowed_push_host'] =
|
21
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
21
22
|
else
|
22
|
-
raise
|
23
|
-
|
23
|
+
raise 'RubyGems 2.0 or newer is required to protect against ' \
|
24
|
+
'public gem pushes.'
|
24
25
|
end
|
25
26
|
|
26
|
-
spec.files
|
27
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
27
28
|
f.match(%r{^(test|spec|features)/})
|
28
29
|
end
|
29
|
-
spec.bindir
|
30
|
-
spec.executables
|
31
|
-
spec.require_paths = [
|
30
|
+
spec.bindir = 'exe'
|
31
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
32
|
+
spec.require_paths = ['lib']
|
32
33
|
|
33
|
-
spec.add_development_dependency
|
34
|
-
spec.add_development_dependency
|
35
|
-
spec.add_dependency
|
34
|
+
spec.add_development_dependency 'bundler', '~> 1.13'
|
35
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
36
|
+
spec.add_dependency 'httparty', '~> 0.14'
|
36
37
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pjit-sms_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Jarosz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -53,8 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0.14'
|
55
55
|
description: gem relates to API of SmsApi.pl
|
56
|
-
email:
|
57
|
-
- piotr@jarosz.it
|
56
|
+
email:
|
58
57
|
executables: []
|
59
58
|
extensions: []
|
60
59
|
extra_rdoc_files: []
|
@@ -69,7 +68,7 @@ files:
|
|
69
68
|
- lib/sms_api.rb
|
70
69
|
- lib/sms_api/version.rb
|
71
70
|
- sms_api.gemspec
|
72
|
-
homepage: https://github.com/
|
71
|
+
homepage: https://github.com/pj-it/sms_api
|
73
72
|
licenses:
|
74
73
|
- MIT
|
75
74
|
metadata:
|