sms-easy 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +26 -11
- data/lib/sms/easy/easy.rb +4 -4
- data/lib/sms/easy/version.rb +1 -1
- data/test/test_helper.rb +0 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e82409da47a52c1b80056d7cd697016cef0f436
|
4
|
+
data.tar.gz: 4bfb97dc403b5fd6ae8c5086f49f1a08d24f0a56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b657c4f527ba261a4385d67c6bd7e023f2b4f05ba1ef67a4674db6e5ceb787999773c100a1f3f49313a8508e11d82c37f768c7e1420b22864cf9bd24f8b0271
|
7
|
+
data.tar.gz: 92558a58cfa8c719cd08a68a0abae349ab45a86c77766cecb5a33eef878ef545784e69c774a672906f7765c1e3fadafcc2642065fa4c022375d65cf522f5de66
|
data/README.rdoc
CHANGED
@@ -2,6 +2,9 @@
|
|
2
2
|
|
3
3
|
SMSEasy allows you to send SMS messages from your Ruby application for free using email-to-text services provided by many carriers.
|
4
4
|
|
5
|
+
This is largely based on Brendan Lim's sms-fu for older apps. (https://github.com/brendanlim/sms-fu) If you're replacing sms-fu, SMSEasy is very similar, but not identical, and does not support legacy versions of activerecord.
|
6
|
+
|
7
|
+
|
5
8
|
== Supported Carriers (US & International):
|
6
9
|
|
7
10
|
Alltel, Ameritech, AT&T, Bell Atlantic, BellSouth Mobility, Beeline(UA), BlueSkyFrog,
|
@@ -23,15 +26,12 @@ limitation. Some of these carriers are include, Mobitel, Etisalat, T-Mobile (Ne
|
|
23
26
|
|
24
27
|
== Setup Instructions
|
25
28
|
|
26
|
-
* Install sms-easy gem
|
29
|
+
* Install the sms-easy gem:
|
27
30
|
|
28
|
-
|
29
|
-
|
30
|
-
* Add sms-easy.yml to your config folder (Rails only)
|
31
|
+
gem install sms-easy
|
31
32
|
|
32
|
-
http://github.com/preston/sms-easy/blob/master/templates/sms-easy.yml
|
33
33
|
|
34
|
-
|
34
|
+
|
35
35
|
|
36
36
|
== Numbers and Carriers
|
37
37
|
|
@@ -55,8 +55,24 @@ limitation. Some of these carriers are include, Mobitel, Etisalat, T-Mobile (Ne
|
|
55
55
|
|
56
56
|
== Usage
|
57
57
|
|
58
|
-
|
59
|
-
|
58
|
+
* Basic Rails Configuration
|
59
|
+
|
60
|
+
# Override the default "from" address with config/initializers/sms-easy.rb
|
61
|
+
SMSEasy::Client.config['form_address'] = "noreply@example.com"
|
62
|
+
|
63
|
+
# Or, you can completely copy sms-easy.yml to your app (http://github.com/preston/sms-easy/blob/master/templates/sms-easy.yml), change it to your liking, and override the default configuration with:
|
64
|
+
|
65
|
+
SMSEasy::Client.configure(YAML.load(...))
|
66
|
+
|
67
|
+
# Your apps existing ActionMailer configuration will be used. :)
|
68
|
+
|
69
|
+
# Create the client
|
70
|
+
easy = SMSEasy::Client.new
|
71
|
+
|
72
|
+
# Deliver a simple message.
|
73
|
+
easy.deliver("5551234567", "verizon", "Hey!")
|
74
|
+
|
75
|
+
* Basic Ruby (non-Rails) Use Case (non-Rails)
|
60
76
|
|
61
77
|
#SMSEasy will use actionmailer's default configuration, which can be overriden if needed:
|
62
78
|
ActionMailer::Base.smtp_settings = {
|
@@ -78,8 +94,7 @@ limitation. Some of these carriers are include, Mobitel, Etisalat, T-Mobile (Ne
|
|
78
94
|
# Deliver a simple message.
|
79
95
|
easy.deliver("5551234567", "verizon", "Hey!")
|
80
96
|
|
81
|
-
|
82
|
-
# TO set a custom from e-mail per SMS message:
|
97
|
+
# To set a custom from e-mail per SMS message:
|
83
98
|
easy.deliver("5551234567", "verizon", "Sup.", :from => "bob@test.com")
|
84
99
|
|
85
100
|
# You can set the maximum length of the SMS message, which is not set by default. Most phones can only accept 128 characters. To do this just specify the limit option.
|
@@ -120,4 +135,4 @@ I want to thank the following individuals with their help with adding some patch
|
|
120
135
|
|
121
136
|
Copyright (c) 2010 Brendan G. Lim, Intridea, Inc., released under the MIT license
|
122
137
|
|
123
|
-
Additional modifications
|
138
|
+
Additional modifications, updates, refactorings etc. by Preston Lee.
|
data/lib/sms/easy/easy.rb
CHANGED
@@ -2,7 +2,7 @@ module SMSEasy
|
|
2
2
|
|
3
3
|
class Client
|
4
4
|
|
5
|
-
@@config =
|
5
|
+
@@config = YAML::load(File.open(File.join(File.dirname(__FILE__), '..', '..', '..', 'templates', 'sms-easy.yml')))
|
6
6
|
|
7
7
|
# Delivers the SMS message in the form of an e-mail
|
8
8
|
# sms-easy.deliver("1234567890","at&t","hello world")
|
@@ -22,8 +22,8 @@ module SMSEasy
|
|
22
22
|
end
|
23
23
|
|
24
24
|
class << self
|
25
|
-
def configure(opts =
|
26
|
-
@@config
|
25
|
+
def configure(opts = {})
|
26
|
+
@@config.merge!(opts)
|
27
27
|
# require 'pp'
|
28
28
|
# pp @@@@config
|
29
29
|
end
|
@@ -31,7 +31,7 @@ module SMSEasy
|
|
31
31
|
def config
|
32
32
|
@@config
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
# Returns back a list of all carriers
|
36
36
|
# SMSEasy.carriers
|
37
37
|
def carriers
|
data/lib/sms/easy/version.rb
CHANGED
data/test/test_helper.rb
CHANGED