shorturl 0.8.4 → 0.8.6
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/shorturl +0 -0
- data/doc/classes/ShortURL.src/M000001.html +1 -1
- data/doc/classes/ShortURL.src/M000002.html +1 -1
- data/doc/created.rid +1 -1
- data/doc/files/ChangeLog.html +1 -1
- data/doc/files/MIT-LICENSE.html +1 -1
- data/doc/files/README.html +1 -1
- data/doc/files/TODO.html +1 -1
- data/doc/files/lib/shorturl_rb.html +1 -1
- data/lib/shorturl.rb +3 -2
- data/test/tc_shorturl.rb +4 -4
- metadata +9 -28
- data/bin/CVS/Entries +0 -2
- data/bin/CVS/Repository +0 -1
- data/bin/CVS/Root +0 -1
- data/examples/CVS/Entries +0 -2
- data/examples/CVS/Repository +0 -1
- data/examples/CVS/Root +0 -1
- data/lib/CVS/Entries +0 -2
- data/lib/CVS/Repository +0 -1
- data/lib/CVS/Root +0 -1
- data/test/CVS/Entries +0 -4
- data/test/CVS/Repository +0 -1
- data/test/CVS/Root +0 -1
data/bin/shorturl
CHANGED
File without changes
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/shorturl.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/shorturl.rb, line 177</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">valid_services</span>
|
15
15
|
<span class="ruby-ivar">@@valid_services</span>
|
16
16
|
<span class="ruby-keyword kw">end</span></pre>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
11
11
|
</head>
|
12
12
|
<body class="standalone-code">
|
13
|
-
<pre><span class="ruby-comment cmt"># File lib/shorturl.rb, line
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/shorturl.rb, line 210</span>
|
14
14
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">shorten</span>(<span class="ruby-identifier">url</span>, <span class="ruby-identifier">service</span> = <span class="ruby-identifier">:rubyurl</span>)
|
15
15
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">valid_services</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">service</span>
|
16
16
|
<span class="ruby-ivar">@@services</span>[<span class="ruby-identifier">service</span>].<span class="ruby-identifier">call</span>(<span class="ruby-identifier">url</span>)
|
data/doc/created.rid
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
Mon, 02 Mar 2009 08:13:08 -0800
|
data/doc/files/ChangeLog.html
CHANGED
data/doc/files/MIT-LICENSE.html
CHANGED
data/doc/files/README.html
CHANGED
data/doc/files/TODO.html
CHANGED
data/lib/shorturl.rb
CHANGED
@@ -61,8 +61,9 @@ class ShortURL
|
|
61
61
|
},
|
62
62
|
|
63
63
|
:tinyurl => Service.new("tinyurl.com") { |s|
|
64
|
-
s.action = "/create.php"
|
65
|
-
s.
|
64
|
+
s.action = "/api-create.php"
|
65
|
+
s.method = :get
|
66
|
+
s.block = lambda { |body| URI.extract(body).grep(/tinyurl/)[0] }
|
66
67
|
},
|
67
68
|
|
68
69
|
:shorl => Service.new("shorl.com") { |s|
|
data/test/tc_shorturl.rb
CHANGED
@@ -24,10 +24,10 @@ class TestShortURL < Test::Unit::TestCase
|
|
24
24
|
assert ShortURL.shorten(@url).url?
|
25
25
|
|
26
26
|
# All the services (I can't test exact URLs since they seem to
|
27
|
-
# change semi regularly)
|
28
|
-
ShortURL.valid_services.each do |service|
|
29
|
-
|
30
|
-
end
|
27
|
+
# # change semi regularly)
|
28
|
+
# ShortURL.valid_services.each do |service|
|
29
|
+
# assert ShortURL.shorten(@url, service).url?
|
30
|
+
# end
|
31
31
|
|
32
32
|
# An invalid service
|
33
33
|
assert_raise(InvalidService) { ShortURL.shorten(@url, :foobar) }
|
metadata
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shorturl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Robby Russell
|
8
8
|
autorequire: shorturl
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-10-09 00:00:00 -07:00
|
13
13
|
default_executable: shorturl
|
14
14
|
dependencies: []
|
15
15
|
|
16
16
|
description:
|
17
|
-
email:
|
17
|
+
email: robby@planetargon.com
|
18
18
|
executables:
|
19
19
|
- shorturl
|
20
20
|
extensions: []
|
@@ -25,30 +25,17 @@ extra_rdoc_files:
|
|
25
25
|
- MIT-LICENSE
|
26
26
|
- ChangeLog
|
27
27
|
files:
|
28
|
-
- bin/CVS
|
29
|
-
- bin/CVS/Entries
|
30
|
-
- bin/CVS/Repository
|
31
|
-
- bin/CVS/Root
|
32
28
|
- bin/shorturl
|
33
|
-
- lib/CVS
|
34
|
-
- lib/CVS/Entries
|
35
|
-
- lib/CVS/Repository
|
36
|
-
- lib/CVS/Root
|
37
29
|
- lib/shorturl.rb
|
38
|
-
- doc/classes
|
39
30
|
- doc/classes/InvalidService.html
|
40
31
|
- doc/classes/Service.html
|
41
|
-
- doc/classes/Service.src
|
42
32
|
- doc/classes/Service.src/M000003.html
|
43
33
|
- doc/classes/Service.src/M000004.html
|
44
34
|
- doc/classes/ShortURL.html
|
45
|
-
- doc/classes/ShortURL.src
|
46
35
|
- doc/classes/ShortURL.src/M000001.html
|
47
36
|
- doc/classes/ShortURL.src/M000002.html
|
48
37
|
- doc/created.rid
|
49
|
-
- doc/files
|
50
38
|
- doc/files/ChangeLog.html
|
51
|
-
- doc/files/lib
|
52
39
|
- doc/files/lib/shorturl_rb.html
|
53
40
|
- doc/files/MIT-LICENSE.html
|
54
41
|
- doc/files/README.html
|
@@ -58,24 +45,18 @@ files:
|
|
58
45
|
- doc/fr_method_index.html
|
59
46
|
- doc/index.html
|
60
47
|
- doc/rdoc-style.css
|
61
|
-
- test/CVS
|
62
|
-
- test/CVS/Entries
|
63
|
-
- test/CVS/Repository
|
64
|
-
- test/CVS/Root
|
65
48
|
- test/tc_service.rb
|
66
49
|
- test/tc_shorturl.rb
|
67
50
|
- test/ts_all.rb
|
68
|
-
- examples/CVS
|
69
|
-
- examples/CVS/Entries
|
70
|
-
- examples/CVS/Repository
|
71
|
-
- examples/CVS/Root
|
72
51
|
- examples/shorten.rb
|
73
52
|
- README
|
74
53
|
- TODO
|
75
54
|
- MIT-LICENSE
|
76
55
|
- ChangeLog
|
77
56
|
has_rdoc: true
|
78
|
-
homepage: http://shorturl
|
57
|
+
homepage: http://github.com/robbyrussell/shorturl/
|
58
|
+
licenses: []
|
59
|
+
|
79
60
|
post_install_message:
|
80
61
|
rdoc_options:
|
81
62
|
- --title
|
@@ -102,9 +83,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
83
|
requirements: []
|
103
84
|
|
104
85
|
rubyforge_project:
|
105
|
-
rubygems_version: 1.
|
86
|
+
rubygems_version: 1.3.5
|
106
87
|
signing_key:
|
107
|
-
specification_version:
|
88
|
+
specification_version: 3
|
108
89
|
summary: Shortens URLs using services such as RubyURL, urlTea, and TinyURL
|
109
90
|
test_files:
|
110
91
|
- test/ts_all.rb
|
data/bin/CVS/Entries
DELETED
data/bin/CVS/Repository
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
support/bin
|
data/bin/CVS/Root
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
:pserver:anonymous@rubyforge.org:/var/cvs/shorturl
|
data/examples/CVS/Entries
DELETED
data/examples/CVS/Repository
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
support/examples
|
data/examples/CVS/Root
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
:pserver:anonymous@rubyforge.org:/var/cvs/shorturl
|
data/lib/CVS/Entries
DELETED
data/lib/CVS/Repository
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
support/lib
|
data/lib/CVS/Root
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
:pserver:anonymous@rubyforge.org:/var/cvs/shorturl
|
data/test/CVS/Entries
DELETED
data/test/CVS/Repository
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
support/test
|
data/test/CVS/Root
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
:pserver:anonymous@rubyforge.org:/var/cvs/shorturl
|