Giter Site home page Giter Site logo

snitcher's People

Contributors

arotc7 avatar brianhempel avatar cameronbass avatar danabrit avatar danielmorrison avatar ersatzryan avatar gaffneyc avatar jiikko avatar laserlemon avatar ryanfox1985 avatar ryoung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

snitcher's Issues

Don't support whitespace in tag name

  1. Create a tag with whitespace, e.g. "hellow world"
  2. client.tagged_snitches(["hello world"])

Failed with: TypeError: no implicit conversion of String into Integer

Release version 0.2.0

Addition of the "snitch" executable warrants a minor version release. As of 309ed15, master is ready to be released.

@gaffneyc: Could you give me release rights?

About API key configuration

The recent change for setting the API key modifies the client interface (8af709c). It's in the right direction but I suggest to consider to automatically pick up the ENV['DEADMANSSNITCH_API_KEY'] as the key, which is automatically set through Heroku add-on. Though not everyone may use it through Heroku, I think it makes very much sense, otherwise people like myself ended up doing Snitcher::API::Client.new(ENV['DEADMANSSNITCH_API_KEY']).

Raise an exception on check-in failure

Currently, a failed check-in just returns false. Users will most likely want to fire and forget, where returning false would hide errors.

Introduce a Snitcher::Error class with subclasses for all of the ways a check-in might fail. Failed check-ins will raise the appropriate error.

All errors should include a descriptive message useful for diagnosing the issue. If due to a 4xx or 5xx response from the check-in request, the HTTP response object should also be provided within the error instance.

Incorrect API key causes nondescript error

Thanks for providing a prebuilt Ruby gem for interacting with DMS. I used it to parse some meta data I added to our crontab to automatically add 91 cron jobs in one go. We're pretty happy with it all so far. I did run into a small problem that would probably be worth fixing for future users.

Instead of raising an exception, the following code bombs out if an incorrect API key is used:

require 'snitcher/api'
client = Snitcher::API::Client.new(api_key: "INCORRECTKEY")

# the next line fails
snitches = client.snitches

The error is:

/home/jcross/.gem/ruby/gems/snitcher-0.3.2/lib/snitcher/api/snitch.rb:34:in `[]': no implicit conversion of String into Integer (TypeError)
    from /home/jcross/.gem/ruby/gems/snitcher-0.3.2/lib/snitcher/api/snitch.rb:34:in `initialize'
    from /home/jcross/.gem/ruby/gems/snitcher-0.3.2/lib/snitcher/api/client.rb:294:in `new'
    from /home/jcross/.gem/ruby/gems/snitcher-0.3.2/lib/snitcher/api/client.rb:294:in `block in snitch_array'
    from /home/jcross/.gem/ruby/gems/snitcher-0.3.2/lib/snitcher/api/client.rb:292:in `each'
    from /home/jcross/.gem/ruby/gems/snitcher-0.3.2/lib/snitcher/api/client.rb:292:in `snitch_array'
    from /home/jcross/.gem/ruby/gems/snitcher-0.3.2/lib/snitcher/api/client.rb:49:in `snitches'
    from add_tags.rb:5:in `<main>'

The payload passed into the snitch initializer is:

[:message, "Response unsuccessful"]

It would be helpful if an exception was thrown with a message of something along the lines of "Access Denied for API Key."

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.