Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added yardoc rake task

  • Loading branch information...
commit 28612ff63e96e9c2a2fc713f775626a377386e4e 1 parent 4d64a28
@xhochy xhochy authored
View
1  .gitignore
@@ -9,3 +9,4 @@ coverage
spec.html
scrobbler.gemspec
catalog.xml
+.yardoc
View
5 .loadpath
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<loadpath>
+ <pathentry path="" type="src"/>
+ <pathentry path="org.rubypeople.rdt.launching.RUBY_CONTAINER" type="con"/>
+</loadpath>
View
17 .project
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>scrobbler</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.rubypeople.rdt.core.rubybuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.rubypeople.rdt.core.rubynature</nature>
+ </natures>
+</projectDescription>
View
94 README.rdoc
@@ -9,86 +9,86 @@ all functions is available at http://rdoc.info/projects/xhochy/scrobbler
== Initialization
- Scrobbler::Base.api_key = 'foo123'
+ Scrobbler::Base.api_key = 'foo123'
== Users
- user = Scrobbler::User.new('jnunemaker')
+ user = Scrobbler::User.new('jnunemaker')
- puts "#{user.username}'s Recent Tracks"
- puts "=" * (user.username.length + 16)
- user.recent_tracks.each { |t| puts t.name }
+ puts "#{user.username}'s Recent Tracks"
+ puts "=" * (user.username.length + 16)
+ user.recent_tracks.each { |t| puts t.name }
- puts
- puts
+ puts
+ puts
- puts "#{user.username}'s Top Tracks"
- puts "=" * (user.username.length + 13)
- user.top_tracks.each { |t| puts "(#{t.playcount}) #{t.name}" }
+ puts "#{user.username}'s Top Tracks"
+ puts "=" * (user.username.length + 13)
+ user.top_tracks.each { |t| puts "(#{t.playcount}) #{t.name}" }
== Albums
- album = Scrobbler::Album.new('Some Hearts', :artist => 'Carrie Underwood', :include_info => true)
+ album = Scrobbler::Album.new('Some Hearts', :artist => 'Carrie Underwood', :include_info => true)
- puts "Album: #{album.name}"
- puts "Artist: #{album.artist}"
- puts "Playcount: #{album.playcount}"
- puts "URL: #{album.url}"
- puts "Release Date: #{album.release_date.strftime('%m/%d/%Y')}"
+ puts "Album: #{album.name}"
+ puts "Artist: #{album.artist}"
+ puts "Playcount: #{album.playcount}"
+ puts "URL: #{album.url}"
+ puts "Release Date: #{album.release_date.strftime('%m/%d/%Y')}"
==Artists
- artist = Scrobbler::Artist.new('Carrie Underwood')
+ artist = Scrobbler::Artist.new('Carrie Underwood')
+
+ puts 'Top Tracks'
+ puts "=" * 10
+ artist.top_tracks.each { |t| puts "(#{t.playcount}) #{t.name}" }
- puts 'Top Tracks'
- puts "=" * 10
- artist.top_tracks.each { |t| puts "(#{t.playcount}) #{t.name}" }
+ puts
- puts
-
- puts 'Similar Artists'
- puts "=" * 15
- artist.similar.each { |a| puts "(#{a.match}%) #{a.name}" }
+ puts 'Similar Artists'
+ puts "=" * 15
+ artist.similar.each { |a| puts "(#{a.match}%) #{a.name}" }
==Geo
- geo = Scrobbler::Geo.new()
+ geo = Scrobbler::Geo.new()
- puts 'Events'
- puts "=" * 10
- geo.events(:location => 'Manchester').each { |e| puts "(#{e.id}) #{e.title}" }
+ puts 'Events'
+ puts "=" * 10
+ geo.events(:location => 'Manchester').each { |e| puts "(#{e.id}) #{e.title}" }
- puts
+ puts
- puts 'Top Artists'
- puts "=" * 10
- geo.top_artists(:location => 'Manchester').each { |a| puts "(#{a.name}) #{a.playcount}" }
+ puts 'Top Artists'
+ puts "=" * 10
+ geo.top_artists(:location => 'Manchester').each { |a| puts "(#{a.name}) #{a.playcount}" }
- puts
+ puts
- puts 'Top Tracks'
- puts "=" * 10
- geo.top_tracks(:location => 'Manchester').each { |t| puts "(#{a.name}) #{a.playcount}" }
+ puts 'Top Tracks'
+ puts "=" * 10
+ geo.top_tracks(:location => 'Manchester').each { |t| puts "(#{a.name}) #{a.playcount}" }
==Tags
- tag = Scrobbler::Tag.new('country')
+ tag = Scrobbler::Tag.new('country')
- puts 'Top Albums'
- tag.top_albums.each { |a| puts "(#{a.count}) #{a.name} by #{a.artist}" }
+ puts 'Top Albums'
+ tag.top_albums.each { |a| puts "(#{a.count}) #{a.name} by #{a.artist}" }
- puts
+ puts
- puts 'Top Tracks'
- tag.top_tracks.each { |t| puts "(#{t.count}) #{t.name} by #{t.artist}" }
+ puts 'Top Tracks'
+ tag.top_tracks.each { |t| puts "(#{t.count}) #{t.name} by #{t.artist}" }
==Tracks
- track = Scrobbler::Track.new('Carrie Underwood', 'Before He Cheats')
- puts 'Fans'
- puts "=" * 4
- track.top_fans.each { |u| puts "(#{u.weight}) #{u.username}" }
+ track = Scrobbler::Track.new('Carrie Underwood', 'Before He Cheats')
+ puts 'Fans'
+ puts "=" * 4
+ track.top_fans.each { |u| puts "(#{u.weight}) #{u.username}" }
== Simple Authentication (for Scrobbling)
View
8 tasks/yardoc.rake
@@ -0,0 +1,8 @@
+begin
+ require 'yard'
+ YARD::Rake::YardocTask.new do |t|
+ t.files = ['lib/**/*.rb'] # optional
+ end
+rescue LoadError
+ puts "YARD not available. Install it with: sudo gem install yard"
+end
Please sign in to comment.
Something went wrong with that request. Please try again.