Sha256: b5a7e0d993f8b41ff7c5571c05c9e27cf994d180e7753324523fda6428ae68f7

Contents?: true

Size: 1.19 KB

Versions: 10

Compression:

Stored size: 1.19 KB

Contents

# Kagu

Ruby API to manage iTunes tracks and playlists.

## Installation

Just add this into your `Gemfile`:

```ruby
gem 'kagu'
```

Then, just run `bundle install`.

## Examples

### Displaying all tracks artist

```ruby
library = Kagu::Library.new

library.tracks.each do |track|
  puts track.artist
end
```

### Displaying all playlists and its tracks count

```ruby
library = Kagu::Library.new

library.playlists.each do |playlist|
  puts "#{playlist.name}: #{playlist.tracks.count}"
end
```

### Creating a playlist

```ruby
library = Kagu::Library.new

tracks = library.tracks.select { |track| track.genre == 'Drum & Bass' && track.added_at > 1.week.ago }
library.playlists.create(name: 'Recent - D&B', tracks: tracks)
```

### Finding some tracks

```ruby
library = Kagu::Library.new
library.finder.find(artist: 'Serial Killaz', title: 'Walk and Skank').each do
  puts track.id
end
```

### Configuring logger

In order to have some debug informations about what kagu does, you could
configure its logger:

```ruby
Kagu.logger = Logger.new(STDERR)
```

## Executing test suite

This project is fully tested with [Rspec 3](http://github.com/rspec/rspec).
Just run `bundle exec rake` (after a `bundle install`).

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kagu-2.0.1 README.mdown
kagu-2.0.0 README.mdown
kagu-1.2.3 README.mdown
kagu-1.2.2 README.mdown
kagu-1.2.1 README.mdown
kagu-1.2.0 README.mdown
kagu-1.1.2 README.mdown
kagu-1.1.1 README.mdown
kagu-1.1.0 README.mdown
kagu-1.0.0 README.mdown