lib/github_api/events.rb in github_api-0.7.0 vs lib/github_api/events.rb in github_api-0.7.1

- old
+ new

@@ -33,11 +33,11 @@ # github.events.repository 'user-name', 'repo-name' # github.events.repository 'user-name', 'repo-name' { |event| ... } # def repository(user_name, repo_name, params={}) _update_user_repo_params(user_name, repo_name) - _validate_user_repo_params(user, repo) unless user? && repo? + assert_presence_of user, repo normalize! params response = get_request("/repos/#{user}/#{repo}/events", params) return response unless block_given? response.each { |el| yield el } @@ -54,11 +54,11 @@ # github.events.issue 'user-name', 'repo-name' # github.events.issue 'user-name', 'repo-name' { |event| ... } # def issue(user_name, repo_name, params={}) _update_user_repo_params(user_name, repo_name) - _validate_user_repo_params(user, repo) unless user? && repo? + assert_presence_of user, repo normalize! params response = get_request("/repos/#{user}/#{repo}/issues/events", params) return response unless block_given? response.each { |el| yield el } @@ -74,11 +74,11 @@ # github.events.network 'user-name', 'repo-name' # github.events.network 'user-name', 'repo-name' { |event| ... } # def network(user_name, repo_name, params={}) _update_user_repo_params(user_name, repo_name) - _validate_user_repo_params(user, repo) unless user? && repo? + assert_presence_of user, repo normalize! params response = get_request("/networks/#{user}/#{repo}/events", params) return response unless block_given? response.each { |el| yield el } @@ -94,11 +94,11 @@ # github = Github.new # github.events.org 'org-name' # github.events.org 'org-name' { |event| ... } # def org(org_name, params={}) - _validate_presence_of org_name + assert_presence_of org_name normalize! params response = get_request("/orgs/#{org_name}/events", params) return response unless block_given? response.each { |el| yield el } @@ -125,11 +125,11 @@ # github = Github.new # github.events.received 'user-name', :public => true # github.events.received 'user-name', :public => true { |event| ... } # def received(user_name, params={}) - _validate_presence_of user_name + assert_presence_of user_name normalize! params public_events = if params['public'] params.delete('public') '/public' @@ -158,11 +158,11 @@ # github = Github.new # github.events.performed 'user-name', :public => true # github.events.performed 'user-name', :public => true { |event| ... } # def performed(user_name, params={}) - _validate_presence_of user_name + assert_presence_of user_name normalize! params public_events = if params['public'] params.delete('public') '/public' @@ -184,10 +184,10 @@ # github = Github.new # github.events.user_org 'user-name', 'org-name' # github.events.user_org 'user-name', 'org-name' { |event| ... } # def user_org(user_name, org_name, params={}) - _validate_presence_of user_name, org_name + assert_presence_of user_name, org_name normalize! params response = get_request("/users/#{user_name}/events/orgs/#{org_name}", params) return response unless block_given? response.each { |el| yield el }