shortservice 0.0.2 → 0.0.3

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.
Files changed (2) hide show
  1. data/lib/shortservice.rb +2 -0
  2. metadata +2 -2
data/lib/shortservice.rb CHANGED
@@ -7,6 +7,7 @@ module ShortService
7
7
 
8
8
  Service = Struct.new(:key, :name)
9
9
 
10
+ # Get a list of all shorten services.
10
11
  def self.services
11
12
  xml = SimpleHttp.get("#{API_URL}/services?format=xml")
12
13
  doc = REXML::Document.new(xml)
@@ -21,6 +22,7 @@ module ShortService
21
22
  services
22
23
  end
23
24
 
25
+ # Shorten a URL using the service (key) specified.
24
26
  def self.shorten(url, service = "bitly")
25
27
  xml = SimpleHttp.get("#{API_URL}/shorten?url=#{CGI::escape(url)}&service=#{service}&format=xml")
26
28
  doc = REXML::Document.new(xml)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 2
9
- version: 0.0.2
8
+ - 3
9
+ version: 0.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Lasse Bunk