nofxx-activesms 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +17 -0
- data/CHANGELOG +5 -0
- data/History.txt +25 -0
- data/License.txt +22 -0
- data/MIT-LICENSE +22 -0
- data/Manifest.txt +56 -0
- data/README.txt +54 -0
- data/Rakefile +16 -0
- data/activesms.gemspec +36 -0
- data/config/hoe.rb +78 -0
- data/config/requirements.rb +15 -0
- the PDU format.webarchive +0 -0
- data/generators/sms/USAGE +20 -0
- data/generators/sms/sms_generator.rb +35 -0
- data/generators/sms/templates/fixture.rhtml +1 -0
- data/generators/sms/templates/model.rb +19 -0
- data/generators/sms/templates/sms.yml +103 -0
- data/generators/sms/templates/unit_test.rb +31 -0
- data/init.rb +4 -0
- data/lib/activesms.rb +79 -0
- data/lib/activesms/adv_attr_accessor.rb +32 -0
- data/lib/activesms/base.rb +249 -0
- data/lib/activesms/config.rb +20 -0
- data/lib/activesms/connection_adapters/abstract_adapter.rb +52 -0
- data/lib/activesms/connection_adapters/bulk_sms_adapter.rb +67 -0
- data/lib/activesms/connection_adapters/clickatell_adapter.rb +51 -0
- data/lib/activesms/connection_adapters/human_adapter.rb +174 -0
- data/lib/activesms/connection_adapters/simplewire_adapter.rb +73 -0
- data/lib/activesms/connections.rb +63 -0
- data/lib/activesms/email.rb +60 -0
- data/lib/activesms/exceptions.rb +35 -0
- data/lib/activesms/sms.rb +9 -0
- data/lib/activesms/sms2email.rb +21 -0
- data/lib/activesms/validations.rb +86 -0
- data/lib/activesms/version.rb +9 -0
- data/lib/activesms/views/active_sms/sms2_email/sms_message.html.erb +1 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +82 -0
- data/setup.rb +1585 -0
- data/spec/activesms/base_spec.rb +11 -0
- data/spec/activesms/connection_adapters/abstract_adapter_spec.rb +30 -0
- data/spec/activesms/connection_adapters/human_adapter_spec.rb +38 -0
- data/spec/activesms/connection_adapters/simplewire_spec.rb +75 -0
- data/spec/activesms/email_spec.rb +72 -0
- data/spec/activesms/sms2email_spec.rb +31 -0
- data/spec/activesms/sms_spec.rb +31 -0
- data/spec/activesms_spec.rb +15 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +57 -0
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/rspec.rake +21 -0
- data/views/active_sms/base/sms2_email/sms_message.html.erb +1 -0
- metadata +130 -0
data/.autotest
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# #
|
2
|
+
# SMS AUTOTEST
|
3
|
+
#
|
4
|
+
#require 'autotest/growl'
|
5
|
+
#require 'autotest/html_report'
|
6
|
+
# require 'autotest/kdenotify'
|
7
|
+
require 'autotest/menu'
|
8
|
+
#require 'autotest/pretty'
|
9
|
+
require 'autotest/redgreen'
|
10
|
+
# require 'autotest/snarl'
|
11
|
+
require 'autotest/timestamp'
|
12
|
+
|
13
|
+
module Autotest::Growl
|
14
|
+
Autotest.add_hook :initialize do |at|
|
15
|
+
%w{.svn .hg .git .DS_store}.each {|exception|at.add_exception(exception)}
|
16
|
+
end
|
17
|
+
end
|
data/CHANGELOG
ADDED
data/History.txt
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
=== 0.6.6 / 2008-07-22
|
2
|
+
|
3
|
+
* 1 major enhancement
|
4
|
+
* Birthday! (ActiveSMS fork)
|
5
|
+
|
6
|
+
=== 0.7.7 / 2008-07-22
|
7
|
+
|
8
|
+
* 1 major enhancement
|
9
|
+
* Human Gateway Support Added
|
10
|
+
|
11
|
+
=== 0.8.7 / 2008-07-23
|
12
|
+
|
13
|
+
* 1 major enhancement
|
14
|
+
* Added email adapter
|
15
|
+
|
16
|
+
* 3 minor enhancement
|
17
|
+
* Updated gem stuff (newgem)
|
18
|
+
* Added gemspec
|
19
|
+
* Updated generators
|
20
|
+
|
21
|
+
=== 0.8.8 / 2008-07-23
|
22
|
+
|
23
|
+
* 1 minor enhancement
|
24
|
+
* Generator support ":type" ie.: signup:human
|
25
|
+
|
data/License.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2008 Robert Cottrell, Brendan G. Lim (brendangl@gmail.com),
|
2
|
+
Marcos Piccinini, Cássio Marques
|
3
|
+
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2008 Robert Cottrell, Brendan G. Lim (brendangl@gmail.com),
|
2
|
+
Marcos Piccinini, Cássio Marques
|
3
|
+
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOa AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SaALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/Manifest.txt
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
.autotest
|
2
|
+
CHANGELOG
|
3
|
+
History.txt
|
4
|
+
License.txt
|
5
|
+
MIT-LICENSE
|
6
|
+
Manifest.txt
|
7
|
+
README.txt
|
8
|
+
Rakefile
|
9
|
+
activesms.gemspec
|
10
|
+
config/hoe.rb
|
11
|
+
config/requirements.rb
|
12
|
+
docs/SMS messages and the PDU format.webarchive
|
13
|
+
generators/sms/USAGE
|
14
|
+
generators/sms/sms_generator.rb
|
15
|
+
generators/sms/templates/fixture.rhtml
|
16
|
+
generators/sms/templates/model.rb
|
17
|
+
generators/sms/templates/sms.yml
|
18
|
+
generators/sms/templates/unit_test.rb
|
19
|
+
init.rb
|
20
|
+
lib/activesms.rb
|
21
|
+
lib/activesms/adv_attr_accessor.rb
|
22
|
+
lib/activesms/base.rb
|
23
|
+
lib/activesms/config.rb
|
24
|
+
lib/activesms/connection_adapters/abstract_adapter.rb
|
25
|
+
lib/activesms/connection_adapters/bulk_sms_adapter.rb
|
26
|
+
lib/activesms/connection_adapters/clickatell_adapter.rb
|
27
|
+
lib/activesms/connection_adapters/human_adapter.rb
|
28
|
+
lib/activesms/connection_adapters/simplewire_adapter.rb
|
29
|
+
lib/activesms/connections.rb
|
30
|
+
lib/activesms/email.rb
|
31
|
+
lib/activesms/exceptions.rb
|
32
|
+
lib/activesms/sms.rb
|
33
|
+
lib/activesms/sms2email.rb
|
34
|
+
lib/activesms/validations.rb
|
35
|
+
lib/activesms/version.rb
|
36
|
+
lib/activesms/views/active_sms/sms2_email/sms_message.html.erb
|
37
|
+
script/console
|
38
|
+
script/destroy
|
39
|
+
script/generate
|
40
|
+
script/txt2html
|
41
|
+
setup.rb
|
42
|
+
spec/activesms/base_spec.rb
|
43
|
+
spec/activesms/connection_adapters/abstract_adapter_spec.rb
|
44
|
+
spec/activesms/connection_adapters/human_adapter_spec.rb
|
45
|
+
spec/activesms/connection_adapters/simplewire_spec.rb
|
46
|
+
spec/activesms/email_spec.rb
|
47
|
+
spec/activesms/sms2email_spec.rb
|
48
|
+
spec/activesms/sms_spec.rb
|
49
|
+
spec/activesms_spec.rb
|
50
|
+
spec/spec.opts
|
51
|
+
spec/spec_helper.rb
|
52
|
+
tasks/deployment.rake
|
53
|
+
tasks/environment.rake
|
54
|
+
tasks/rspec.rake
|
55
|
+
tasks/website.rake
|
56
|
+
views/active_sms/base/sms2_email/sms_message.html.erb
|
data/README.txt
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
== SMS Brasil
|
2
|
+
|
3
|
+
* http://github.com/nofxx/activesms
|
4
|
+
|
5
|
+
|
6
|
+
== DESCRIPTION:
|
7
|
+
|
8
|
+
Baseado no ActiveSMS (http://rubyforge.org/projects/activesms) esse projeto visa facilitar o envio de mensagens SMS para operadoras de telefonia celular do Brasil, utilizando serviços de gateway de envio.
|
9
|
+
|
10
|
+
|
11
|
+
== FEATURES:
|
12
|
+
|
13
|
+
= Gateways:
|
14
|
+
|
15
|
+
* BulkSMS[http://www.bulksms.com]
|
16
|
+
* Clickatell[http://www.clickatell.com]
|
17
|
+
* Human[http://www.human.com.br]
|
18
|
+
* Simplewire[http://www.simplewire.com] (requires jruby)
|
19
|
+
|
20
|
+
|
21
|
+
= Email carriers:
|
22
|
+
|
23
|
+
* Brasil, US
|
24
|
+
* Germany, UK, Austria
|
25
|
+
* Japan
|
26
|
+
|
27
|
+
|
28
|
+
== REQUIREMENTS:
|
29
|
+
|
30
|
+
* ActionMailer (for email gateways)
|
31
|
+
|
32
|
+
|
33
|
+
== INSTALL:
|
34
|
+
|
35
|
+
gem sources -a http://gems.github.com
|
36
|
+
sudo gem install nofxx-activesms
|
37
|
+
|
38
|
+
|
39
|
+
== USAGE:
|
40
|
+
|
41
|
+
cd some_rails_app
|
42
|
+
script/generate sms Notifier signup:email forgot_password:gateway signoff:human
|
43
|
+
|
44
|
+
script/console
|
45
|
+
sms = Notifier.create_signup
|
46
|
+
Notifer.deliver(sms)
|
47
|
+
|
48
|
+
|
49
|
+
== LICENSE:
|
50
|
+
|
51
|
+
(The MIT License)
|
52
|
+
|
53
|
+
Copyright (c) 2008 Robert Cottrell (ActiveSms), Brendan G. Lim (SMSFu) (brendangl@gmail.com),
|
54
|
+
Marcos Piccinini, Cássio Marques (sms_brasil)
|
data/Rakefile
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'rake'
|
3
|
+
require 'rake/clean'
|
4
|
+
require 'rake/testtask'
|
5
|
+
require 'rake/packagetask'
|
6
|
+
require 'rake/gempackagetask'
|
7
|
+
require 'rake/rdoctask'
|
8
|
+
require 'rake/contrib/rubyforgepublisher'
|
9
|
+
require 'fileutils'
|
10
|
+
|
11
|
+
# Added 07/2008 newgem <<<
|
12
|
+
require 'config/requirements'
|
13
|
+
require 'config/hoe' # setup Hoe + all gem configuration
|
14
|
+
|
15
|
+
Dir['tasks/**/*.rake'].each { |rake| load rake }
|
16
|
+
# <<<
|
data/activesms.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = %q{activesms}
|
3
|
+
s.version = "0.9.0"
|
4
|
+
|
5
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
6
|
+
s.authors = ["Robert Cottrell", "Marcos Piccinini", "Ben Curren", "Dean Mao"]
|
7
|
+
s.date = %q{2008-09-09}
|
8
|
+
s.description = %q{Active SMS is a framework for sending and receiving SMS messages}
|
9
|
+
s.email = ["rgcottrell@rubyforge.org", "x@nofxx.com", "ben@esomnie.com", "dean@esomnie.com"]
|
10
|
+
s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "README.txt"]
|
11
|
+
s.files = [".autotest", "CHANGELOG", "History.txt", "License.txt", "MIT-LICENSE", "Manifest.txt", "README.txt", "Rakefile", "activesms.gemspec", "config/hoe.rb", "config/requirements.rb", "docs/SMS messages and the PDU format.webarchive", "generators/sms/USAGE", "generators/sms/sms_generator.rb", "generators/sms/templates/fixture.rhtml", "generators/sms/templates/model.rb", "generators/sms/templates/sms.yml", "generators/sms/templates/unit_test.rb", "init.rb", "lib/activesms.rb", "lib/activesms/adv_attr_accessor.rb", "lib/activesms/base.rb", "lib/activesms/config.rb", "lib/activesms/connection_adapters/abstract_adapter.rb", "lib/activesms/connection_adapters/bulk_sms_adapter.rb", "lib/activesms/connection_adapters/clickatell_adapter.rb", "lib/activesms/connection_adapters/human_adapter.rb", "lib/activesms/connection_adapters/simplewire_adapter.rb", "lib/activesms/connections.rb", "lib/activesms/email.rb", "lib/activesms/exceptions.rb", "lib/activesms/sms.rb", "lib/activesms/sms2email.rb", "lib/activesms/validations.rb", "lib/activesms/version.rb", "lib/activesms/views/active_sms/sms2_email/sms_message.html.erb", "script/console", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "spec/activesms/base_spec.rb", "spec/activesms/connection_adapters/abstract_adapter_spec.rb", "spec/activesms/connection_adapters/human_adapter_spec.rb", "spec/activesms/connection_adapters/simplewire_spec.rb", "spec/activesms/email_spec.rb", "spec/activesms/sms2email_spec.rb", "spec/activesms/sms_spec.rb", "spec/activesms_spec.rb", "spec/spec.opts", "spec/spec_helper.rb", "tasks/deployment.rake", "tasks/environment.rake", "tasks/rspec.rake", "tasks/website.rake", "views/active_sms/base/sms2_email/sms_message.html.erb"]
|
12
|
+
s.has_rdoc = true
|
13
|
+
s.homepage = %q{http://github.com/nofxx/activesms}
|
14
|
+
s.post_install_message = %q{
|
15
|
+
For more information on activesms, see http://github.com/nofxx/activesms
|
16
|
+
|
17
|
+
}
|
18
|
+
s.rdoc_options = ["--main", "README.txt"]
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
s.rubyforge_project = %q{activesms}
|
21
|
+
s.rubygems_version = %q{1.2.0}
|
22
|
+
s.summary = %q{Active SMS is a framework for sending and receiving SMS messages}
|
23
|
+
|
24
|
+
if s.respond_to? :specification_version then
|
25
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
26
|
+
s.specification_version = 2
|
27
|
+
|
28
|
+
if current_version >= 3 then
|
29
|
+
s.add_development_dependency(%q<hoe>, [">= 1.7.0"])
|
30
|
+
else
|
31
|
+
s.add_dependency(%q<hoe>, [">= 1.7.0"])
|
32
|
+
end
|
33
|
+
else
|
34
|
+
s.add_dependency(%q<hoe>, [">= 1.7.0"])
|
35
|
+
end
|
36
|
+
end
|
data/config/hoe.rb
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'activesms/version'
|
2
|
+
|
3
|
+
AUTHOR = ['Robert Cottrell', 'Ben Curren', 'Dean Mao'] # can also be an array of Authors
|
4
|
+
EMAIL = ['rgcottrell@rubyforge.org', 'ben@esomnie.com', 'dean@esomnie.com']
|
5
|
+
DESCRIPTION = "Active SMS is a framework for sending and receiving SMS messages"
|
6
|
+
GEM_NAME = 'activesms' # what ppl will type to install your gem
|
7
|
+
RUBYFORGE_PROJECT = 'activesms' # The unix name for your project
|
8
|
+
HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
|
9
|
+
DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
|
10
|
+
|
11
|
+
|
12
|
+
EXTRA_DEPENDENCIES = [
|
13
|
+
# ['activesupport', '>= 1.3.1']
|
14
|
+
] # An array of rubygem dependencies [name, version]
|
15
|
+
|
16
|
+
@config_file = "~/.rubyforge/user-config.yml"
|
17
|
+
@config = nil
|
18
|
+
RUBYFORGE_USERNAME = "nofxx"
|
19
|
+
def rubyforge_username
|
20
|
+
unless @config
|
21
|
+
begin
|
22
|
+
@config = YAML.load(File.read(File.expand_path(@config_file)))
|
23
|
+
rescue
|
24
|
+
puts <<-EOS
|
25
|
+
ERROR: No rubyforge config file found: #{@config_file}
|
26
|
+
Run 'rubyforge setup' to prepare your env for access to Rubyforge
|
27
|
+
- See http://newgem.rubyforge.org/rubyforge.html for more details
|
28
|
+
EOS
|
29
|
+
exit
|
30
|
+
end
|
31
|
+
end
|
32
|
+
RUBYFORGE_USERNAME.replace @config["username"]
|
33
|
+
end
|
34
|
+
|
35
|
+
REV = nil
|
36
|
+
# UNCOMMENT IF REQUIRED:
|
37
|
+
# REV = YAML.load(`svn info`)['Revision']
|
38
|
+
VERS = ActiveSms::VERSION::STRING + (REV ? ".#{REV}" : "")
|
39
|
+
RDOC_OPTS = ['--quiet', '--title', 'activesms documentation',
|
40
|
+
"--opname", "index.html",
|
41
|
+
"--line-numbers",
|
42
|
+
"--main", "README",
|
43
|
+
"--inline-source"]
|
44
|
+
|
45
|
+
class Hoe
|
46
|
+
def extra_deps
|
47
|
+
@extra_deps.reject! { |x| Array(x).first == 'hoe' }
|
48
|
+
@extra_deps
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# Generate all the Rake tasks
|
53
|
+
# Run 'rake -T' to see list of generated tasks (from gem root directory)
|
54
|
+
$hoe = Hoe.new(GEM_NAME, VERS) do |p|
|
55
|
+
# bug with hoe?
|
56
|
+
#p.developer(AUTHOR, EMAIL)
|
57
|
+
p.author = AUTHOR
|
58
|
+
p.email = EMAIL
|
59
|
+
# <<
|
60
|
+
p.description = DESCRIPTION
|
61
|
+
p.summary = DESCRIPTION
|
62
|
+
p.url = HOMEPATH
|
63
|
+
p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
|
64
|
+
p.test_globs = ["test/**/test_*.rb"]
|
65
|
+
p.clean_globs |= ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store'] #An array of file patterns to delete on clean.
|
66
|
+
|
67
|
+
# == Optional
|
68
|
+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
|
69
|
+
#p.extra_deps = EXTRA_DEPENDENCIES
|
70
|
+
|
71
|
+
#p.spec_extras = {} # A hash of extra values to set in the gemspec.
|
72
|
+
end
|
73
|
+
|
74
|
+
CHANGES = $hoe.paragraphs_of('History.txt', 0..1).join("\\n\\n")
|
75
|
+
PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
|
76
|
+
$hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
|
77
|
+
$hoe.rsync_args = '-av --delete --ignore-errors'
|
78
|
+
$hoe.spec.post_install_message = File.open(File.dirname(__FILE__) + "/../PostInstall.txt").read rescue ""
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'fileutils'
|
2
|
+
include FileUtils
|
3
|
+
|
4
|
+
require 'rubygems'
|
5
|
+
%w[rake hoe newgem rubigen].each do |req_gem|
|
6
|
+
begin
|
7
|
+
require req_gem
|
8
|
+
rescue LoadError
|
9
|
+
puts "This Rakefile requires the '#{req_gem}' RubyGem."
|
10
|
+
puts "Installation: gem install #{req_gem} -y"
|
11
|
+
exit
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
$:.unshift(File.join(File.dirname(__FILE__), %w[.. lib]))
|
Binary file
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Active SMS Generator
|
2
|
+
|
3
|
+
Description:
|
4
|
+
The SMS generator creates stubs for a new SMS model.
|
5
|
+
|
6
|
+
The generator takes an SMS model name and a list of SMS methods as
|
7
|
+
arguments. The model name may be given in CamelCase or under_score.
|
8
|
+
|
9
|
+
The generator creates an SMS model class in app/models and a test suite
|
10
|
+
with fixtures in test/unit.
|
11
|
+
|
12
|
+
Example:
|
13
|
+
./script/generate sms Notifier signup:email forgot_password:gateway
|
14
|
+
|
15
|
+
This will create a Nofier SMS class:
|
16
|
+
Config: config/sms.yml
|
17
|
+
Model: app/models/notifier.rb
|
18
|
+
Test: test/unit/notifier_test.rb
|
19
|
+
Fixtures: test/fixtures/notifier/signup
|
20
|
+
test/fixtures/notifier/forgot_password
|
@@ -0,0 +1,35 @@
|
|
1
|
+
class SmsGenerator < Rails::Generator::NamedBase
|
2
|
+
def manifest
|
3
|
+
record do |m|
|
4
|
+
# Check for class naming collisions.
|
5
|
+
m.class_collisions class_path, class_name, "#{class_name}Test"
|
6
|
+
|
7
|
+
# Create model, view, test, and fixture directories.
|
8
|
+
m.directory File.join('app/models', class_path)
|
9
|
+
m.directory File.join('test/unit', class_path)
|
10
|
+
m.directory File.join('test/fixtures', file_path)
|
11
|
+
|
12
|
+
# Create model class and unit test.
|
13
|
+
# TODO: ugly hack in model.rb to make delivery only :gateway
|
14
|
+
# fix when we got multiple gw connections
|
15
|
+
m.template "model.rb", File.join('app/models',
|
16
|
+
class_path,
|
17
|
+
"#{file_name}.rb")
|
18
|
+
m.template "unit_test.rb", File.join('test/unit',
|
19
|
+
class_path,
|
20
|
+
"#{file_name}_test.rb")
|
21
|
+
m.template "sms.yml", File.join('config',
|
22
|
+
class_path,
|
23
|
+
"sms.yml")
|
24
|
+
# Create fixture for each action.
|
25
|
+
actions.each do |action|
|
26
|
+
relative_path = File.join(file_path, action.split(':')[0])
|
27
|
+
fixture_path = File.join('test/fixtures', relative_path)
|
28
|
+
|
29
|
+
m.template "fixture.rhtml", fixture_path,
|
30
|
+
:assigns => { :action => action, :path => fixture_path }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= class_name %>#<%= action.split(':')[0] %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
class <%= class_name %> < ActiveSms::Base
|
2
|
+
<% actions.each do |action| -%>
|
3
|
+
|
4
|
+
def <%= action.split(':')[0] %>
|
5
|
+
@delivery = <%= ":#{action.split(':')[1] == 'human' ? 'gateway' : action.split(':')[1]}"%>
|
6
|
+
<%- if action.split(':')[1] == 'email' -%>
|
7
|
+
@carrier = ''
|
8
|
+
<%- end -%>
|
9
|
+
@recipients = ''
|
10
|
+
@from = ''
|
11
|
+
@body = "<%= class_name %>#<%= action %>"
|
12
|
+
<%- if action.split(':')[1] == 'human' -%>
|
13
|
+
@id = ''
|
14
|
+
@schedule = ''
|
15
|
+
<%- end -%>
|
16
|
+
@options = {}
|
17
|
+
end
|
18
|
+
<% end -%>
|
19
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
# #
|
2
|
+
# GENERAL
|
3
|
+
#
|
4
|
+
#
|
5
|
+
config:
|
6
|
+
from_address: noreply@domain.com
|
7
|
+
|
8
|
+
# #
|
9
|
+
# GATEWAYS
|
10
|
+
#
|
11
|
+
# Uncomment the gateways you wish to use:
|
12
|
+
|
13
|
+
# HUMAN (human.com.br)
|
14
|
+
#
|
15
|
+
# gateway:
|
16
|
+
# adapter: human
|
17
|
+
# callbackOption: 1
|
18
|
+
# account: xxxxxx
|
19
|
+
# password: xxxxxxxxx
|
20
|
+
|
21
|
+
# CLICKATELL (clickatell.com)
|
22
|
+
#
|
23
|
+
# gateway:
|
24
|
+
# adapter: clickatell
|
25
|
+
# user: beavis
|
26
|
+
# pass: xxxxxx
|
27
|
+
|
28
|
+
# #
|
29
|
+
# EMAIL 2 SMS CARRIERS
|
30
|
+
#
|
31
|
+
# Please share if you know more carriers
|
32
|
+
# http://github.com/nofxx/activesms
|
33
|
+
carriers:
|
34
|
+
# #
|
35
|
+
# Brasil
|
36
|
+
claro: @clarotorpedo.com.br
|
37
|
+
tim: @tim.com.br
|
38
|
+
oi: @sms.oi.com.br
|
39
|
+
vivo: @vivomail.com.br
|
40
|
+
# #
|
41
|
+
# Germany
|
42
|
+
e-plus-germany: @smsmail.eplus.de
|
43
|
+
o2-germany: @o2online.de
|
44
|
+
t-mobile-germany: @t-d1-sms.de
|
45
|
+
vodafone-germany: @vodafone-sms.de
|
46
|
+
# #
|
47
|
+
# Canada
|
48
|
+
fido-canada: @fido.ca
|
49
|
+
# #
|
50
|
+
# Netherlands
|
51
|
+
orange-netherlands: @sms.orange.nl
|
52
|
+
# #
|
53
|
+
# Austria
|
54
|
+
t-mobile-austria: @sms.t-mobile.at
|
55
|
+
# #
|
56
|
+
# Italy
|
57
|
+
vodafone-italy: @sms.vodafone.it
|
58
|
+
# #
|
59
|
+
# Japan
|
60
|
+
vodafone-jp-chuugoku: @n.vodafone.ne.jp
|
61
|
+
vodafone-jp-hokkaido: @d.vodafone.ne.jp
|
62
|
+
vodafone-jp-hokuriko: @r.vodafone.ne.jp
|
63
|
+
vodafone-jp-kansai: @k.vodafone.ne.jp
|
64
|
+
vodafone-jp-osaka: @k.vodafone.ne.jp
|
65
|
+
vodafone-jp-kanto: @k.vodafone.ne.jp
|
66
|
+
vodafone-jp-koushin: @k.vodafone.ne.jp
|
67
|
+
vodafone-jp-tokyo: @k.vodafone.ne.jp
|
68
|
+
vodafone-jp-kyuushu: @q.vodafone.ne.jp
|
69
|
+
vodafone-jp-okinawa: @q.vodafone.ne.jp
|
70
|
+
vodafone-jp-shikoku: @s.vodafone.ne.jp
|
71
|
+
vodafone-jp-touhoku: @h.vodafone.ne.jp
|
72
|
+
vodafone-jp-niigata: @h.vodafone.ne.jp
|
73
|
+
vodafone-jp-toukai: @h.vodafone.ne.jp
|
74
|
+
# #
|
75
|
+
# Spain
|
76
|
+
vodafone-spain: @vodafone.es
|
77
|
+
telefonica-spain: @movistar.net
|
78
|
+
# #
|
79
|
+
# UK
|
80
|
+
orange-uk: @orange.net
|
81
|
+
o2-uk: @mmail.co.uk
|
82
|
+
vodafone-uk: @sms.vodafone.net
|
83
|
+
t-mobile-uk: @t-mobile.uk.net
|
84
|
+
# #
|
85
|
+
# US
|
86
|
+
alltell: @message.alltell.com
|
87
|
+
ameritech: @paging.acswireless.com
|
88
|
+
at&t: @txt.att.net
|
89
|
+
bellsouthmobility: @blsdcs.net
|
90
|
+
blueskyfrog: @blueskyfrog.com
|
91
|
+
boost: @myboostmobile.com
|
92
|
+
cellularsouth: @csouth1.com
|
93
|
+
kajeet: @mobile.kajeet.net
|
94
|
+
metropcs: @mymetropcs.com
|
95
|
+
powertel: @ptel.net
|
96
|
+
pscwireless: @sms.pscel.com
|
97
|
+
qwest: @qwestmp.com
|
98
|
+
southernlink: @page.southernlinc.com
|
99
|
+
sprint: @messaging.sprintpcs.com
|
100
|
+
suncom: @tms.suncom.com
|
101
|
+
t-mobile: @tmomail.net
|
102
|
+
virgin: @vmobl.net
|
103
|
+
verizon: @vtext.com
|