From 533d80653e9286a5d023539a2d1c10d962258da4 Mon Sep 17 00:00:00 2001 From: Miguel Guinada Date: Mon, 8 Oct 2012 23:10:37 +0100 Subject: [PATCH] Documentation review * Corrected documentation for Channels#genre_channels * Added a changelog --- .yardopts | 2 +- CHANGELOG.md | 14 ++++++++++++++ README.md | 3 ++- Rakefile | 2 +- lib/shuffler_fm/api/channels.rb | 27 ++++++++++++++++----------- lib/shuffler_fm/api/tracks.rb | 2 +- shuffler_fm.gemspec | 3 ++- 7 files changed, 37 insertions(+), 16 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.yardopts b/.yardopts index d9cf623..c919bb8 100644 --- a/.yardopts +++ b/.yardopts @@ -1,2 +1,2 @@ ---no-private --protected --markup markdown lib/**/*.rb - README.md LICENSE +--no-private --protected --markup-provider redcarpet --markup markdown lib/**/*.rb - README.md LICENSE diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..602737d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +0.1.0 +----- + +Added track streaming URI acquisition (Tracks#stream) + +0.0.2 +----- + +Added the per_page parameter & corrected pagination threshold + +0.0.1 +----- + +1st release \ No newline at end of file diff --git a/README.md b/README.md index 6f2a710..46f9ee4 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ track.metadata.artist.name ### Search for an artist ```ruby + api.search_artists('radiohead').map(&:name) => ["Radiohead", "Radiohead at Lollapalooza 2008", "REM & Radiohead", "Radiohead 6. Permanent Daylight live", "Radiohead @ Optimus Alive'12", "I Can't Take The Hurt (Johnny Cash vs Tegan and Sarah and Radiohead)"] ``` @@ -67,7 +68,7 @@ api.search_artists('radiohead').map(&:name) ```ruby activity = [] -api.genre_channels('punk', 'rock').each do |act| +api.genre_channels('punk', 'rock', page: 1, per_page: 10).each do |act| activity << "#{act.verb.capitalize} on #{act.actor.title} refering music track #{act.object.metadata.title}" end diff --git a/Rakefile b/Rakefile index f4d1645..33fa166 100644 --- a/Rakefile +++ b/Rakefile @@ -23,7 +23,7 @@ namespace :doc do desc "Generate documentation" YARD::Rake::YardocTask.new do |t| t.files = ['lib/**/*.rb'] - t.options = ['--no-private', '--protected', '--markup', 'markdown'] + t.options = ['--no-private', '--protected', '--markup-provider', 'redcarpet', '--markup', 'markdown'] end end diff --git a/lib/shuffler_fm/api/channels.rb b/lib/shuffler_fm/api/channels.rb index 3948fc4..2e2a98c 100644 --- a/lib/shuffler_fm/api/channels.rb +++ b/lib/shuffler_fm/api/channels.rb @@ -13,7 +13,7 @@ module Channels # @return [Array] an array with the channel's activity stream # # @example - # api.media_channels('youtube', page: 2) + # api.media_channels('soundcloud') # def media_channels(key, options = {}) channel(:media, key, options) @@ -21,7 +21,7 @@ def media_channels(key, options = {}) # Reads the blog channels activity stream # - # @param [String] key The channel key. + # @param [Integer] key The blog id # @param [Hash] options # @option options [Integer] :page The page to request on paginated operation responses. First page is page 1. # @option options [Integer] :per_page The page size. Default is 50, maximum is 100. @@ -37,7 +37,6 @@ def blog_channels(key, options = {}) # Reads the artist channels activity stream # - # @param key The channel key. # @param [Hash] options # @option options [Integer] :page The page to request on paginated operation responses. First page is page 1. # @option options [Integer] :per_page The page size. Default is 50, maximum is 100. @@ -53,16 +52,22 @@ def artist_channels(key, options = {}) # Reads the genere channels activity stream. # - # @param [Array] keys The channel keys. - # @param [Hash] options - # @option options [Integer] :page The page to request on paginated operation responses. First page is page 1. - # @option options [Integer] :per_page The page size. Default is 50, maximum is 100. + # @overload genre_channels(*keys) + # @param [Array] keys The channel keys. # - # @return [Array] an array with the channel's activity stream + # @example + # api.genre_channels('punk') + # api.genre_channels('punk', 'rock') # - # @example - # api.genre_channels('rock') - # api.genre_channels('punk', 'rock', page: 2) + # @overload genre_channels(*keys, options) + # @param [Hash] options + # @option options [Integer] :page The page to request on paginated operation responses. First page is page 1. + # @option options [Integer] :per_page The page size. Default is 50, maximum is 100. + # + # @example + # api.genre_channels('punk', 'rock', page: 1, per_page: 10) + # + # @return [Array] an array with the channel's activity stream # def genre_channels(*keys) channel(:genre, *keys) diff --git a/lib/shuffler_fm/api/tracks.rb b/lib/shuffler_fm/api/tracks.rb index eee2378..75f2988 100644 --- a/lib/shuffler_fm/api/tracks.rb +++ b/lib/shuffler_fm/api/tracks.rb @@ -32,7 +32,7 @@ def track(id) # Streaming URI for a track. # - # NOTE: This operation required a specific authorization form shuffler.fm + # NOTE: This operation requires a specific authorization form shuffler.fm # # @param [Integer] id The track id # diff --git a/shuffler_fm.gemspec b/shuffler_fm.gemspec index 318bd6b..47f6707 100644 --- a/shuffler_fm.gemspec +++ b/shuffler_fm.gemspec @@ -33,5 +33,6 @@ Gem::Specification.new do |gem| gem.add_development_dependency 'vcr' gem.add_development_dependency 'simplecov' gem.add_development_dependency 'yard' - gem.add_development_dependency 'maruku' + gem.add_development_dependency 'redcarpet' + gem.add_development_dependency 'github-markup' end \ No newline at end of file