Project

ravelry

0.02
No commit activity in last 3 years
No release in over 3 years
Ruby gem for accessing the Ravelry API painlessly, easily, and awesomely.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0
~> 3.0
~> 2.14
~> 0.8

Runtime

~> 0.8
 Project Readme

Ravelry

You are reading documentation for version: 0.2.0

Codeship Status for ArtCraftCode/ravelry

The Ruby gem for accessing the Ravelry API painlessly, easily, and awesomely! This gem is actively being developed. Be sure to check the branch for the version you're using.

Important and helpful links:

API coverage

See documentation for each class (or module) to see how to initialize the objects.

API Endpoint Ravelry gem class / module
Misc color_families Ravelry::Misc.color_families
Misc yarn_weights Ravelry::Misc.yarn_weights
Misc current_user Ravelry::Misc.current_user
Needles list Ravelry::Needles.list
Needles sizes Ravelry::Needles.sizes
Needles types Ravelry::Needles.types
Patterns comments Ravelry::Pattern.comments
Patterns search Ravelry::Pattern.search
Patterns show Ravelry::Pattern.get
People show Ravelry::User.get

Installation

To install, type:

gem install ravelry

Hooray! You now have a gem.

Add to your Gemfile:

gem "ravelry", "~> 0.2.0"

I highly recommend pinning your version because the gem is in active development and small changes and additions will be made regularly.

Run bundle install and proceed as usual.

Configuration

API keys must be configured in the gem setup. You can do this anywhere in your application before you make API calls using the gem.

Ravelry.configure do |config|
  config.access_key = ''
  config.secret_key = ''
  config.personal_key = ''
  config.callback_url = ''
end
  • config.access_key - your Ravelry access key
  • config.secret_key - your Ravelry secret key
  • config.personal_key - wait for it! Your Ravelry personal key; primarily used for OAuth (not yet implemented in the gem)
  • config.callback_url - for OAuth, the callback url for your authentication requests

Getting these keys requires a (free) Ravelry account and that you agree to the terms of use for the API.

The keys are available to you throughout your application as:

Ravelry.configuration.access_key
Ravelry.configuration.secret_key
Ravelry.configuration.personal_key
Ravelry.configuration.callback_url

Usage

Full documentation for this gem is available here.

Conventions

This gem makes use of several conventions that are worth noting on a global scale.

Method names ending with _count return integers.

Example:

pattern.comments_count
# => 4

Method names ending with _float, _integer, etc return that object type.

Float to Integer conversions are done using round(0).

Example:

pattern.difficulty_average_float
# => 4.666666667

pattern.difficulty_average_integer
# => 5

Contributing

Hey! You want to contribute? That is super, super awesome. Visit the project's Trello board to see what's coming up next or what is already in progress.

Send me a pull request! Please write tests, documentation for your code (the test part kind of goes without saying, but I wanted to make sure that you knew about it and the documentation), and update the changelog with your additions under the next unreleased version.

To run specs locally, simply bundle and then run rpsec.

Documentation is generated by YARD and is producted using inline comments. Comments use Markdown syntax. You can run yard server to get a live server of documentation while you're working :)