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

Rename CDN::AWS to AWS::CDN #467

Merged
merged 3 commits into from Sep 18, 2018

Conversation

Projects
None yet
3 participants
@jaredbeck
Contributor

jaredbeck commented Sep 6, 2018

Fixes fog-core deprecation warning

[fog][DEPRECATION] Unable to load Fog::AWS::CDN
[fog][DEPRECATION] The format Fog::CDN::AWS is deprecated

Part of #466

Rename CDN::AWS to AWS::CDN
Fixes fog-core deprecation warning

```
[fog][DEPRECATION] Unable to load Fog::AWS::CDN
[fog][DEPRECATION] The format Fog::CDN::AWS is deprecated
```

Part of #466
@plribeiro3000

This comment has been minimized.

Show comment
Hide comment
@plribeiro3000

plribeiro3000 Sep 6, 2018

Member

👍 from me.

Need someone active on this repo to look and merge tho

Member

plribeiro3000 commented Sep 6, 2018

👍 from me.

Need someone active on this repo to look and merge tho

@jaredbeck

This comment has been minimized.

Show comment
Hide comment
@jaredbeck

jaredbeck Sep 6, 2018

Contributor

How should I run tests locally? I couldn't find any docs on it. So, I just pushed and hoped for CI to pass.

Contributor

jaredbeck commented Sep 6, 2018

How should I run tests locally? I couldn't find any docs on it. So, I just pushed and hoped for CI to pass.

@jaredbeck

This comment has been minimized.

Show comment
Hide comment
@jaredbeck

jaredbeck Sep 6, 2018

Contributor

Also,

Add a new class that just aliases (and will raise the warning if anybody includes directly).

I don't know how to do a warning. ActiveSupport has deprecate_constant but I assumed you don't want that dependency.

Contributor

jaredbeck commented Sep 6, 2018

Also,

Add a new class that just aliases (and will raise the warning if anybody includes directly).

I don't know how to do a warning. ActiveSupport has deprecate_constant but I assumed you don't want that dependency.

@plribeiro3000

This comment has been minimized.

Show comment
Hide comment
@plribeiro3000

plribeiro3000 Sep 6, 2018

Member

I believe you can just overwrite the constructor raising a deprecation notice and call super in the next line.

Member

plribeiro3000 commented Sep 6, 2018

I believe you can just overwrite the constructor raising a deprecation notice and call super in the next line.

@jaredbeck

This comment has been minimized.

Show comment
Hide comment
@jaredbeck

jaredbeck Sep 6, 2018

Contributor

I believe you can just overwrite the constructor raising a deprecation notice and call super in the next line.

Sorry, I don't understand. Which constructor?

Also, the assignment ..

# fog/aws/cdn.rb
Fog::CDN::AWS = Fog::AWS::CDN

.. is "by reference", so overwriting a method would affect both constants, wouldn't it?

Contributor

jaredbeck commented Sep 6, 2018

I believe you can just overwrite the constructor raising a deprecation notice and call super in the next line.

Sorry, I don't understand. Which constructor?

Also, the assignment ..

# fog/aws/cdn.rb
Fog::CDN::AWS = Fog::AWS::CDN

.. is "by reference", so overwriting a method would affect both constants, wouldn't it?

@plribeiro3000

This comment has been minimized.

Show comment
Hide comment
@plribeiro3000

plribeiro3000 Sep 6, 2018

Member

Yeap, the construction you made is not gonna work.

You will have to open the class and inherit manually then overwrite the method initialize.

If you take a look at the Fog::Service module you will see it has a new method being defined here

Sou you can open the class and define it like:

class Fog::CDN::AWS < Fog::AWS::CDN
  def self.new(config = {})
    Fog::Logger.deprecation 'Your message here'
    super(config)
  end
end
Member

plribeiro3000 commented Sep 6, 2018

Yeap, the construction you made is not gonna work.

You will have to open the class and inherit manually then overwrite the method initialize.

If you take a look at the Fog::Service module you will see it has a new method being defined here

Sou you can open the class and define it like:

class Fog::CDN::AWS < Fog::AWS::CDN
  def self.new(config = {})
    Fog::Logger.deprecation 'Your message here'
    super(config)
  end
end
@jaredbeck

This comment has been minimized.

Show comment
Hide comment
@jaredbeck

jaredbeck Sep 6, 2018

Contributor

You will have to open the class and inherit manually then overwrite the method initialize.

Done. Thanks.

Contributor

jaredbeck commented Sep 6, 2018

You will have to open the class and inherit manually then overwrite the method initialize.

Done. Thanks.

@geemus

This comment has been minimized.

Show comment
Hide comment
@geemus

geemus Sep 7, 2018

Member

Looks good to me, @plribeiro3000 does that match with what you were asking?

Member

geemus commented Sep 7, 2018

Looks good to me, @plribeiro3000 does that match with what you were asking?

@geemus

geemus approved these changes Sep 18, 2018

@geemus geemus merged commit d447be8 into fog:master Sep 18, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jaredbeck jaredbeck deleted the jaredbeck:fix_cdn_dpr_warn branch Sep 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment