-
Notifications
You must be signed in to change notification settings - Fork 545
Conversation
@@ -1,26 +1,3 @@ | |||
#-- | |||
# Copyright (c) 2009 Jaded Pixel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂
|
||
For the features that you add, you should have both unit tests and remote tests. It's probably best to start with the remote tests, and then log those requests and responses and use them as the mocks for the unit tests. You can see how this works with the USPS tests right now: | ||
It would also e good to familiarize yourself with [Location](https://github.com/Shopify/active_shipping/blob/master/lib/active_shipping/location.rb), [Package](https://github.com/Shopify/active_shipping/blob/master/lib/active_shipping/package.rb), and [Response](https://github.com/Shopify/active_shipping/blob/master/lib/active_shipping/response.rb). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/e/be
|
||
For the features that you add, you should have both unit tests and remote tests. It's probably best to start with the remote tests, and then log those requests and responses and use them as the mocks for the unit tests. You can see how this works with the USPS tests right now: | ||
It would also e good to familiarize yourself with [Location](https://github.com/Shopify/active_shipping/blob/master/lib/active_shipping/location.rb), [Package](https://github.com/Shopify/active_shipping/blob/master/lib/active_shipping/package.rb), and [Response](https://github.com/Shopify/active_shipping/blob/master/lib/active_shipping/response.rb). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be consistent with other links, surround classnames with backticks (Location
, Package
, and Response
)
[https://github.com/Shopify/active_shipping/blob/master/test/remote/usps_test.rb](https://github.com/Shopify/active_shipping/blob/master/test/remote/usps_test.rb) | ||
[https://github.com/Shopify/active_shipping/blob/master/test/unit/carriers/usps_test.rb](https://github.com/Shopify/active_shipping/blob/master/test/unit/carriers/usps_test.rb) | ||
[https://github.com/Shopify/active_shipping/tree/master/test/fixtures/xml/usps](https://github.com/Shopify/active_shipping/tree/master/test/fixtures/xml/usps) | ||
It's worth looking at [`test/console.rb`](https://github.com/Shopify/active_shipping/blob/master/test/console.rb) too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless we're going to give a reason as to why, I'd probably just drop this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added the reason
2. Create your feature branch (`git checkout -b my-new-feature`) | ||
3. Commit your changes (`git commit -am 'Add some feature'`) | ||
4. Push to the branch (`git push origin my-new-feature`) | ||
5. Create a new Pull Request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we put all of this section in CONTRIBUTING.md
and just link to it from here? I'm not sure what we've done for other open source projects.
|
||
After you've pushed your well-tested changes to your github fork, make a pull request, and we'll take it from there! For more information, see [CONTRIBUTING.md](https://github.com/Shopify/active_shipping/blob/master/CONTRIBUTING.md). | ||
### How to contribute |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe drop this section? I would assume that anyone on GitHub with a desire to contribute will likely know these steps. We could also link to some GitHub documentation that outlines all/most of these steps. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda like that it shows "yes this repo is the same as others".
``` | ||
Using bundler, add to the `Gemfile`: | ||
|
||
gem 'active_shipping' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code fence blocks, here and below?
|
||
The :login key passed to ```ActiveShipping::FedEx.new()``` is really the FedEx meter number, not the FedEx login. | ||
``` | ||
rake test:remote |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bundle exec
, to be consistent with the above command?
950b221
to
f3d982e
Compare
Great feedback. Updated. |
f3d982e
to
5a91534
Compare
* PR should explain what the feature does, and why the change exists. | ||
* PR should include any carrier specific documentation explaining how it works. | ||
* Code _must_ be tested, including both unit and remote tests where applicable. | ||
* Be consistent. Write clean code that follows Ruby community standards. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we link example documentation? https://github.com/bbatsov/ruby-style-guide is a great public resource that most people know of but having a reference is pretty good.
``` | ||
|
||
...or add it to your project's [Gemfile](http://bundler.io/). | ||
|
||
## Sample Usage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In here (well, below), can you update the ActiveShipping::Package
comments to explain it's in HWL order? Nothing indicates that and having to dig into the source code to know something as trivial as parameter ordering kinda blows. Especially since we typically expect LWH in the shipping industry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See:
when :x, :max, :length, :long then ary[2] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add it. But we may want to fix this or be more explicit/opinionated about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, keyword arguments could be a verbose way of doing it but even just following conventional LWH would be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually was starting some work to create a wrapper class around this so that the detail could be hidden and we could start writing something like thing.length
instead of thing[index]
. I should clue that up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added issue outlining problems: #434
5a91534
to
f9f0959
Compare
👍 |
Cleanup README and docs and metadata
@jonathankwok @mdking @thegedge
Moving around documentation and getting it up to date. Removing references to Jaded Pixel. Setting expectations for contribution. Getting everything more consistent and cleaned up.
Bonus: Forgot to require pry in test.