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

Take default value from a keyword argument #112

Merged
merged 1 commit into from
May 19, 2021

Conversation

waiting-for-dev
Copy link
Member

From now on, the default value for a setting must be provided through
the default: keyword argument. I.e.:

setting :name, default: 'Alice'

Providing it as a positional argument is still supported but deprecated.

@timriley this is basically your code on #86 (so feel free to add you as commit author 😅 )

@solnic , continuing from #110 (comment), extracting the deprecation expectations is a bit tricky because of global state + the need to rewind IO before asserting. So I just repeated the code for now. We could just remove the expectation altogether, as it's not that important and it'll be removed when version 1.0 is released.

@waiting-for-dev waiting-for-dev requested a review from solnic as a code owner May 17, 2021 10:09
@waiting-for-dev waiting-for-dev force-pushed the waiting-for-dev/default_keyword_argument branch from 9bace47 to 94029e1 Compare May 17, 2021 10:10
Copy link
Member

@timriley timriley left a comment

Choose a reason for hiding this comment

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

Looks good to me, @waiting-for-dev!

If you wanted to put co-author information on the commit message, that might be fun, but I'm good either way really, just happy to see the work moving forward :)

I also think the duplication of test setup for the logger is fine, this is just for deprecation messages after all, and these tests should go away in the release where we remove the deprecations.

Happy for you to merge when you're ready. Looking forward to figuring out a release plan from here!

@waiting-for-dev waiting-for-dev force-pushed the waiting-for-dev/processor_keyword_argument branch from 73945a7 to b118da0 Compare May 17, 2021 15:22
Base automatically changed from waiting-for-dev/processor_keyword_argument to master May 17, 2021 15:27
@waiting-for-dev waiting-for-dev force-pushed the waiting-for-dev/default_keyword_argument branch from 94029e1 to c1893ee Compare May 17, 2021 15:36
@waiting-for-dev
Copy link
Member Author

Thanks @timriley.

I added you as a co-author 🙂

However, it seems that the tests are failing for ruby 3.0, I'll try to fix it tomorrow.

@waiting-for-dev waiting-for-dev force-pushed the waiting-for-dev/default_keyword_argument branch 2 times, most recently from 36b90c5 to 9333ef9 Compare May 18, 2021 18:02
From now on, the default value for a setting must be provided through
the `default:` keyword argument. I.e.:

```ruby
setting :db, default: 'mysql://localhost/dev'
```

Providing it as a positional argument is still supported but deprecated.

Co-authored-by: Tim Riley <tim@riley.id.au>
@waiting-for-dev waiting-for-dev force-pushed the waiting-for-dev/default_keyword_argument branch from 9333ef9 to 06ab2f0 Compare May 19, 2021 02:58
@waiting-for-dev waiting-for-dev merged commit 726ad1e into master May 19, 2021
@waiting-for-dev waiting-for-dev deleted the waiting-for-dev/default_keyword_argument branch May 19, 2021 03:01
@waiting-for-dev
Copy link
Member Author

Fixed for 3.0 and merged 🚀

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.

2 participants