Permalink
Browse files

fix janky formatting in contents.rb

  • Loading branch information...
1 parent b384d27 commit 2c301712383bc91fb1dfcd8d84de9839a3845abd @joeyw joeyw committed Nov 30, 2012
Showing with 43 additions and 42 deletions.
  1. +43 −42 lib/octokit/client/contents.rb
@@ -2,49 +2,50 @@ module Octokit
class Client
module Contents
- # Receive the default Readme for a repository
- #
- # @param repo [String, Repository, Hash] A GitHub repository
- # @param ref [String] The String name of the Commit/Branch/Tag. Defaults to “master”.
- # @option options [String] :ref name of the Commit/Branch/Tag. Defaults to “master”.
- # @return [Hash] The detail of the readme
- # @see http://developer.github.com/v3/repos/contents/
- # @example Get the readme file for a repo
- # Octokit.readme("pengwynn/octokit")
- def readme(repo, options={})
- get("repos/#{Repository.new repo}/readme", options)
- end
+ # Receive the default Readme for a repository
+ #
+ # @param repo [String, Repository, Hash] A GitHub repository
+ # @param ref [String] The String name of the Commit/Branch/Tag. Defaults to “master”.
+ # @option options [String] :ref name of the Commit/Branch/Tag. Defaults to “master”.
+ # @return [Hash] The detail of the readme
+ # @see http://developer.github.com/v3/repos/contents/
+ # @example Get the readme file for a repo
+ # Octokit.readme("pengwynn/octokit")
+ def readme(repo, options={})
+ get("repos/#{Repository.new repo}/readme", options)
+ end
- # Receive a listing of a repository folder or the contents of a file
- #
- # @param repo [String, Repository, Hash] A GitHub repository
- # @option options [String] :path A folder or file path
- # @option options [String] :ref name of the Commit/Branch/Tag. Defaults to “master”.
- # @return [Hash] The contents of a file or list of the files in the folder
- # @see http://developer.github.com/v3/repos/contents/
- # @example List the contents of lib/octokit.rb
- # Octokit.contents("pengwynn/octokit", :path => 'lib/octokit.rb')
- def contents(repo, options={})
- repo_path = options.delete :path
- url = "repos/#{Repository.new repo}/contents/#{repo_path}"
- get(url, options)
- end
+ # Receive a listing of a repository folder or the contents of a file
+ #
+ # @param repo [String, Repository, Hash] A GitHub repository
+ # @option options [String] :path A folder or file path
+ # @option options [String] :ref name of the Commit/Branch/Tag. Defaults to “master”.
+ # @return [Hash] The contents of a file or list of the files in the folder
+ # @see http://developer.github.com/v3/repos/contents/
+ # @example List the contents of lib/octokit.rb
+ # Octokit.contents("pengwynn/octokit", :path => 'lib/octokit.rb')
+ def contents(repo, options={})
+ repo_path = options.delete :path
+ url = "repos/#{Repository.new repo}/contents/#{repo_path}"
+ get(url, options)
+ end
- # This method will provide a URL to download a tarball or zipball archive for a repository.
- #
- # @param repo [String, Repository, Hash] A GitHub repository.
- # @option options format [String] Either tarball (default) or zipball.
- # @option options [String] :ref Optional valid Git reference, defaults to master.
- # @return [String] Location of the download
- # @see http://developer.github.com/v3/repos/contents/
- # @example Get archive link for pengwynn/octokit
- # Octokit.archive_link("pengwynn/octokit")
- def archive_link(repo, options={})
- repo_ref = options.delete :ref
- format = (options.delete :format) || 'tarball'
- url = "repos/#{Repository.new repo}/#{format}/#{repo_ref}"
- request(:head, url, options).env[:url].to_s
- end
+ # This method will provide a URL to download a tarball or zipball archive for a repository.
+ #
+ # @param repo [String, Repository, Hash] A GitHub repository.
+ # @option options format [String] Either tarball (default) or zipball.
+ # @option options [String] :ref Optional valid Git reference, defaults to master.
+ # @return [String] Location of the download
+ # @see http://developer.github.com/v3/repos/contents/
+ # @example Get archive link for pengwynn/octokit
+ # Octokit.archive_link("pengwynn/octokit")
+ def archive_link(repo, options={})
+ repo_ref = options.delete :ref
+ format = (options.delete :format) || 'tarball'
+ url = "repos/#{Repository.new repo}/#{format}/#{repo_ref}"
+ request(:head, url, options).env[:url].to_s
+ end
+
+ end
end
end
-end

0 comments on commit 2c30171

Please sign in to comment.