commonthread-clickatell 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.1"
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
- "License.txt",
13
+ "License.txt",
14
14
  "Manifest.txt",
15
- "Rakefile",
15
+ "Rakefile",
16
16
  "History.txt",
17
- "clickatell.gemspec",
17
+ "clickatell.gemspec",
18
18
  "setup.rb",
19
19
  "lib/clickatell.rb",
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/clickatell/core-ext/hash.rb",
30
- "lib/clickatell/core-ext/object.rb"]
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
@@ -0,0 +1,6 @@
1
+ class Object
2
+ # TODO check to make sure blank? isn't defined already before blowing it out
3
+ def blank?
4
+ respond_to?(:empty?) ? empty? : !self
5
+ end
6
+ 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.1
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
- - RDOC_README.txt
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/clickatell/core-ext/hash.rb
46
- - lib/clickatell/core-ext/object.rb
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: