Gem Version Build Status Code Climate Coverage Status Dependency Status

Omnijack

A Ruby client interface to Chef's Omnitruck API.

Installation

Add this line to your application's Gemfile:

gem 'omnijack'

And then execute:

$ bundle

Or install it yourself as:

$ gem install omnijack

Usage

Getting Chef-DK project data from the official Chef API:

require 'omnijack'

chef_dk = Omnijack::Project::ChefDk.new

Getting Chef-DK package metadata (requires additional target platform information):

chef_dk = Omnijack::Project::ChefDk.new(platform: 'ubuntu',
                                        platform_version: '14.04',
                                        machine_arch: 'x86_64')
 = chef_dk.

puts 

puts .url
puts .filename
puts .md5
puts .sha256
puts .yolo
puts .version
puts .build

puts [:url]
puts [:filename]
puts [:md5]
puts [:sha256]
puts [:yolo]
puts [:version]
puts [:build]

Getting Chef-DK project data from an unofficial Omnitruck API:

Omnijack::Project::ChefDk.new(
  base_url: 'https://some.custom.chef.api/endpoint'
)

Getting Chef-DK project data for a version other than the latest release:

Omnijack::Project::ChefDk.new(
  version: '1.2.3',
  prerelease: true,
  nightlies: true
)

Getting Chef project data:

Omnijack::Project::Chef.new

Getting the Chef project's list of packages:

list = Omnijack::Project::Chef.new.list
puts list.to_h

Getting the Chef project's platform mappings:

platforms = Omnijack::Project::Chef.new.platforms
puts platforms.to_h

Getting AngryChef project data:

Omnijack::Project::AngryChef.new

Getting Chef-Container project data:

Omnijack::Project::ChefContainer.new

Getting Chef Server project data:

Omnijack::Project::ChefServer.new

Contributing

  1. Fork it ( https://github.com/[my-github-username]/omnijack/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Add tests for any new code and ensure all tests pass (rake)
  4. Commit your changes (git commit -am 'Add some feature')
  5. Push to the branch (git push origin my-new-feature)
  6. Create a new Pull Request