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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 985dce18eafc6e06622c8a672931123ae5aeb37d
4
- data.tar.gz: c954e6c222a5fb423d5d276f4e7c01f8967df4c8
3
+ metadata.gz: 6e82409da47a52c1b80056d7cd697016cef0f436
4
+ data.tar.gz: 4bfb97dc403b5fd6ae8c5086f49f1a08d24f0a56
5
5
  SHA512:
6
- metadata.gz: 238745332733c7842fd5fced9f7dad943b20f5cb3bfabf0ffdf846bdf60fbf9e3ca0085a063b9f427d1cd0f6f9dcbd2313851c361a74231428424c1ea0bb021f
7
- data.tar.gz: dbbe55470f25238f424e880a1286c8e8d396f7997974d61bca482ffc5a3ae970830615674e7ccce791d1547e9fb93a26bf3438383253170c549a4b7759199181
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
- gem install sms-easy
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
- * (Optional) Modify sms-easy.yml in your config folder with your reply-to e-mail address.
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
- * Basic Ruby Use Case (non-Rails)
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 and updates by Preston Lee.
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 = nil)
26
- @@config = opts || YAML::load(File.open(File.join(File.dirname(__FILE__), '..', '..', '..', 'templates', 'sms-easy.yml')))
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
@@ -1,3 +1,3 @@
1
1
  module SMSEasy
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
data/test/test_helper.rb CHANGED
@@ -2,4 +2,3 @@ gem 'minitest'
2
2
  require 'minitest/autorun'
3
3
  require 'minitest/pride'
4
4
  require_relative File.join('..', 'lib', 'sms-easy.rb')
5
- SMSEasy::Client.configure
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sms-easy
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brendan G. Lim