Created
January 23, 2010 21:45
-
-
Save zaach/284817 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Pastie | |
# Paste source code to pasite.org | |
# | |
# Required arguments | |
# source : the source code | |
# | |
# Optional arguments | |
# format : file format for syntax highlighting (defualt: txt) | |
# private : post a private pastie (default: false) | |
# | |
# Return value | |
# id of pastie as an int | |
# | |
# Possible errors | |
# ArgumentError : wrong number of arguments | |
# PasteError : error returned from pasite service | |
# | |
# Examples | |
# Pastie.paste("hello world!") | |
# Pastie.paste("<strong>hello world!</strong>", "html") | |
# Pastie.paste("seekrets", "txt", true) | |
# | |
def self.paste(source, format="txt", private=false) | |
end | |
# Paste source code to pasite.org | |
# | |
# Required arguments | |
# source : the source code | |
# | |
# Optional arguments | |
# format : file format for syntax highlighting (defualt: txt) | |
# | |
# Return value | |
# id of pastie as an int | |
# | |
# Possible errors | |
# ArgumentError : wrong number of arguments | |
# PasteError : error returned from pasite service | |
# Net::HTTP error : service | |
# | |
# Examples | |
# Pastie.private_paste("seekrets") | |
# Pastie.private_paste("<em>seekrets</em>", "html") | |
# | |
def self.private_paste(source, format="txt") | |
end | |
# Copy source from pastie.org given a valid identifie | |
# | |
# Required arguments | |
# id : id of pastie | |
# | |
# Return value | |
# source : source code of pastie identified by id | |
# | |
# Possible errors | |
# ArgumentError : wrong number of arguments | |
# InvalidIdentifierError : identifier not found on pasite.org | |
# | |
# Examples | |
# Pastie.copy(id) | |
# | |
def self.copy(id) | |
end | |
# paste_{FORMAT} | |
# | |
# creates a pastie in the format of the portion of the method after the underscore | |
# e.g. Pastie.paste_html("foo") is equivalent to Pastie.paste("foo", "html") | |
# | |
def method_missing(m, *args) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment