lib/github_api/gitignore.rb in github_api-0.9.0 vs lib/github_api/gitignore.rb in github_api-0.9.1
- old
+ new
@@ -12,14 +12,13 @@
# github = Github.new
# github.gitignore.list
# github.gitignore.list { |template| ... }
#
def list(*args)
- params = args.extract_options!
- normalize! params
+ arguments(args)
- response = get_request("/gitignore/templates", params)
+ response = get_request("/gitignore/templates", arguments.params)
return response unless block_given?
response.each { |el| yield el }
end
alias :all :list
@@ -33,12 +32,11 @@
#
# = Examples
# github = Github.new
# github.gitignore.get "template-name", mime: 'applicatin/vnd.github.raw'
#
- def get(name, params={})
- normalize! params
- assert_presence_of name
+ def get(*args)
+ params = arguments(args, :required => [:name]).params
if (mime_type = params.delete('mime'))
options = { :raw => true, :headers => {'Accept' => mime_type} }
end