active_sms-backend-smsru 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e467e3ad2270fcb9f66e8ff728d3c85b5194aa8
4
- data.tar.gz: c7e4572149278bde54f54b57c42ca741a7d3b781
3
+ metadata.gz: 3a047be97d7e0d28c4a51d27e57bbbdc102e5a7c
4
+ data.tar.gz: ca835b0507aaceb77884fa0f7fca11edc530bb65
5
5
  SHA512:
6
- metadata.gz: 43f564d661b0e144229b95b91d92cae6e0f258c973c56935516dade32be030f94dfd4082049a7cc0ac191e3f0b9ebc7814924e6ad34827f0d9ab2382d828ce9d
7
- data.tar.gz: f9a3a2ed680bd8f469f1579d44953d536dbe9c542ced0bac93d866950531973f3a392366ba69632e3f5e32d16a363994bf46820c81784fbb814e59e53724c331
6
+ metadata.gz: 5c1aecbaa9afaef2fd422352f62261c2688bbd6e28c3dc6788d4ad50b1699dc84cba8a5622f2d04d990e51e8820f92ca2daabb6ff3b4056c63443de5f45b85b9
7
+ data.tar.gz: f7ab855e111e35abf56bb1cae61c1057d0240d1ee60f2cce0f812913a12001669587038895b022da131fb8fcf23baa475d37489391960d8ca0e950f71210fe6b
data/README.md CHANGED
@@ -1,19 +1,83 @@
1
1
  # ActiveSMS sms.ru backend
2
2
 
3
- backend for [ActiveSMS](https://github.com/Fedcomp/active_sms) to work with [sms.ru](https://sms.ru)
3
+ [![Build Status](https://travis-ci.org/Fedcomp/active_sms-backend-smsru.svg?branch=master)](https://travis-ci.org/Fedcomp/active_sms-backend-smsru)
4
+ [![Gem Version](https://badge.fury.io/rb/active_sms-backend-smsru.svg)](https://badge.fury.io/rb/active_sms-backend-smsru)
4
5
 
5
- ## Installation
6
+ backend for [ActiveSMS](https://github.com/Fedcomp/active_sms) to work with [sms.ru](https://sms.ru)
6
7
 
7
- To be done.
8
+ ## Installation and usage
8
9
 
9
- ## Usage
10
+ Add this line to your application's Gemfile:
10
11
 
11
- To be done.
12
+ ```ruby
13
+ gem "active_sms"
14
+ gem "active_sms-backend-smsru"
15
+ ```
16
+
17
+ Then somewhere in your initialization code:
18
+
19
+ ```ruby
20
+ require "active_sms"
21
+
22
+ ActiveSMS.configure do |c|
23
+ c.register_backend :my_main_backend,
24
+ ActiveSMS::Backend::Smsru,
25
+ api_id: ENV["SMSRU_TOKEN"]
26
+
27
+ c.default_backend = :my_main_backend
28
+ end
29
+ ```
30
+
31
+ Now, whenever you need to send SMS, just do:
32
+
33
+ ```ruby
34
+ phone = "799999999"
35
+ text = "My sms text"
36
+
37
+ # Should actually send sms
38
+ ActiveSMS.send_sms("79999999999", "text")
39
+ ```
40
+
41
+ For more advanced usage please
42
+ go to [ActiveSMS documentation](https://github.com/Fedcomp/active_sms#real-life-example)
43
+
44
+ **Don't forget**, you need to put real *api_id* in SMSRU_TOKEN environment variable.
45
+ In bash you would do it like that:
46
+ ```bash
47
+ export SMSRU_TOKEN "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
48
+ ```
49
+ Read below how to receive own token to work with sms.ru.
50
+
51
+ # Receiving api_id from sms.ru
52
+
53
+ First of all, you should register on https://sms.ru/ .
54
+ Then, when you are registered, make sure you have
55
+ some small amount of balance to actually send sms.
56
+ On your main page (when you are logged)
57
+ you should see:
58
+
59
+ ![api_id block at the right](screenshot.png)
60
+
61
+ instead of XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX you should see your actual api_id key.
12
62
 
13
63
  ## Contributing
14
64
 
15
- Bug reports and pull requests are welcome on GitHub at https://github.com/fedcomp/active_sms-backend-smsru.
65
+ Bug reports and pull requests are
66
+ welcome on GitHub at https://github.com/Fedcomp/active_sms-backend-smsru
67
+
68
+ ## Submitting a Pull Request
69
+ 1. Fork the [official repository](https://github.com/Fedcomp/active_sms-backend-smsru).
70
+ 2. Create a topic branch.
71
+ 3. Implement your feature or bug fix.
72
+ 4. Add, commit, and push your changes.
73
+ 5. Submit a pull request.
74
+
75
+ * Please add tests if you changed code. Contributions without tests won't be accepted.
76
+ * If you don't know how to add tests, please put in a PR and leave a comment
77
+ asking for help.
78
+ * Please don't update the Gem version.
16
79
 
80
+ ( Inspired by https://github.com/thoughtbot/factory_girl/blob/master/CONTRIBUTING.md )
17
81
 
18
82
  ## License
19
83
 
@@ -0,0 +1,2 @@
1
+ # missing file for gem to work with autoloading
2
+ require "active_sms/backend/smsru"
@@ -1,4 +1,5 @@
1
1
  require "net/http"
2
+ require "bigdecimal"
2
3
  require "bigdecimal/util"
3
4
  require "active_sms"
4
5
 
@@ -1,6 +1,6 @@
1
1
  # rubocop:disable Style/ClassAndModuleChildren
2
2
  module ActiveSMS
3
3
  module Backend
4
- SMSRU_VERSION = "0.0.2".freeze
4
+ SMSRU_VERSION = "0.0.3".freeze
5
5
  end
6
6
  end
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_sms-backend-smsru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fedcomp
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-10-11 00:00:00.000000000 Z
11
+ date: 2016-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_sms
@@ -153,8 +153,10 @@ files:
153
153
  - README.md
154
154
  - Rakefile
155
155
  - active_sms-backend-smsru.gemspec
156
+ - lib/active_sms-backend-smsru.rb
156
157
  - lib/active_sms/backend/smsru.rb
157
158
  - lib/active_sms/backend/smsru/version.rb
159
+ - screenshot.png
158
160
  homepage: https://github.com/Fedcomp/active_sms-backend-smsru
159
161
  licenses:
160
162
  - MIT