Skip to content

Commit

Permalink
Merge branch 'master' of github.com:piotrmurach/github
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrmurach committed Jul 14, 2017
2 parents d397644 + d51f45a commit 29f93a8
Show file tree
Hide file tree
Showing 13 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion github_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Gem::Specification.new do |gem|

gem.add_dependency 'addressable', '~> 2.4'
gem.add_dependency 'hashie', '>= 3.4'
gem.add_dependency 'faraday', '~> 0.8', '< 0.10'
gem.add_dependency 'faraday', '~> 0.8'
gem.add_dependency 'oauth2', '~> 1.0'
gem.add_dependency 'descendants_tracker', '~> 0.0.4'
gem.add_dependency 'mime-types', '>= 1.16', '< 3.0'
Expand Down
6 changes: 3 additions & 3 deletions lib/github_api/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class API
include Request::Verbs
include RateLimit

attr_reader *Github.configuration.property_names
attr_reader(*Github.configuration.property_names)

attr_accessor *Validations::VALID_API_KEYS
attr_accessor(*Validations::VALID_API_KEYS)

attr_accessor :current_options

Expand Down Expand Up @@ -209,7 +209,7 @@ def self.method_added(method_name)
#
# @api private
def filter_callbacks(kind, action_name)
matched_callbacks = self.class.send("#{kind}_callbacks").select do |callback|
self.class.send("#{kind}_callbacks").select do |callback|
callback[:only].nil? || callback[:only].include?(action_name)
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/github_api/client/authorizations/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def check(*args)
if arguments.client_id
begin
get_request("/applications/#{arguments.client_id}/tokens/#{arguments.access_token}", params)
rescue Github::Error::NotFound => e
rescue Github::Error::NotFound
nil
end
else
Expand Down
2 changes: 1 addition & 1 deletion lib/github_api/client/markdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def render(*args)
#
def render_raw(*args)
params = arguments(args).params
mime_type, params['data'] = params['mime'], args.shift
params['data'] = args.shift
params['raw'] = true
params['accept'] = params.fetch('accept') { 'text/plain' }

Expand Down
2 changes: 0 additions & 2 deletions lib/github_api/client/repos.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ def contributors(*args)
arguments(args, required: [:user, :repo]) do
permit %w[ anon ]
end
params = arguments.params

response = get_request("/repos/#{arguments.user}/#{arguments.repo}/contributors", arguments.params)
return response unless block_given?
Expand Down Expand Up @@ -342,7 +341,6 @@ def edit(*args)
# @api public
def delete(*args)
arguments(args, required: [:user, :repo])
params = arguments.params

delete_request("/repos/#{arguments.user}/#{arguments.repo}", arguments.params)
end
Expand Down
1 change: 0 additions & 1 deletion lib/github_api/client/repos/collaborators.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ class Client::Repos::Collaborators < API
# @api public
def list(*args)
arguments(args, required: [:user, :repo])
params = arguments.params

response = get_request("/repos/#{arguments.user}/#{arguments.repo}/collaborators", arguments.params)
return response unless block_given?
Expand Down
2 changes: 1 addition & 1 deletion lib/github_api/client/repos/releases/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def list(*args)
#
# @api public
def get(*args)
params = arguments(args, required: [:owner, :repo, :id]).params
arguments(args, required: [:owner, :repo, :id]).params

get_request("/repos/#{arguments.owner}/#{arguments.repo}/releases/assets/#{arguments.id}" , arguments.params)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/github_api/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def initialize(message = $!)
end

def backtrace
if @response_message && @response_message.respond_to?(:backtrace)
if @response_message.respond_to?(:backtrace)
@response_message.backtrace
else
super
Expand Down
2 changes: 1 addition & 1 deletion lib/github_api/ext/faraday.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ParamsHash
def params_encoder(encoder = nil)
if encoder
@encoder = encoder
else
elsif defined?(@encoder)
@encoder
end
end
Expand Down
1 change: 0 additions & 1 deletion lib/github_api/request/jsonize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def encode_body(value)
end

def request_with_body?(env)
type = request_type(env)
has_body?(env) and safe_to_modify?(env)
end

Expand Down
1 change: 1 addition & 0 deletions lib/github_api/response_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def initialize(response, current_api)
@response = response
@current_api = current_api
@env = response.env
@body = nil
end

# Overwrite methods to hash keys
Expand Down
2 changes: 1 addition & 1 deletion spec/github/paged_request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
let(:current_api) { Github::Client::Repos.new }
let(:path) { "/repositories/"}
let(:klass) {
klass = Class.new do
Class.new do
include Github::PagedRequest
end
}
Expand Down
2 changes: 1 addition & 1 deletion spec/github/validations/required_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
describe Github::Validations::Required do

let(:validator) {
klaz = Class.new.extend(described_class)
Class.new.extend(described_class)
}

context '#assert_required_keys' do
Expand Down

0 comments on commit 29f93a8

Please sign in to comment.