clickatell 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -3
- data/Manifest.txt +1 -0
- data/README.txt +6 -1
- data/Rakefile +7 -0
- data/bin/sms +0 -3
- data/lib/clickatell/api.rb +5 -1
- data/lib/clickatell/api/command.rb +2 -1
- data/lib/clickatell/api/command_executor.rb +13 -3
- data/lib/clickatell/utility/options.rb +6 -1
- data/lib/clickatell/version.rb +1 -1
- data/spec/api_spec.rb +39 -8
- data/website/index.html +17 -5
- data/website/index.txt +5 -1
- data/website/specs.html +277 -0
- metadata +3 -2
data/History.txt
CHANGED
@@ -1,11 +1,12 @@
|
|
1
|
+
== 0.4.1
|
2
|
+
* Custom alphanumeric sender would not always be supported by default unless it was explicitly enabled using the req_feat parameter.
|
3
|
+
|
1
4
|
== 0.4.0
|
2
5
|
|
3
6
|
* Added API debug mode and --debug option to sms utility
|
4
7
|
* Restructured API classes into individual files
|
5
8
|
* Refactored command execution into a separate object (CommandExecutor).
|
6
|
-
* Major refactoring of API module - converted it to a class with API methods
|
7
|
-
implemented as instance methods. Code is much cleaner and Connection class
|
8
|
-
becomes redundant. See updated documentation.
|
9
|
+
* Major refactoring of API module - converted it to a class with API methods implemented as instance methods. Code is much cleaner and Connection class becomes redundant. See updated documentation.
|
9
10
|
|
10
11
|
== 0.3.0
|
11
12
|
|
data/Manifest.txt
CHANGED
@@ -28,6 +28,7 @@ website/index.txt
|
|
28
28
|
website/javascripts/codehighlighter/code_highlighter.js
|
29
29
|
website/javascripts/codehighlighter/ruby.js
|
30
30
|
website/javascripts/rounded_corners_lite.inc.js
|
31
|
+
website/specs.html
|
31
32
|
website/stylesheets/limechoc.css
|
32
33
|
website/stylesheets/rdoc.css
|
33
34
|
website/stylesheets/screen.css
|
data/README.txt
CHANGED
@@ -33,4 +33,9 @@ You can then use the sms utility to send a message to a single recipient:
|
|
33
33
|
|
34
34
|
Run +sms+ without any arguments for a full list of options.
|
35
35
|
|
36
|
-
See http://clickatell.rubyforge.org for further instructions.
|
36
|
+
See http://clickatell.rubyforge.org for further instructions.
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
data/Rakefile
CHANGED
@@ -91,6 +91,7 @@ task :website_generate do
|
|
91
91
|
Dir['website/**/*.txt'].each do |txt|
|
92
92
|
sh %{ ruby scripts/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
|
93
93
|
end
|
94
|
+
sh "rake -s spec:html > website/specs.html"
|
94
95
|
end
|
95
96
|
|
96
97
|
desc 'Upload website files to rubyforge'
|
@@ -149,6 +150,12 @@ namespace :spec do
|
|
149
150
|
t.spec_opts = ['--format', "specdoc"]
|
150
151
|
t.spec_files = FileList['spec/*_spec.rb']
|
151
152
|
end
|
153
|
+
|
154
|
+
desc "Run the specs in HTML format"
|
155
|
+
Spec::Rake::SpecTask.new('html') do |t|
|
156
|
+
t.spec_opts = ['--format', "html"]
|
157
|
+
t.spec_files = FileList['spec/*_spec.rb']
|
158
|
+
end
|
152
159
|
end
|
153
160
|
|
154
161
|
desc "Default task is to run specs"
|
data/bin/sms
CHANGED
@@ -16,9 +16,6 @@ end
|
|
16
16
|
# parse command line options
|
17
17
|
options = Clickatell::Utility::Options.parse(ARGV)
|
18
18
|
|
19
|
-
# enable debugging if specified
|
20
|
-
Clickatell::API.debug_mode = true if options.debugging_enabled
|
21
|
-
|
22
19
|
# authenticate and load the API
|
23
20
|
api = Clickatell::API.authenticate(options.api_key, options.username, options.password)
|
24
21
|
|
data/lib/clickatell/api.rb
CHANGED
@@ -17,6 +17,9 @@ module Clickatell
|
|
17
17
|
|
18
18
|
# Set to true to enable debugging (off by default)
|
19
19
|
attr_accessor :debug_mode
|
20
|
+
|
21
|
+
# Enable secure mode (SSL)
|
22
|
+
attr_accessor :secure_mode
|
20
23
|
end
|
21
24
|
|
22
25
|
# Creates a new API instance using the specified +auth options+.
|
@@ -58,6 +61,7 @@ module Clickatell
|
|
58
61
|
# Returns a new message ID if successful.
|
59
62
|
def send_message(recipient, message_text, opts={})
|
60
63
|
valid_options = opts.only(:from)
|
64
|
+
valid_options.merge!(:req_feat => '48') if valid_options[:from]
|
61
65
|
response = execute_command('sendmsg',
|
62
66
|
{:to => recipient, :text => message_text}.merge(valid_options)
|
63
67
|
)
|
@@ -79,7 +83,7 @@ module Clickatell
|
|
79
83
|
|
80
84
|
protected
|
81
85
|
def execute_command(command_name, parameters={}) #:nodoc:
|
82
|
-
CommandExecutor.new(auth_hash, self.class.debug_mode).execute(command_name, parameters)
|
86
|
+
CommandExecutor.new(auth_hash, self.class.secure_mode, self.class.debug_mode).execute(command_name, parameters)
|
83
87
|
end
|
84
88
|
|
85
89
|
def parse_response(raw_response) #:nodoc:
|
@@ -20,7 +20,8 @@ module Clickatell
|
|
20
20
|
protected
|
21
21
|
def api_service_uri
|
22
22
|
protocol = @options[:secure] ? 'https' : 'http'
|
23
|
-
|
23
|
+
port = @options[:secure] ? 443 : 80
|
24
|
+
return "#{protocol}://#{API_SERVICE_HOST}:#{port}/http/"
|
24
25
|
end
|
25
26
|
end
|
26
27
|
|
@@ -1,13 +1,15 @@
|
|
1
1
|
require 'net/http'
|
2
|
+
require 'net/https'
|
2
3
|
|
3
4
|
module Clickatell
|
4
5
|
class API
|
5
6
|
|
6
7
|
# Used to run commands agains the Clickatell gateway.
|
7
8
|
class CommandExecutor
|
8
|
-
def initialize(authentication_hash, debug=false)
|
9
|
+
def initialize(authentication_hash, secure=false, debug=false)
|
9
10
|
@authentication_hash = authentication_hash
|
10
11
|
@debug = debug
|
12
|
+
@secure = secure
|
11
13
|
end
|
12
14
|
|
13
15
|
# Builds a command object and sends it using HTTP GET.
|
@@ -16,15 +18,23 @@ module Clickatell
|
|
16
18
|
def execute(command_name, parameters={})
|
17
19
|
request_uri = command(command_name, parameters)
|
18
20
|
puts "[debug] Sending request to #{request_uri}" if @debug
|
19
|
-
|
21
|
+
get_response(request_uri).first
|
20
22
|
end
|
21
23
|
|
22
24
|
protected
|
23
25
|
def command(command_name, parameters) #:nodoc:
|
24
|
-
Command.new(command_name).with_params(
|
26
|
+
Command.new(command_name, :secure => @secure).with_params(
|
25
27
|
parameters.merge(@authentication_hash)
|
26
28
|
)
|
27
29
|
end
|
30
|
+
|
31
|
+
def get_response(uri)
|
32
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
33
|
+
http.use_ssl = (uri.scheme == 'https')
|
34
|
+
http.start do |http|
|
35
|
+
resp, body = http.get([uri.path, uri.query].join('?'))
|
36
|
+
end
|
37
|
+
end
|
28
38
|
end
|
29
39
|
|
30
40
|
end
|
@@ -44,8 +44,13 @@ module Clickatell
|
|
44
44
|
@options.show_status = true
|
45
45
|
end
|
46
46
|
|
47
|
+
opts.on('-S', '--secure',
|
48
|
+
"Sends request using HTTPS") do
|
49
|
+
Clickatell::API.secure_mode = true
|
50
|
+
end
|
51
|
+
|
47
52
|
opts.on('-d', '--debug') do
|
48
|
-
|
53
|
+
Clickatell::API.debug_mode = true
|
49
54
|
end
|
50
55
|
|
51
56
|
opts.on_tail('-h', '--help', "Show this message") do
|
data/lib/clickatell/version.rb
CHANGED
data/spec/api_spec.rb
CHANGED
@@ -33,9 +33,25 @@ module Clickatell
|
|
33
33
|
describe "Command executor" do
|
34
34
|
it "should create an API command with auth params and send it via HTTP get, returning the raw http response" do
|
35
35
|
executor = API::CommandExecutor.new(:session_id => '12345')
|
36
|
-
API::Command.should_receive(:new).with('cmdname').and_return(cmd=mock('command'))
|
37
|
-
|
38
|
-
|
36
|
+
API::Command.should_receive(:new).with('cmdname', :secure => false).and_return(cmd=mock('command'))
|
37
|
+
uri = stub('uri', :host => 'example.com', :port => 80, :scheme => 'http', :path => '/foo/bar', :query => 'a=b')
|
38
|
+
cmd.should_receive(:with_params).with(:param_one => 'foo', :session_id => '12345').and_return(uri)
|
39
|
+
Net::HTTP.should_receive(:new).with('example.com', 80).and_return(transport=mock('http'))
|
40
|
+
transport.should_receive(:use_ssl=).with(false)
|
41
|
+
transport.should_receive(:start).and_yield(yielded_transport=mock('http'))
|
42
|
+
yielded_transport.should_receive(:get).with('/foo/bar?a=b').and_return(raw_response=mock('http response'))
|
43
|
+
executor.execute('cmdname', :param_one => 'foo').should == raw_response
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should create a secure API command and send command using HTTPS if secure is true" do
|
47
|
+
executor = API::CommandExecutor.new({:session_id => '12345'}, secure=true)
|
48
|
+
API::Command.should_receive(:new).with('cmdname', :secure => true).and_return(cmd=mock('command'))
|
49
|
+
uri = stub('uri', :host => 'example.com', :port => 443, :scheme => 'https', :path => '/foo/bar', :query => 'a=b')
|
50
|
+
cmd.should_receive(:with_params).with(:param_one => 'foo', :session_id => '12345').and_return(uri)
|
51
|
+
Net::HTTP.should_receive(:new).with('example.com', 443).and_return(transport=mock('http'))
|
52
|
+
transport.should_receive(:use_ssl=).with(true)
|
53
|
+
transport.should_receive(:start).and_yield(yielded_transport=mock('http'))
|
54
|
+
yielded_transport.should_receive(:get).with('/foo/bar?a=b').and_return(raw_response=mock('http response'))
|
39
55
|
executor.execute('cmdname', :param_one => 'foo').should == raw_response
|
40
56
|
end
|
41
57
|
end
|
@@ -43,7 +59,8 @@ module Clickatell
|
|
43
59
|
describe "API" do
|
44
60
|
before do
|
45
61
|
API.debug_mode = false
|
46
|
-
API
|
62
|
+
API.secure_mode = false
|
63
|
+
API::CommandExecutor.should_receive(:new).with({:session_id => '1234'}, false, false).and_return(@executor = mock('command executor'))
|
47
64
|
@api = API.new(:session_id => '1234')
|
48
65
|
end
|
49
66
|
|
@@ -71,11 +88,12 @@ module Clickatell
|
|
71
88
|
@api.send_message('4477791234567', 'hello world').should == 'message_id'
|
72
89
|
end
|
73
90
|
|
74
|
-
it "should support sending messages with custom
|
91
|
+
it "should support sending messages with custom sender, passing the appropriate feature mask, returning the message id" do
|
75
92
|
@executor.should_receive(:execute).with('sendmsg',
|
76
93
|
:to => '4477791234567',
|
77
94
|
:text => 'hello world',
|
78
|
-
:from => 'LUKE'
|
95
|
+
:from => 'LUKE',
|
96
|
+
:req_feat => '48'
|
79
97
|
).and_return(response=mock('response'))
|
80
98
|
Response.should_receive(:parse).with(response).and_return('ID' => 'message_id')
|
81
99
|
@api.send_message('4477791234567', 'hello world', :from => 'LUKE')
|
@@ -85,7 +103,8 @@ module Clickatell
|
|
85
103
|
@executor.should_receive(:execute).with('sendmsg',
|
86
104
|
:to => '4477791234567',
|
87
105
|
:text => 'hello world',
|
88
|
-
:from => 'LUKE'
|
106
|
+
:from => 'LUKE',
|
107
|
+
:req_feat => '48'
|
89
108
|
).and_return(response=mock('response'))
|
90
109
|
Response.stub!(:parse).and_return('ID' => 'foo')
|
91
110
|
@api.send_message('4477791234567', 'hello world', :from => 'LUKE', :any_old_param => 'test')
|
@@ -124,8 +143,20 @@ module Clickatell
|
|
124
143
|
describe API, ' with no authentication options set' do
|
125
144
|
it "should build commands with no authentication options" do
|
126
145
|
API.debug_mode = false
|
146
|
+
API.secure_mode = false
|
147
|
+
api = API.new
|
148
|
+
API::CommandExecutor.should_receive(:new).with({}, false, false).and_return(executor=mock('command executor'))
|
149
|
+
executor.stub!(:execute)
|
150
|
+
api.ping('1234')
|
151
|
+
end
|
152
|
+
end
|
153
|
+
|
154
|
+
describe API, ' in secure mode' do
|
155
|
+
it "should execute commands securely" do
|
156
|
+
API.debug_mode = false
|
157
|
+
API.secure_mode = true
|
127
158
|
api = API.new
|
128
|
-
API::CommandExecutor.should_receive(:new).with({}, false).and_return(executor=mock('command executor'))
|
159
|
+
API::CommandExecutor.should_receive(:new).with({}, true, false).and_return(executor=mock('command executor'))
|
129
160
|
executor.stub!(:execute)
|
130
161
|
api.ping('1234')
|
131
162
|
end
|
data/website/index.html
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
|
17
17
|
<div id="header">
|
18
18
|
|
19
|
-
<h1>Clickatell Ruby API <span class="version">0.
|
19
|
+
<h1>Clickatell Ruby API <span class="version">0.4.1</span>
|
20
20
|
<span class="tagline">gem install clickatell</span></h1>
|
21
21
|
|
22
22
|
</div>
|
@@ -31,6 +31,8 @@
|
|
31
31
|
<h3>Installing</h3>
|
32
32
|
|
33
33
|
|
34
|
+
<p><strong>Please note:</strong> this gem has been tested on *nix based systems including Linux, <span class="caps">BSD</span> and <span class="caps">OSX</span>. The <code>sms</code> utility was written with these systems in mind and will not work out of the box on Windows. The <span class="caps">API</span> should still work but has not been tested at this time. If you would like Windows support, please submit patches.</p>
|
35
|
+
|
34
36
|
<p>Download the <a href="http://rubyforge.org/projects/clickatell">latest version of gem</a> or install using RubyGems.</p>
|
35
37
|
|
36
38
|
<pre><code>$ sudo gem install clickatell</code></pre>
|
@@ -38,7 +40,10 @@
|
|
38
40
|
<p>Getting the latest version from Subversion:</p>
|
39
41
|
|
40
42
|
|
41
|
-
<pre><code
|
43
|
+
<pre><code>$ svn co svn://lukeredpath.co.uk/var/svn/opensource/clickatell/trunk clickatell-trunk</code></pre>
|
44
|
+
|
45
|
+
<p>You can view the <a href="/rdoc">RDoc documentation</a> and the <a href="/specs.html">code specs</a>.</p>
|
46
|
+
|
42
47
|
|
43
48
|
<h3>The basics</h3>
|
44
49
|
|
@@ -59,13 +64,20 @@ account username and password.</p>
|
|
59
64
|
require 'rubygems'
|
60
65
|
require 'clickatell'
|
61
66
|
|
62
|
-
|
63
|
-
|
67
|
+
api = Clickatell::API.authenticate('your_api_id', 'your_username', 'your_password')
|
68
|
+
api.send_message('447771234567', 'Hello from clickatell')
|
64
69
|
</code></pre>
|
65
70
|
|
66
71
|
<p>Full documentation for the <span class="caps">API</span> is available in the <a href="rdoc/">RDocs</a>.</p>
|
67
72
|
|
68
73
|
|
74
|
+
<p>For debugging purposes, the <span class="caps">API</span> allows you to view gateway URIs as they are requested, printed to $stdout. You can enable this by turning on <ins>debug_mode</ins>.</p>
|
75
|
+
|
76
|
+
|
77
|
+
<pre><code class="ruby">
|
78
|
+
Clickatell::API.debug_mode = true
|
79
|
+
</code></pre>
|
80
|
+
|
69
81
|
<h4>Command-line <span class="caps">SMS</span> Utility</h4>
|
70
82
|
|
71
83
|
|
@@ -149,7 +161,7 @@ $ sms --status 30b7d15bffb38695ba26e77c9c20f4ec
|
|
149
161
|
<div id="footer">
|
150
162
|
<p class="copyright">
|
151
163
|
<a href="http://rubyforge.org/projects/clickatell">Rubyforge Project Page</a> |
|
152
|
-
<a href="http://rubyforge.org/frs/?group_id=4295&release_id=13922">Download latest version (0.
|
164
|
+
<a href="http://rubyforge.org/frs/?group_id=4295&release_id=13922">Download latest version (0.4.1)</a> |
|
153
165
|
<a href="rdoc/">RDoc</a>
|
154
166
|
</p>
|
155
167
|
</div>
|
data/website/index.txt
CHANGED
@@ -6,13 +6,17 @@ A Ruby interface to the "Clickatell":http://www.clickatell.com SMS gateway API.
|
|
6
6
|
|
7
7
|
h3. Installing
|
8
8
|
|
9
|
+
<p><strong>Please note:</strong> this gem has been tested on *nix based systems including Linux, BSD and OSX. The <code>sms</code> utility was written with these systems in mind and will not work out of the box on Windows. The API should still work but has not been tested at this time. If you would like Windows support, please submit patches.</p>
|
10
|
+
|
9
11
|
<p>Download the <a href="http://rubyforge.org/projects/clickatell">latest version of gem</a> or install using RubyGems.</p>
|
10
12
|
|
11
13
|
<pre><code>$ sudo gem install clickatell</code></pre>
|
12
14
|
|
13
15
|
Getting the latest version from Subversion:
|
14
16
|
|
15
|
-
<pre><code
|
17
|
+
<pre><code>$ svn co svn://lukeredpath.co.uk/var/svn/opensource/clickatell/trunk clickatell-trunk</code></pre>
|
18
|
+
|
19
|
+
You can view the <a href="/rdoc">RDoc documentation</a> and the <a href="/specs.html">code specs</a>.
|
16
20
|
|
17
21
|
h3. The basics
|
18
22
|
|
data/website/specs.html
ADDED
@@ -0,0 +1,277 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>RSpec results</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Expires" content="-1" />
|
11
|
+
<meta http-equiv="Pragma" content="no-cache" />
|
12
|
+
<style type="text/css">
|
13
|
+
body {
|
14
|
+
margin: 0;
|
15
|
+
padding: 0;
|
16
|
+
background: #fff;
|
17
|
+
font-size: 80%;
|
18
|
+
}
|
19
|
+
</style>
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<div class="rspec-report">
|
23
|
+
<script type="text/javascript">
|
24
|
+
// <![CDATA[
|
25
|
+
function moveProgressBar(percentDone) {
|
26
|
+
document.getElementById("rspec-header").style.width = percentDone +"%";
|
27
|
+
}
|
28
|
+
function makeRed(element_id) {
|
29
|
+
document.getElementById(element_id).style.background = '#C40D0D';
|
30
|
+
document.getElementById(element_id).style.color = '#FFFFFF';
|
31
|
+
}
|
32
|
+
|
33
|
+
function makeYellow(element_id) {
|
34
|
+
if (element_id == "rspec-header" && document.getElementById(element_id).style.background != '#C40D0D')
|
35
|
+
{
|
36
|
+
document.getElementById(element_id).style.background = '#FAF834';
|
37
|
+
document.getElementById(element_id).style.color = '#000000';
|
38
|
+
}
|
39
|
+
else
|
40
|
+
{
|
41
|
+
document.getElementById(element_id).style.background = '#FAF834';
|
42
|
+
document.getElementById(element_id).style.color = '#000000';
|
43
|
+
}
|
44
|
+
}
|
45
|
+
|
46
|
+
// ]]>
|
47
|
+
</script>
|
48
|
+
<style type="text/css">
|
49
|
+
#rspec-header {
|
50
|
+
background: #65C400; color: #fff;
|
51
|
+
}
|
52
|
+
|
53
|
+
.rspec-report h1 {
|
54
|
+
margin: 0px 10px 0px 10px;
|
55
|
+
padding: 10px;
|
56
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
57
|
+
font-size: 1.8em;
|
58
|
+
}
|
59
|
+
|
60
|
+
#summary {
|
61
|
+
margin: 0; padding: 5px 10px;
|
62
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
63
|
+
text-align: right;
|
64
|
+
position: absolute;
|
65
|
+
top: 0px;
|
66
|
+
right: 0px;
|
67
|
+
}
|
68
|
+
|
69
|
+
#summary p {
|
70
|
+
margin: 0 0 0 2px;
|
71
|
+
}
|
72
|
+
|
73
|
+
#summary #totals {
|
74
|
+
font-size: 1.2em;
|
75
|
+
}
|
76
|
+
|
77
|
+
.behaviour {
|
78
|
+
margin: 0 10px 5px;
|
79
|
+
background: #fff;
|
80
|
+
}
|
81
|
+
|
82
|
+
dl {
|
83
|
+
margin: 0; padding: 0 0 5px;
|
84
|
+
font: normal 11px "Lucida Grande", Helvetica, sans-serif;
|
85
|
+
}
|
86
|
+
|
87
|
+
dt {
|
88
|
+
padding: 3px;
|
89
|
+
background: #65C400;
|
90
|
+
color: #fff;
|
91
|
+
font-weight: bold;
|
92
|
+
}
|
93
|
+
|
94
|
+
dd {
|
95
|
+
margin: 5px 0 5px 5px;
|
96
|
+
padding: 3px 3px 3px 18px;
|
97
|
+
}
|
98
|
+
|
99
|
+
dd.spec.passed {
|
100
|
+
border-left: 5px solid #65C400;
|
101
|
+
border-bottom: 1px solid #65C400;
|
102
|
+
background: #DBFFB4; color: #3D7700;
|
103
|
+
}
|
104
|
+
|
105
|
+
dd.spec.failed {
|
106
|
+
border-left: 5px solid #C20000;
|
107
|
+
border-bottom: 1px solid #C20000;
|
108
|
+
color: #C20000; background: #FFFBD3;
|
109
|
+
}
|
110
|
+
|
111
|
+
dd.spec.not_implemented {
|
112
|
+
border-left: 5px solid #FAF834;
|
113
|
+
border-bottom: 1px solid #FAF834;
|
114
|
+
background: #FCFB98; color: #131313;
|
115
|
+
}
|
116
|
+
|
117
|
+
dd.spec.pending_fixed {
|
118
|
+
border-left: 5px solid #0000C2;
|
119
|
+
border-bottom: 1px solid #0000C2;
|
120
|
+
color: #0000C2; background: #D3FBFF;
|
121
|
+
}
|
122
|
+
|
123
|
+
.backtrace {
|
124
|
+
color: #000;
|
125
|
+
font-size: 12px;
|
126
|
+
}
|
127
|
+
|
128
|
+
a {
|
129
|
+
color: #BE5C00;
|
130
|
+
}
|
131
|
+
|
132
|
+
/* Ruby code, style similar to vibrant ink */
|
133
|
+
.ruby {
|
134
|
+
font-size: 12px;
|
135
|
+
font-family: monospace;
|
136
|
+
color: white;
|
137
|
+
background-color: black;
|
138
|
+
padding: 0.1em 0 0.2em 0;
|
139
|
+
}
|
140
|
+
|
141
|
+
.ruby .keyword { color: #FF6600; }
|
142
|
+
.ruby .constant { color: #339999; }
|
143
|
+
.ruby .attribute { color: white; }
|
144
|
+
.ruby .global { color: white; }
|
145
|
+
.ruby .module { color: white; }
|
146
|
+
.ruby .class { color: white; }
|
147
|
+
.ruby .string { color: #66FF00; }
|
148
|
+
.ruby .ident { color: white; }
|
149
|
+
.ruby .method { color: #FFCC00; }
|
150
|
+
.ruby .number { color: white; }
|
151
|
+
.ruby .char { color: white; }
|
152
|
+
.ruby .comment { color: #9933CC; }
|
153
|
+
.ruby .symbol { color: white; }
|
154
|
+
.ruby .regex { color: #44B4CC; }
|
155
|
+
.ruby .punct { color: white; }
|
156
|
+
.ruby .escape { color: white; }
|
157
|
+
.ruby .interp { color: white; }
|
158
|
+
.ruby .expr { color: white; }
|
159
|
+
|
160
|
+
.ruby .offending { background-color: gray; }
|
161
|
+
.ruby .linenum {
|
162
|
+
width: 75px;
|
163
|
+
padding: 0.1em 1em 0.2em 0;
|
164
|
+
color: #000000;
|
165
|
+
background-color: #FFFBD3;
|
166
|
+
}
|
167
|
+
|
168
|
+
</style>
|
169
|
+
|
170
|
+
<div id="rspec-header">
|
171
|
+
<h1>RSpec Results</h1>
|
172
|
+
|
173
|
+
<div id="summary">
|
174
|
+
<p id="totals"> </p>
|
175
|
+
<p id="duration"> </p>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
|
179
|
+
<div class="results">
|
180
|
+
<div class="behaviour">
|
181
|
+
<dl>
|
182
|
+
<dt id="behaviour_1">API Command</dt>
|
183
|
+
<script type="text/javascript">moveProgressBar('4.7');</script>
|
184
|
+
<dd class="spec passed"><span class="passed_spec_name">should return encoded URL for the specified command and parameters</span></dd>
|
185
|
+
<script type="text/javascript">moveProgressBar('9.5');</script>
|
186
|
+
<dd class="spec passed"><span class="passed_spec_name">should URL encode any special characters in parameters</span></dd>
|
187
|
+
</dl>
|
188
|
+
</div>
|
189
|
+
<div class="behaviour">
|
190
|
+
<dl>
|
191
|
+
<dt id="behaviour_2">Secure API Command</dt>
|
192
|
+
<script type="text/javascript">moveProgressBar('14.2');</script>
|
193
|
+
<dd class="spec passed"><span class="passed_spec_name">should use HTTPS</span></dd>
|
194
|
+
</dl>
|
195
|
+
</div>
|
196
|
+
<div class="behaviour">
|
197
|
+
<dl>
|
198
|
+
<dt id="behaviour_3">Command executor</dt>
|
199
|
+
<script type="text/javascript">moveProgressBar('19.0');</script>
|
200
|
+
<dd class="spec passed"><span class="passed_spec_name">should create an API command with auth params and send it via HTTP get, returning the raw http response</span></dd>
|
201
|
+
<script type="text/javascript">moveProgressBar('23.8');</script>
|
202
|
+
<dd class="spec passed"><span class="passed_spec_name">should create a secure API command and send command using HTTPS if secure is true</span></dd>
|
203
|
+
</dl>
|
204
|
+
</div>
|
205
|
+
<div class="behaviour">
|
206
|
+
<dl>
|
207
|
+
<dt id="behaviour_4">API</dt>
|
208
|
+
<script type="text/javascript">moveProgressBar('28.5');</script>
|
209
|
+
<dd class="spec passed"><span class="passed_spec_name">should return session_id for successful authentication</span></dd>
|
210
|
+
<script type="text/javascript">moveProgressBar('33.3');</script>
|
211
|
+
<dd class="spec passed"><span class="passed_spec_name">should support ping</span></dd>
|
212
|
+
<script type="text/javascript">moveProgressBar('38.0');</script>
|
213
|
+
<dd class="spec passed"><span class="passed_spec_name">should support sending messages, returning the message id</span></dd>
|
214
|
+
<script type="text/javascript">moveProgressBar('42.8');</script>
|
215
|
+
<dd class="spec passed"><span class="passed_spec_name">should support sending messages with custom sender, passing the appropriate feature mask, returning the message id</span></dd>
|
216
|
+
<script type="text/javascript">moveProgressBar('47.6');</script>
|
217
|
+
<dd class="spec passed"><span class="passed_spec_name">should ignore any invalid parameters when sending message</span></dd>
|
218
|
+
<script type="text/javascript">moveProgressBar('52.3');</script>
|
219
|
+
<dd class="spec passed"><span class="passed_spec_name">should support message status query, returning message status</span></dd>
|
220
|
+
<script type="text/javascript">moveProgressBar('57.1');</script>
|
221
|
+
<dd class="spec passed"><span class="passed_spec_name">should support balance query, returning number of credits as a float</span></dd>
|
222
|
+
<script type="text/javascript">moveProgressBar('61.9');</script>
|
223
|
+
<dd class="spec passed"><span class="passed_spec_name">should raise an API::Error if the response parser raises</span></dd>
|
224
|
+
</dl>
|
225
|
+
</div>
|
226
|
+
<div class="behaviour">
|
227
|
+
<dl>
|
228
|
+
<dt id="behaviour_5">Clickatell::API when authenticating</dt>
|
229
|
+
<script type="text/javascript">moveProgressBar('66.6');</script>
|
230
|
+
<dd class="spec passed"><span class="passed_spec_name">should authenticate to retrieve a session_id and return a new API instance using that session id</span></dd>
|
231
|
+
</dl>
|
232
|
+
</div>
|
233
|
+
<div class="behaviour">
|
234
|
+
<dl>
|
235
|
+
<dt id="behaviour_6">Clickatell::API with no authentication options set</dt>
|
236
|
+
<script type="text/javascript">moveProgressBar('71.4');</script>
|
237
|
+
<dd class="spec passed"><span class="passed_spec_name">should build commands with no authentication options</span></dd>
|
238
|
+
</dl>
|
239
|
+
</div>
|
240
|
+
<div class="behaviour">
|
241
|
+
<dl>
|
242
|
+
<dt id="behaviour_7">Clickatell::API in secure mode</dt>
|
243
|
+
<script type="text/javascript">moveProgressBar('76.1');</script>
|
244
|
+
<dd class="spec passed"><span class="passed_spec_name">should execute commands securely</span></dd>
|
245
|
+
</dl>
|
246
|
+
</div>
|
247
|
+
<div class="behaviour">
|
248
|
+
<dl>
|
249
|
+
<dt id="behaviour_8">API Error</dt>
|
250
|
+
<script type="text/javascript">moveProgressBar('80.9');</script>
|
251
|
+
<dd class="spec passed"><span class="passed_spec_name">should parse http response string to create error</span></dd>
|
252
|
+
</dl>
|
253
|
+
</div>
|
254
|
+
<div class="behaviour">
|
255
|
+
<dl>
|
256
|
+
<dt id="behaviour_9">Hash</dt>
|
257
|
+
<script type="text/javascript">moveProgressBar('85.7');</script>
|
258
|
+
<dd class="spec passed"><span class="passed_spec_name">should return only the keys specified</span></dd>
|
259
|
+
<script type="text/javascript">moveProgressBar('90.4');</script>
|
260
|
+
<dd class="spec passed"><span class="passed_spec_name">should return only the keys specified, ignoring keys that do not exist</span></dd>
|
261
|
+
</dl>
|
262
|
+
</div>
|
263
|
+
<div class="behaviour">
|
264
|
+
<dl>
|
265
|
+
<dt id="behaviour_10">Response parser</dt>
|
266
|
+
<script type="text/javascript">moveProgressBar('95.2');</script>
|
267
|
+
<dd class="spec passed"><span class="passed_spec_name">should return hash for one-line success response</span></dd>
|
268
|
+
<script type="text/javascript">moveProgressBar('100.0');</script>
|
269
|
+
<dd class="spec passed"><span class="passed_spec_name">should raise API::Error if response contains an error message</span></dd>
|
270
|
+
</dl>
|
271
|
+
</div>
|
272
|
+
<script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>0.02819 seconds</strong>";</script>
|
273
|
+
<script type="text/javascript">document.getElementById('totals').innerHTML = "21 examples, 0 failures";</script>
|
274
|
+
</div>
|
275
|
+
</div>
|
276
|
+
</body>
|
277
|
+
</html>
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: clickatell
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.4.
|
7
|
-
date: 2007-
|
6
|
+
version: 0.4.1
|
7
|
+
date: 2007-11-26 00:00:00 +00:00
|
8
8
|
summary: Ruby interface to the Clickatell SMS gateway service.
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -59,6 +59,7 @@ files:
|
|
59
59
|
- website/javascripts/codehighlighter/code_highlighter.js
|
60
60
|
- website/javascripts/codehighlighter/ruby.js
|
61
61
|
- website/javascripts/rounded_corners_lite.inc.js
|
62
|
+
- website/specs.html
|
62
63
|
- website/stylesheets/limechoc.css
|
63
64
|
- website/stylesheets/rdoc.css
|
64
65
|
- website/stylesheets/screen.css
|