filebin 0.1.0 → 0.2.0
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/README.rdoc +2 -2
- data/Rakefile +4 -4
- data/VERSION +1 -1
- data/lib/filebin.rb +12 -9
- data/spec/filebin_spec.rb +1 -1
- metadata +30 -17
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -52,9 +52,9 @@ Rake::RDocTask.new do |rdoc|
|
|
52
52
|
rdoc.title = "filebin #{version}"
|
53
53
|
rdoc.rdoc_files.include('README*')
|
54
54
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
55
|
+
rdoc.options += [
|
56
|
+
'-N',
|
57
|
+
# '-f', 'darkfish',
|
58
|
+
]
|
59
59
|
end
|
60
60
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/lib/filebin.rb
CHANGED
@@ -9,7 +9,6 @@ require 'net/http'
|
|
9
9
|
require 'hpricot'
|
10
10
|
|
11
11
|
class Filebin
|
12
|
-
attr_reader :link
|
13
12
|
# This method takes a hash containing the variables in the POST
|
14
13
|
# request.
|
15
14
|
#
|
@@ -37,13 +36,17 @@ class Filebin
|
|
37
36
|
@link = $1
|
38
37
|
end
|
39
38
|
|
39
|
+
# Returns the link to the uploaded file.
|
40
|
+
def link
|
41
|
+
@link
|
42
|
+
end
|
43
|
+
|
44
|
+
# Returns a shortened link to the uploaded file.
|
40
45
|
def short_link
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
doc.at('/permalink').inner_html
|
48
|
-
end
|
46
|
+
clnt = HTTPClient.new
|
47
|
+
res = clnt.get('http://is.gd/api.php', {:longurl => @link} ).content
|
48
|
+
doc = Hpricot(res)
|
49
|
+
doc.html
|
50
|
+
end
|
51
|
+
|
49
52
|
end
|
data/spec/filebin_spec.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: filebin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
version: 0.2.0
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- dougsko
|
@@ -9,39 +14,45 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date:
|
17
|
+
date: 2010-05-19 00:00:00 -04:00
|
13
18
|
default_executable: filebin
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: httpclient
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
23
29
|
version: "0"
|
24
|
-
|
30
|
+
type: :runtime
|
31
|
+
version_requirements: *id001
|
25
32
|
- !ruby/object:Gem::Dependency
|
26
33
|
name: hpricot
|
27
|
-
|
28
|
-
|
29
|
-
version_requirements: !ruby/object:Gem::Requirement
|
34
|
+
prerelease: false
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
37
|
- - ">="
|
32
38
|
- !ruby/object:Gem::Version
|
39
|
+
segments:
|
40
|
+
- 0
|
33
41
|
version: "0"
|
34
|
-
|
42
|
+
type: :runtime
|
43
|
+
version_requirements: *id002
|
35
44
|
- !ruby/object:Gem::Dependency
|
36
45
|
name: httpclient
|
37
|
-
|
38
|
-
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
prerelease: false
|
47
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
40
48
|
requirements:
|
41
49
|
- - ">="
|
42
50
|
- !ruby/object:Gem::Version
|
51
|
+
segments:
|
52
|
+
- 0
|
43
53
|
version: "0"
|
44
|
-
|
54
|
+
type: :runtime
|
55
|
+
version_requirements: *id003
|
45
56
|
description: Command line interface to filebin.ca
|
46
57
|
email: dougtko@gmail.com
|
47
58
|
executables:
|
@@ -74,18 +85,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
74
85
|
requirements:
|
75
86
|
- - ">="
|
76
87
|
- !ruby/object:Gem::Version
|
88
|
+
segments:
|
89
|
+
- 0
|
77
90
|
version: "0"
|
78
|
-
version:
|
79
91
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
92
|
requirements:
|
81
93
|
- - ">="
|
82
94
|
- !ruby/object:Gem::Version
|
95
|
+
segments:
|
96
|
+
- 0
|
83
97
|
version: "0"
|
84
|
-
version:
|
85
98
|
requirements: []
|
86
99
|
|
87
100
|
rubyforge_project:
|
88
|
-
rubygems_version: 1.3.
|
101
|
+
rubygems_version: 1.3.6
|
89
102
|
signing_key:
|
90
103
|
specification_version: 3
|
91
104
|
summary: Command line interface to filebin.ca
|