Skip to content
This repository has been archived by the owner on Jun 13, 2018. It is now read-only.

Cleanup README and docs and metadata #431

Merged
merged 2 commits into from
Dec 5, 2016
Merged

Cleanup README and docs and metadata #431

merged 2 commits into from
Dec 5, 2016

Conversation

kmcphillips
Copy link
Member

@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.

@@ -1,26 +1,3 @@
#--
# Copyright (c) 2009 Jaded Pixel
Copy link
Member Author

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).
Copy link
Contributor

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).
Copy link
Contributor

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.
Copy link
Contributor

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.

Copy link
Member Author

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
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Member Author

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'
Copy link
Contributor

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
Copy link
Contributor

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?

@kmcphillips
Copy link
Member Author

Great feedback. Updated.

* 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.
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

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]

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor

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

@kmcphillips kmcphillips merged commit e8ac53f into master Dec 5, 2016
@kmcphillips kmcphillips deleted the doc-cleanup branch December 5, 2016 18:36
@mdking
Copy link
Contributor

mdking commented Dec 7, 2016

👍

@kmcphillips kmcphillips deployed to rubygems-1-9-stable January 30, 2017 18:52 Active
maartenvg pushed a commit that referenced this pull request Nov 9, 2017
Cleanup README and docs and metadata
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants