1
0
Fork 0
musicbrainz.org Ruby client
Go to file
Gregory Eremin 2ed4c869cb Merge pull request #4 from endore-me/travis-ci-fix
move bundler gem dependency to gemspec only
2012-07-04 01:36:46 -07:00
lib Merge pull request #3 from Applicat/caching 2012-07-04 01:36:18 -07:00
spec Adds spec for caching musicbrainz requests. 2012-04-08 18:53:11 +02:00
test Merge pull request #3 from Applicat/caching 2012-07-04 01:36:18 -07:00
.document Initial commit to musicbrainz. 2011-07-18 03:46:18 +04:00
.gitignore Remove gemfile.lock 2011-10-19 17:51:54 +04:00
.travis.yml Fixing ruby encoding 2011-11-15 19:20:21 +04:00
Gemfile move bundler gem dependency to gemspec only 2012-06-21 10:07:34 +02:00
LICENSE.txt Initial commit to musicbrainz. 2011-07-18 03:46:18 +04:00
README.rdoc Adds a description about caching requests to the readme. 2012-04-08 19:01:58 +02:00
Rakefile Replaced rcov by simplecov 2012-04-08 14:29:39 +02:00
VERSION Not removing, escaping 2011-11-15 19:32:49 +04:00
musicbrainz.gemspec move bundler gem dependency to gemspec only 2012-06-21 10:07:34 +02:00

README.rdoc

= MusicBrainz Web Service wrapper {<img src="https://secure.travis-ci.org/magnolia-fan/musicbrainz.png"/>}[http://travis-ci.org/magnolia-fan/musicbrainz]

=== Installation

    gem install musicbrainz

=== Usage

    require 'musicbrainz'
    
    # Search for artists
    @suggestions = MusicBrainz::Artist.search('Jet')
    
    # Find artist by name or mbid
    @foo_fighters = MusicBrainz::Artist.find_by_name('Foo Fighters')
    @kasabian = MusicBrainz::Artist.find('69b39eab-6577-46a4-a9f5-817839092033')
    
    # Use them like ActiveRecord models
    @empire_tracks = @kasabian.release_groups[8].releases.first.tracks

    # Setting a cache path enables caching of requests
    MusicBrainz.cache_path = File.join(File.dirname(__FILE__), '../../tmp/test/musicbrainz')
    
=== Api

MusicBrainz::Artist
    
    @artists = MusicBrainz::Artist.search(query)
    @artist = MusicBrainz::Artist.find_by_name(name)
    @artist = MusicBrainz::Artist.find(mbid)
    @artist.id
    @artist.type
    @artist.name
    @artist.country
    @artist.date_begin
    @artist.date_end
    @artist.release_groups

MusicBrainz::ReleaseGroup

    @release_group = MusicBrainz::ReleaseGroup.find(mbid)
    @release_group.id
    @release_group.type
    @release_group.title
    @release_group.first_release_date
    @release_group.releases

MusicBrainz::Release

    @release = MusicBrainz::Release.find(mbid)
    @release.id
    @release.title
    @release.status
    @release.date
    @release.country
    @release.tracks

MusicBrainz::Track

    @track = MusicBrainz::Track.find(mbid)
    @track.position
    @track.recording_id
    @track.title
    @track.length


=== Contributing
 
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
* Fork the project
* Start a feature/bugfix branch
* Commit and push until you are happy with your contribution
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* to get a coverage report for your Test Unit and RSpec tests use the rake tasks: test_coverage, rspec_coverage
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

=== Copyright

Copyright (c) 2011 Gregory Eremin. See LICENSE.txt for further details.