Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to redefine api_url #6

Merged
merged 2 commits into from
Jan 12, 2017
Merged

Allow to redefine api_url #6

merged 2 commits into from
Jan 12, 2017

Conversation

Tuxii
Copy link

@Tuxii Tuxii commented Dec 5, 2016

My previous PR allowed to set a custom api_url attribute and not use the default one. But it wasn't possible to override this attribute multiple times during execution.
That's what this PR does.

described_class.api_url = nil
expect(described_class.instance.http_client.params).to eq(get_client_new_params)
described_class.api_url = 'http://foo.bar:1337'
expect(described_class.instance.http_client.params).to eq(get_client_new_params)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [86/80]


it 'can edit api_url' do
described_class.api_url = nil
expect(described_class.instance.http_client.params).to eq(get_client_new_params)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [86/80]

path: uri.path,
port: uri.port,
query: uri.query,
scheme: uri.scheme,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid comma after the last item of a hash.

@@ -23,7 +24,23 @@
end

describe '#api_url' do

def get_client_new_params

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method has too many lines. [11/10]
Do not prefix reader method names with get_.

@@ -23,7 +24,23 @@
end

describe '#api_url' do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra empty line detected at block body beginning.

end

def self.api_url=(url)
self.instance.api_url = url
@api_url = url
@http_client = Excon.new(self.api_url, omit_default_port: true)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant self detected.

@nevalla nevalla merged commit 4713165 into kontena:master Jan 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants