commonthread-clickatell 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/clickatell.gemspec +15 -16
- data/lib/clickatell/api/command.rb +1 -1
- data/lib/core-ext/hash.rb +15 -0
- data/lib/core-ext/object.rb +6 -0
- metadata +5 -5
data/clickatell.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "clickatell"
|
3
|
-
s.version = "0.5.
|
3
|
+
s.version = "0.5.2"
|
4
4
|
s.date = "2009-03-03"
|
5
5
|
s.summary = "Ruby interface to the Clickatell SMS Gateway API"
|
6
6
|
s.email = "ben@commonthread.com"
|
@@ -10,24 +10,23 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.authors = ["Luke Redpath", "Ben Wyrosdick", "Anthony Crumley"]
|
11
11
|
s.files = ["README.textile",
|
12
12
|
"RDOC_README.txt",
|
13
|
-
|
13
|
+
"License.txt",
|
14
14
|
"Manifest.txt",
|
15
|
-
|
15
|
+
"Rakefile",
|
16
16
|
"History.txt",
|
17
|
-
|
17
|
+
"clickatell.gemspec",
|
18
18
|
"setup.rb",
|
19
19
|
"lib/clickatell.rb",
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
"lib/
|
30
|
-
"lib/
|
20
|
+
"lib/clickatell/api.rb",
|
21
|
+
"lib/clickatell/response.rb",
|
22
|
+
"lib/clickatell/utility.rb",
|
23
|
+
"lib/clickatell/version.rb",
|
24
|
+
"lib/clickatell/api/command.rb",
|
25
|
+
"lib/clickatell/api/command_executor.rb",
|
26
|
+
"lib/clickatell/api/error.rb",
|
27
|
+
"lib/clickatell/api/message_status.rb",
|
28
|
+
"lib/clickatell/utility/options.rb",
|
29
|
+
"lib/core-ext/hash.rb",
|
30
|
+
"lib/core-ext/object.rb"]
|
31
31
|
s.rdoc_options = ["--main", "RDOC_README.txt"]
|
32
|
-
s.extra_rdoc_files = ["RDOC_README.txt"]
|
33
32
|
end
|
@@ -14,7 +14,7 @@ module Clickatell
|
|
14
14
|
|
15
15
|
# Returns a URL for the given parameters (a hash).
|
16
16
|
def with_params(param_hash)
|
17
|
-
param_string = '?' + param_hash.map { |key, value| "#{key}=#{CGI.escape(value)}" }.sort.join('&')
|
17
|
+
param_string = '?' + param_hash.map { |key, value| "#{key}=#{CGI.escape(value.to_s)}" }.sort.join('&')
|
18
18
|
return URI.parse(File.join(api_service_uri, @command_name + param_string))
|
19
19
|
end
|
20
20
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class Hash
|
2
|
+
# Returns a new hash containing only the keys specified
|
3
|
+
# that exist in the current hash.
|
4
|
+
#
|
5
|
+
# {:a => '1', :b => '2', :c => '3'}.only(:a, :c)
|
6
|
+
# # => {:a => '1', :c => '3'}
|
7
|
+
#
|
8
|
+
# Keys that do not exist in the original hash are ignored.
|
9
|
+
def only(*keys)
|
10
|
+
inject( {} ) do |new_hash, (key, value)|
|
11
|
+
new_hash[key] = value if keys.include?(key)
|
12
|
+
new_hash
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: commonthread-clickatell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luke Redpath
|
@@ -21,8 +21,8 @@ executables: []
|
|
21
21
|
|
22
22
|
extensions: []
|
23
23
|
|
24
|
-
extra_rdoc_files:
|
25
|
-
|
24
|
+
extra_rdoc_files: []
|
25
|
+
|
26
26
|
files:
|
27
27
|
- README.textile
|
28
28
|
- RDOC_README.txt
|
@@ -42,8 +42,8 @@ files:
|
|
42
42
|
- lib/clickatell/api/error.rb
|
43
43
|
- lib/clickatell/api/message_status.rb
|
44
44
|
- lib/clickatell/utility/options.rb
|
45
|
-
- lib/
|
46
|
-
- lib/
|
45
|
+
- lib/core-ext/hash.rb
|
46
|
+
- lib/core-ext/object.rb
|
47
47
|
has_rdoc: true
|
48
48
|
homepage: http://clickatell.rubyforge.org
|
49
49
|
post_install_message:
|