New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bark

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bark

  • 0.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

bark

Continuous Integration Status Dependency Status rubydoc

Bark is a Ruby Gem wrapper on the Open Tree of Life API. It was written over the course of the OpenTree hackathon At present it seeks to provide a simple (level 1 in terms of hackathon speak) wrapper over all of the API calls available, returning a native json object for each response. It also acts as a sanity checker on the API calls themselves, running a suite of unit tests shared by related wrappers in Python and R.

Installation

Bark is written targetting Ruby 2.1.x.

Add this line to your application's Gemfile:

gem 'bark'

And then execute:

$ bundle

Or install it yourself as:

$ gem install bark

Usage

Bark is broken down into Request and Response objects. These are additionally wrapped with a set of helper methods that map 1:1 with the Open Tree URLs. Binding method names follow a convention adopted by the related Python and R frameworks.

In your script:

  require 'bark'  # => true

Simple usage

  Bark.tol_about  # => { big hash }

Pass parameters like so:

  Bark.get_study(params: {:study_id => '2113'})   # => {big json response}

Parameter keys can be symbols or strings. Available methods are listed here.

Request/Response style

    request = Bark::Request::Studies.new(method: :get_study, params: {study_id: '2113'})  # => #<Bark::Request::Studies:0x0000010310d340 @method=:get_study, @params={:study_id=>"2113"}, @uri=#<URI::HTTP:0x0000010310c508 URL:http://devapi.opentreeoflife.org/v2/study/2113>> 

Pre-check the validity of the requst (NOTE: mapping/checking is in development)

    request.valid? # => true 

Get a response:

    response = Bark::Response.new(request: request)  # =>  #<Bark::Response:0x0000010334c138 @json={ ... big response ... }
    response.json   # =>  { ... big response ... }

Documentation

Documentation is autogenerated at RubyDoc.info

Contributing

  1. Fork it ( http://github.com/SpeciesFileGroup/bark/fork )
  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 new Pull Request

Licence

Bark is open source, it is available under the BSD licence.

FAQs

Package last updated on 24 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc