pastebin 0.2.1 → 1.0.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/Gemfile +13 -0
- data/Gemfile.lock +28 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +9 -9
- data/Rakefile +29 -37
- data/VERSION +1 -1
- data/bin/pastebin +43 -84
- data/lib/pastebin.rb +22 -66
- data/spec/pastebin_spec.rb +11 -5
- data/spec/spec_helper.rb +7 -4
- metadata +69 -20
- data/.gitignore +0 -5
- data/LICENSE +0 -15
data/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
|
6
|
+
# Add dependencies to develop your gem here.
|
7
|
+
# Include everything needed to run rake, tests, features, etc.
|
8
|
+
group :development do
|
9
|
+
gem "rspec", "~> 2.1.0"
|
10
|
+
gem "bundler", "~> 1.0.0"
|
11
|
+
gem "jeweler", "~> 1.5.1"
|
12
|
+
gem "rcov", ">= 0"
|
13
|
+
end
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
GEM
|
2
|
+
remote: http://rubygems.org/
|
3
|
+
specs:
|
4
|
+
diff-lcs (1.1.2)
|
5
|
+
git (1.2.5)
|
6
|
+
jeweler (1.5.1)
|
7
|
+
bundler (~> 1.0.0)
|
8
|
+
git (>= 1.2.5)
|
9
|
+
rake
|
10
|
+
rake (0.8.7)
|
11
|
+
rcov (0.9.9)
|
12
|
+
rspec (2.1.0)
|
13
|
+
rspec-core (~> 2.1.0)
|
14
|
+
rspec-expectations (~> 2.1.0)
|
15
|
+
rspec-mocks (~> 2.1.0)
|
16
|
+
rspec-core (2.1.0)
|
17
|
+
rspec-expectations (2.1.0)
|
18
|
+
diff-lcs (~> 1.1.2)
|
19
|
+
rspec-mocks (2.1.0)
|
20
|
+
|
21
|
+
PLATFORMS
|
22
|
+
ruby
|
23
|
+
|
24
|
+
DEPENDENCIES
|
25
|
+
bundler (~> 1.0.0)
|
26
|
+
jeweler (~> 1.5.1)
|
27
|
+
rcov
|
28
|
+
rspec (~> 2.1.0)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2010 dougsko
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
CHANGED
@@ -2,22 +2,22 @@
|
|
2
2
|
|
3
3
|
pastebin is a CLI to http://pastebin.ca
|
4
4
|
Usage: pastebin [options]
|
5
|
-
Examples: pastebin -f foo.rb -t ruby -e '
|
5
|
+
Examples: pastebin -f foo.rb -t ruby -e '10 Minutes'
|
6
6
|
cat foo.pl | pastebin -f - -t perl
|
7
7
|
|
8
8
|
Options:
|
9
9
|
-f, --file <file> Use a file for input, use "-" for STDIN
|
10
10
|
-n, --name <name> Assign a name/title to your paste
|
11
|
-
-
|
12
|
-
-c, --config <file> Specify a config file. Default is ~/.paster.yaml
|
11
|
+
-s, --subdomain <subdomain> Paste to a specific subdomain
|
13
12
|
-r, --raw <link> Return raw text from a paste link
|
14
|
-
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
13
|
+
-e, --expire <time> These can be abbriviated, as long as they are unambigous. Defaults to '1 Month'
|
14
|
+
Never, 10 Minutes, 1 Hour, 1 Day, 1 Month
|
15
|
+
-l, --language <syntax> Syntax types can be abbriviated, as long as they are unambigous. There are many more supported languages than what is listed here. Defaults to 'text'
|
16
|
+
perl, python, c, ruby, bash, cpp, groovy, latex, java, php, sql, xml
|
17
|
+
-p, --private Make paste private.
|
19
18
|
-h, --help Show this message
|
20
19
|
|
20
|
+
|
21
21
|
== Copyright
|
22
22
|
|
23
|
-
Copyright (c)
|
23
|
+
Copyright (c) 2010 dougsko. See LICENSE for details.
|
data/Rakefile
CHANGED
@@ -1,58 +1,50 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require '
|
3
|
-
|
2
|
+
require 'bundler'
|
4
3
|
begin
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
gem.description = 'Command line interface to http://pastebin.ca'
|
13
|
-
gem.add_dependency 'httpclient'
|
14
|
-
gem.require_paths = ['/bin', '/lib']
|
15
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
16
|
-
end
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'rake'
|
17
11
|
|
18
|
-
|
19
|
-
|
12
|
+
require 'jeweler'
|
13
|
+
Jeweler::Tasks.new do |gem|
|
14
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
15
|
+
gem.name = "pastebin"
|
16
|
+
gem.homepage = "http://github.com/dougsko/pastebin"
|
17
|
+
gem.license = "MIT"
|
18
|
+
gem.summary = %Q{CLI tool and library to work with pastebin.com}
|
19
|
+
gem.description = %Q{CLI tool and library to work with pastebin.com}
|
20
|
+
gem.email = "dougtko@gmail.com"
|
21
|
+
gem.authors = ["dougsko"]
|
22
|
+
# Include your dependencies below. Runtime dependencies are required when using your gem,
|
23
|
+
# and development dependencies are only needed for development (ie running rake tasks, tests, etc)
|
24
|
+
# gem.add_runtime_dependency 'jabber4r', '> 0.1'
|
25
|
+
# gem.add_development_dependency 'rspec', '> 1.2.3'
|
20
26
|
end
|
27
|
+
Jeweler::RubygemsDotOrgTasks.new
|
21
28
|
|
22
|
-
require '
|
23
|
-
|
24
|
-
|
25
|
-
spec.
|
26
|
-
spec.spec_opts = ['--color']
|
29
|
+
require 'rspec/core'
|
30
|
+
require 'rspec/core/rake_task'
|
31
|
+
RSpec::Core::RakeTask.new(:spec) do |spec|
|
32
|
+
spec.pattern = FileList['spec/**/*_spec.rb']
|
27
33
|
end
|
28
34
|
|
29
|
-
|
30
|
-
spec.libs << 'lib' << 'spec'
|
35
|
+
RSpec::Core::RakeTask.new(:rcov) do |spec|
|
31
36
|
spec.pattern = 'spec/**/*_spec.rb'
|
32
37
|
spec.rcov = true
|
33
|
-
spec.spec_opts = ['--color']
|
34
38
|
end
|
35
39
|
|
36
|
-
|
37
40
|
task :default => :spec
|
38
41
|
|
39
42
|
require 'rake/rdoctask'
|
40
|
-
#require 'darkfish-rdoc'
|
41
43
|
Rake::RDocTask.new do |rdoc|
|
42
|
-
|
43
|
-
config = YAML.load(File.read('VERSION.yml'))
|
44
|
-
version = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
45
|
-
else
|
46
|
-
version = ""
|
47
|
-
end
|
44
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
48
45
|
|
49
46
|
rdoc.rdoc_dir = 'rdoc'
|
50
47
|
rdoc.title = "pastebin #{version}"
|
51
48
|
rdoc.rdoc_files.include('README*')
|
52
49
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
-
rdoc.options += [
|
54
|
-
'-N',
|
55
|
-
# '-f', 'darkfish',
|
56
|
-
]
|
57
50
|
end
|
58
|
-
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
1.0.0
|
data/bin/pastebin
CHANGED
@@ -1,22 +1,21 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
# pastebin is a command line interface to pastebin.
|
3
|
+
# pastebin is a command line interface to pastebin.com
|
4
4
|
# It can read from a file or from STDIN
|
5
5
|
#
|
6
|
-
# Copyright (C)
|
6
|
+
# Copyright (C) 2010 Doug Prostko
|
7
7
|
#
|
8
|
-
# Requires the httpclient
|
9
8
|
|
10
9
|
require 'rubygems'
|
11
10
|
require 'optparse'
|
12
11
|
require 'pastebin'
|
13
12
|
|
14
13
|
# set up all the options stuff
|
15
|
-
options = {
|
14
|
+
options = {}
|
16
15
|
opts = OptionParser.new do |opts|
|
17
16
|
opts.banner = "pastebin is a CLI to http://pastebin.ca
|
18
17
|
Usage: pastebin [options]
|
19
|
-
Examples: pastebin -f foo.rb -t ruby -e '
|
18
|
+
Examples: pastebin -f foo.rb -t ruby -e '10 Minutes'
|
20
19
|
cat foo.pl | pastebin -f - -t perl"
|
21
20
|
|
22
21
|
opts.separator ""
|
@@ -24,112 +23,72 @@ opts = OptionParser.new do |opts|
|
|
24
23
|
|
25
24
|
opts.on("-f <file>", "--file <file>", String,
|
26
25
|
"Use a file for input, use \"-\" for STDIN") do |f|
|
27
|
-
options["
|
26
|
+
options["paste_code"] = f
|
28
27
|
end
|
29
28
|
|
30
29
|
opts.on("-n", "--name <name>", String,
|
31
30
|
"Assign a name/title to your paste") do |n|
|
32
|
-
options["
|
31
|
+
options["paste_name"] = n
|
33
32
|
end
|
34
33
|
|
35
|
-
opts.on("-
|
36
|
-
"
|
37
|
-
options["
|
34
|
+
opts.on("-s", "--subdomain <subdomain>", String,
|
35
|
+
"Paste to a specific subdomain") do |s|
|
36
|
+
options["paste_subdomain"] = s
|
38
37
|
end
|
39
38
|
|
40
|
-
opts.on("-
|
41
|
-
"
|
42
|
-
options["
|
39
|
+
opts.on("-r", "--raw <link>", String,
|
40
|
+
"Return raw text from a paste link") do |r|
|
41
|
+
options["raw"] = r
|
43
42
|
end
|
44
43
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
end
|
52
|
-
|
53
|
-
expire_array = [ "never",
|
54
|
-
"5 minutes",
|
55
|
-
"10 minutes",
|
56
|
-
"15 minutes",
|
57
|
-
"30 minutes",
|
58
|
-
"45 minutes",
|
59
|
-
"1 hour",
|
60
|
-
"2 hours",
|
61
|
-
"4 hours",
|
62
|
-
"8 hours",
|
63
|
-
"12 hours",
|
64
|
-
"1 day",
|
65
|
-
"2 days",
|
66
|
-
"3 days",
|
67
|
-
"1 week",
|
68
|
-
"2 weeks",
|
69
|
-
"3 weeks",
|
70
|
-
"1 month",
|
71
|
-
"2 months",
|
72
|
-
"3 months",
|
73
|
-
"4 months",
|
74
|
-
"5 months",
|
75
|
-
"6 months",
|
76
|
-
"1 year"
|
44
|
+
expire_array = [
|
45
|
+
"Never",
|
46
|
+
"10 Minutes",
|
47
|
+
"1 Hour",
|
48
|
+
"1 Day",
|
49
|
+
"1 Month",
|
77
50
|
]
|
78
51
|
expire_list = expire_array.join(", ")
|
79
|
-
opts.on("-e", "--expire <time>", expire_array, "These can be abbriviated, as long as they are unambigous. Defaults to '1
|
80
|
-
options["
|
52
|
+
opts.on("-e", "--expire <time>", expire_array, "These can be abbriviated, as long as they are unambigous. Defaults to '1 Month'", "#{expire_list}" ) do |e|
|
53
|
+
options["paste_expire_date"] = e
|
81
54
|
end
|
82
55
|
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
"
|
100
|
-
"objective c" => "31",
|
101
|
-
"php" => "5", "pl/i" => "14",
|
102
|
-
"pascal" => "12",
|
103
|
-
"perl" => "6",
|
104
|
-
"python" => "11",
|
105
|
-
"raw" => "1",
|
106
|
-
"ruby" => "10",
|
107
|
-
"sql statement" => "16",
|
108
|
-
"scheme" => "17",
|
109
|
-
"visual basic .net" => "32",
|
110
|
-
"visual basic" => "8",
|
111
|
-
"xml document" => "15",
|
112
|
-
"mirc " => "13"
|
113
|
-
}
|
114
|
-
code_list = syntax_hash.keys.sort.join(", ")
|
115
|
-
opts.on("-l", "--language <syntax>", syntax_hash, "Syntax types can be abbriviated, as long as they are unambigous. Defaults to 'raw'", " #{code_list}") do |encoding|
|
116
|
-
options["type"] = encoding
|
56
|
+
syntax_array = [ 'perl',
|
57
|
+
'python',
|
58
|
+
'c',
|
59
|
+
'ruby',
|
60
|
+
'bash',
|
61
|
+
'cpp',
|
62
|
+
'groovy',
|
63
|
+
'latex',
|
64
|
+
'java',
|
65
|
+
'php',
|
66
|
+
'sql',
|
67
|
+
'xml'
|
68
|
+
]
|
69
|
+
|
70
|
+
code_list = syntax_array.join(", ")
|
71
|
+
opts.on("-l", "--language <syntax>", syntax_array, "Syntax types can be abbriviated, as long as they are unambigous. There are many more supported languages than what is listed here. Defaults to 'text'", " #{code_list}") do |encoding|
|
72
|
+
options["paste_format"] = encoding
|
117
73
|
end
|
118
74
|
|
75
|
+
opts.on("-p", "--private", "Make paste private.") do
|
76
|
+
options["paste_private"] = "1"
|
77
|
+
end
|
78
|
+
|
119
79
|
opts.on_tail("-h", "--help", "Show this message") do
|
120
80
|
puts opts
|
121
|
-
|
81
|
+
exit
|
122
82
|
end
|
123
83
|
end
|
124
84
|
|
125
85
|
# parse options
|
126
86
|
opts.parse(ARGV)
|
127
87
|
|
88
|
+
pbin = Pastebin.new(options)
|
128
89
|
if options["raw"]
|
129
|
-
pbin = Pastebin.new
|
130
90
|
puts pbin.get_raw(options["raw"])
|
131
91
|
else
|
132
|
-
pbin = Pastebin.new(options)
|
133
92
|
puts pbin.paste
|
134
93
|
end
|
135
94
|
|
data/lib/pastebin.rb
CHANGED
@@ -1,95 +1,51 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
#
|
3
|
-
# Class to work with http://pastebin.
|
3
|
+
# Class to work with http://pastebin.com
|
4
4
|
#
|
5
5
|
|
6
6
|
require 'rubygems'
|
7
|
-
require 'yaml'
|
8
|
-
require 'hpricot'
|
9
7
|
require 'httpclient'
|
10
|
-
require '
|
8
|
+
require 'rexml/document'
|
11
9
|
|
12
10
|
class Pastebin
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
# "decription" => "",
|
19
|
-
# "tags" => "",
|
20
|
-
# "exipry" => "",
|
21
|
-
# "type" => "",
|
22
|
-
# "config" => "config file",
|
23
|
-
# })
|
24
|
-
# pbin.paste #=> "http://pastebin.ca/xxxxxxx"
|
25
|
-
#
|
26
|
-
# If you are going to use this object to retrieve text from a
|
27
|
-
# paste, then you do not need an argument.
|
28
|
-
#
|
29
|
-
# pbin = Pastbin.new
|
30
|
-
# pbin.get_raw("http://pastebin.ca/xxxxxxx") #=> "some text"
|
31
|
-
#
|
32
|
-
def initialize(options = {})
|
11
|
+
include REXML
|
12
|
+
|
13
|
+
# The only option required is 'paste_code', which holds your string.
|
14
|
+
#
|
15
|
+
def initialize(options)
|
33
16
|
@options = options
|
34
|
-
if @options.has_key?("config")
|
35
|
-
@config = options["config"]
|
36
|
-
@options.delete("config")
|
37
|
-
else
|
38
|
-
@config = "#{ENV['HOME']}/.paster.yaml"
|
39
|
-
end
|
40
|
-
@options["type"] = "1"
|
41
|
-
if File.exists? @config
|
42
|
-
config = YAML.load(File.open(@config))
|
43
|
-
else
|
44
|
-
FileUtils.touch @config
|
45
|
-
config = {}
|
46
|
-
puts "Please enter your API key. You'll only have to do this once."
|
47
|
-
print "You can get a key here: http://pastebin.ca/apikey.php \n "
|
48
|
-
config['key'] = gets.chomp
|
49
|
-
@options["api"] = config['key']
|
50
|
-
open(@config, 'w'){ |f| YAML.dump(config, f) }
|
51
|
-
puts "Thank you. Please run the script again. Run #{$0} --help to see all the options."
|
52
|
-
exit
|
53
|
-
end
|
54
17
|
end
|
55
18
|
|
56
19
|
# This POSTs the paste and returns the link
|
57
20
|
#
|
58
|
-
# pbin.paste #=> "http://pastebin.
|
21
|
+
# pbin.paste #=> "http://pastebin.com/xxxxxxx"
|
59
22
|
#
|
60
23
|
def paste
|
61
|
-
if @options.has_key?("
|
62
|
-
if @options["
|
63
|
-
@options["
|
24
|
+
if @options.has_key?("paste_code")
|
25
|
+
if @options["paste_code"] == "-"
|
26
|
+
@options["paste_code"] = $stdin.read
|
64
27
|
else
|
65
|
-
File.open(@options["
|
66
|
-
@options["
|
28
|
+
File.open(@options["paste_code"]) do |file|
|
29
|
+
@options["paste_code"] = file.read
|
67
30
|
end
|
68
31
|
end
|
69
|
-
else
|
70
|
-
|
71
|
-
|
32
|
+
#else
|
33
|
+
# puts "You must specify a file or '-' for STDIN"
|
34
|
+
# exit
|
72
35
|
end
|
73
36
|
clnt = HTTPClient.new
|
74
|
-
clnt.post("http://pastebin.
|
75
|
-
success_fail = $1
|
76
|
-
code_reason = $2
|
77
|
-
if success_fail == "SUCCESS"
|
78
|
-
"http://pastebin.ca/" + code_reason
|
79
|
-
elsif success_fail == "FAIL"
|
80
|
-
"#{$0} Error: #{$2}"
|
81
|
-
else
|
82
|
-
"#{$0} Error: Unknown Error"
|
83
|
-
end
|
37
|
+
clnt.post("http://pastebin.com/api_public.php", @options).content
|
84
38
|
end
|
85
39
|
|
86
40
|
# This method takes a link from a previous paste and returns the raw
|
87
41
|
# text.
|
88
42
|
#
|
89
|
-
# pbin.get_raw("http://pastebin.
|
43
|
+
# pbin.get_raw("http://pastebin.com/xxxxxxx") #=> "some text"
|
90
44
|
#
|
91
45
|
def get_raw(link)
|
92
|
-
clnt = HTTPClient.new(:agent_name => 'ruby
|
93
|
-
clnt.get_content("http://pastebin.
|
46
|
+
clnt = HTTPClient.new(:agent_name => 'ruby pastebin gem')
|
47
|
+
paste = clnt.get_content("http://pastebin.com/raw.php?i=#{link[/[\w\d]+$/]}")
|
48
|
+
doc = Document.new(paste)
|
49
|
+
doc.elements.to_a("//pre")[0].text
|
94
50
|
end
|
95
51
|
end
|
data/spec/pastebin_spec.rb
CHANGED
@@ -3,22 +3,28 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
3
3
|
describe "Pastebin" do
|
4
4
|
before do
|
5
5
|
`echo "hello world" > /tmp/hw.txt`
|
6
|
-
options = {"
|
6
|
+
options = {"paste_code" => "/tmp/hw.txt",
|
7
|
+
"paste_expire_date" => "10 Minutes",
|
8
|
+
"paste_private" => "1"}
|
7
9
|
@pbin = Pastebin.new(options)
|
8
10
|
end
|
9
11
|
|
12
|
+
after do
|
13
|
+
`rm /tmp/hw.txt`
|
14
|
+
end
|
15
|
+
|
10
16
|
it "tests that @pbin is indeed a Pastebin object" do
|
11
17
|
@pbin.class.to_s.should == "Pastebin"
|
12
18
|
end
|
13
19
|
|
14
20
|
it "should paste some text and return a link" do
|
15
|
-
@
|
16
|
-
@
|
21
|
+
@link = @pbin.paste
|
22
|
+
@link.should match(/http:.*\/[\d\w]+/)
|
17
23
|
end
|
18
24
|
|
19
25
|
it "should return raw text from a paste link" do
|
20
|
-
|
21
|
-
text = @pbin.get_raw(
|
26
|
+
link = @pbin.paste
|
27
|
+
text = @pbin.get_raw(link)
|
22
28
|
text.should match(/hello world/)
|
23
29
|
end
|
24
30
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
|
-
require 'spec'
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
4
1
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
|
+
require 'rspec'
|
5
4
|
require 'pastebin'
|
6
5
|
|
7
|
-
|
6
|
+
# Requires supporting files with custom matchers and macros, etc,
|
7
|
+
# in ./support/ and its subdirectories.
|
8
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
9
|
+
|
10
|
+
RSpec.configure do |config|
|
8
11
|
|
9
12
|
end
|
metadata
CHANGED
@@ -3,10 +3,10 @@ name: pastebin
|
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
|
-
- 0
|
7
|
-
- 2
|
8
6
|
- 1
|
9
|
-
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
version: 1.0.0
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- dougsko
|
@@ -14,34 +14,81 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-12-03 00:00:00 -05:00
|
18
18
|
default_executable: pastebin
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
name:
|
22
|
-
prerelease: false
|
21
|
+
name: rspec
|
23
22
|
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ~>
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 2
|
29
|
+
- 1
|
30
|
+
- 0
|
31
|
+
version: 2.1.0
|
32
|
+
type: :development
|
33
|
+
version_requirements: *id001
|
34
|
+
prerelease: false
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: bundler
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ~>
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
segments:
|
43
|
+
- 1
|
44
|
+
- 0
|
45
|
+
- 0
|
46
|
+
version: 1.0.0
|
47
|
+
type: :development
|
48
|
+
version_requirements: *id002
|
49
|
+
prerelease: false
|
50
|
+
- !ruby/object:Gem::Dependency
|
51
|
+
name: jeweler
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
53
|
+
none: false
|
54
|
+
requirements:
|
55
|
+
- - ~>
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
segments:
|
58
|
+
- 1
|
59
|
+
- 5
|
60
|
+
- 1
|
61
|
+
version: 1.5.1
|
62
|
+
type: :development
|
63
|
+
version_requirements: *id003
|
64
|
+
prerelease: false
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: rcov
|
67
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
68
|
+
none: false
|
24
69
|
requirements:
|
25
70
|
- - ">="
|
26
71
|
- !ruby/object:Gem::Version
|
27
72
|
segments:
|
28
73
|
- 0
|
29
74
|
version: "0"
|
30
|
-
type: :
|
31
|
-
version_requirements: *
|
32
|
-
|
75
|
+
type: :development
|
76
|
+
version_requirements: *id004
|
77
|
+
prerelease: false
|
78
|
+
description: CLI tool and library to work with pastebin.com
|
33
79
|
email: dougtko@gmail.com
|
34
80
|
executables:
|
35
81
|
- pastebin
|
36
82
|
extensions: []
|
37
83
|
|
38
84
|
extra_rdoc_files:
|
39
|
-
- LICENSE
|
85
|
+
- LICENSE.txt
|
40
86
|
- README.rdoc
|
41
87
|
files:
|
42
88
|
- .document
|
43
|
-
-
|
44
|
-
-
|
89
|
+
- Gemfile
|
90
|
+
- Gemfile.lock
|
91
|
+
- LICENSE.txt
|
45
92
|
- README.rdoc
|
46
93
|
- Rakefile
|
47
94
|
- VERSION
|
@@ -51,22 +98,24 @@ files:
|
|
51
98
|
- spec/spec_helper.rb
|
52
99
|
has_rdoc: true
|
53
100
|
homepage: http://github.com/dougsko/pastebin
|
54
|
-
licenses:
|
55
|
-
|
101
|
+
licenses:
|
102
|
+
- MIT
|
56
103
|
post_install_message:
|
57
|
-
rdoc_options:
|
58
|
-
|
104
|
+
rdoc_options: []
|
105
|
+
|
59
106
|
require_paths:
|
60
|
-
-
|
61
|
-
- /lib
|
107
|
+
- lib
|
62
108
|
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
+
none: false
|
63
110
|
requirements:
|
64
111
|
- - ">="
|
65
112
|
- !ruby/object:Gem::Version
|
113
|
+
hash: 3
|
66
114
|
segments:
|
67
115
|
- 0
|
68
116
|
version: "0"
|
69
117
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
70
119
|
requirements:
|
71
120
|
- - ">="
|
72
121
|
- !ruby/object:Gem::Version
|
@@ -76,10 +125,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
125
|
requirements: []
|
77
126
|
|
78
127
|
rubyforge_project:
|
79
|
-
rubygems_version: 1.3.
|
128
|
+
rubygems_version: 1.3.7
|
80
129
|
signing_key:
|
81
130
|
specification_version: 3
|
82
|
-
summary:
|
131
|
+
summary: CLI tool and library to work with pastebin.com
|
83
132
|
test_files:
|
84
133
|
- spec/pastebin_spec.rb
|
85
134
|
- spec/spec_helper.rb
|
data/LICENSE
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# Command line interface to http://pastebin.ca
|
2
|
-
# Copyright (C) 2009 dougsko
|
3
|
-
#
|
4
|
-
# This program is free software: you can redistribute it and/or modify
|
5
|
-
# it under the terms of the GNU General Public License as published by
|
6
|
-
# the Free Software Foundation, either version 3 of the License, or
|
7
|
-
# (at your option) any later version.
|
8
|
-
#
|
9
|
-
# This program is distributed in the hope that it will be useful,
|
10
|
-
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
-
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
-
# GNU General Public License for more details.
|
13
|
-
#
|
14
|
-
# You should have received a copy of the GNU General Public License
|
15
|
-
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|