Skip to content

Conversation

@jjb
Copy link

@jjb jjb commented Mar 2, 2018

note: this is based on #8, so that should be merged first. Then this can be rebased and look tidier.


Various code improvements, some more opinionated than others. Look at individual commits.

Because it's removing support for ruby < 2, version, the major version will need to be bumped. since ruby 2.3 will be EOL soon, support 2+ seems quite reasonable.

Let me know if you dislike any particular changes, I can remove those.

let me know what you think!

jjb added 9 commits March 2, 2018 17:43
As of May 2017, successful submissions to stathat do
not return a body:

https://blog.stathat.com/2017/05/05/bandwidth.html

This changes the code and tests to accommodate this new behavior.

- the success code is now 200, not 204, so all 200s are
  considered successful
- because there is no body, we no longer check for resp.msg == "ok"
- oddly, failures return a "status: 500" in their body, but
  still have a 200 success code. I don't know if this is desired behavior or a bug,
  and I don't know how long this has been the case. i have written to StatHat support about it.
  so, we still parse for a code in the body and let it take precedent
- consistent use of {} for one-line blocks
- use do..end for more complicated block
@jjb jjb force-pushed the code-improvements branch from 0f7ff23 to 26238d3 Compare March 19, 2018 21:08
@jjb jjb closed this Mar 19, 2018
@jjb jjb deleted the code-improvements branch March 19, 2018 21:10
@jjb jjb restored the code-improvements branch March 20, 2018 21:02
@jjb jjb reopened this Mar 20, 2018
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.

1 participant