pastebin 0.1.3 → 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/VERSION +1 -1
- data/bin/pastebin +2 -1
- data/lib/pastebin.rb +11 -6
- metadata +2 -3
- data/pastebin.gemspec +0 -56
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/bin/pastebin
CHANGED
@@ -125,10 +125,11 @@ end
|
|
125
125
|
# parse options
|
126
126
|
opts.parse(ARGV)
|
127
127
|
|
128
|
-
pbin = Pastebin.new(options)
|
129
128
|
if options["raw"]
|
129
|
+
pbin = Pastebin.new
|
130
130
|
puts pbin.get_raw(options["raw"])
|
131
131
|
else
|
132
|
+
pbin = Pastebin.new(options)
|
132
133
|
puts pbin.paste
|
133
134
|
end
|
134
135
|
|
data/lib/pastebin.rb
CHANGED
@@ -9,9 +9,9 @@ require 'hpricot'
|
|
9
9
|
require 'httpclient'
|
10
10
|
|
11
11
|
class Pastebin
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
12
|
+
# If you intend to make a paste with this object, give it a hash as
|
13
|
+
# its argument containing the POST variables.
|
14
|
+
#
|
15
15
|
# pbin = Pastbin.new({ "content" => "file_path",
|
16
16
|
# "name" => "",
|
17
17
|
# "decription" => "",
|
@@ -19,12 +19,17 @@ class Pastebin
|
|
19
19
|
# "exipry" => "",
|
20
20
|
# "type" => "",
|
21
21
|
# "config" => "config file",
|
22
|
-
# "raw" => "pastebin link",
|
23
22
|
# })
|
23
|
+
# pbin.paste #=> "http://pastebin.ca/xxxxxxx"
|
24
|
+
#
|
25
|
+
# If you are going to use this object to retrieve text from a
|
26
|
+
# paste, then you do not need an argument.
|
27
|
+
#
|
28
|
+
# pbin = Pastbin.new
|
29
|
+
# pbin.get_raw("http://pastebin.ca/xxxxxxx") #=> "some text"
|
24
30
|
#
|
25
|
-
def initialize(options)
|
31
|
+
def initialize(options = {})
|
26
32
|
@options = options
|
27
|
-
#@options.delete("raw")
|
28
33
|
if @options.has_key?("config")
|
29
34
|
@config = options["config"]
|
30
35
|
@options.delete("config")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pastebin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dougsko
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-12-26 00:00:00 -05:00
|
13
13
|
default_executable: pastebin
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -40,7 +40,6 @@ files:
|
|
40
40
|
- VERSION
|
41
41
|
- bin/pastebin
|
42
42
|
- lib/pastebin.rb
|
43
|
-
- pastebin.gemspec
|
44
43
|
- spec/pastebin_spec.rb
|
45
44
|
- spec/spec_helper.rb
|
46
45
|
has_rdoc: true
|
data/pastebin.gemspec
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{pastebin}
|
8
|
-
s.version = "0.1.3"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["dougsko"]
|
12
|
-
s.date = %q{2009-09-11}
|
13
|
-
s.default_executable = %q{pastebin}
|
14
|
-
s.description = %q{Command line interface to http://pastebin.ca}
|
15
|
-
s.email = %q{dougtko@gmail.com}
|
16
|
-
s.executables = ["pastebin"]
|
17
|
-
s.extra_rdoc_files = [
|
18
|
-
"LICENSE",
|
19
|
-
"README.rdoc"
|
20
|
-
]
|
21
|
-
s.files = [
|
22
|
-
".document",
|
23
|
-
".gitignore",
|
24
|
-
"LICENSE",
|
25
|
-
"README.rdoc",
|
26
|
-
"Rakefile",
|
27
|
-
"VERSION",
|
28
|
-
"bin/pastebin",
|
29
|
-
"lib/pastebin.rb",
|
30
|
-
"pastebin.gemspec",
|
31
|
-
"spec/pastebin_spec.rb",
|
32
|
-
"spec/spec_helper.rb"
|
33
|
-
]
|
34
|
-
s.homepage = %q{http://github.com/dougsko/pastebin}
|
35
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
36
|
-
s.require_paths = ["/bin", "/lib"]
|
37
|
-
s.rubygems_version = %q{1.3.5}
|
38
|
-
s.summary = %q{Command line interface to http://pastebin.ca}
|
39
|
-
s.test_files = [
|
40
|
-
"spec/pastebin_spec.rb",
|
41
|
-
"spec/spec_helper.rb"
|
42
|
-
]
|
43
|
-
|
44
|
-
if s.respond_to? :specification_version then
|
45
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
46
|
-
s.specification_version = 3
|
47
|
-
|
48
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
49
|
-
s.add_runtime_dependency(%q<httpclient>, [">= 0"])
|
50
|
-
else
|
51
|
-
s.add_dependency(%q<httpclient>, [">= 0"])
|
52
|
-
end
|
53
|
-
else
|
54
|
-
s.add_dependency(%q<httpclient>, [">= 0"])
|
55
|
-
end
|
56
|
-
end
|