Permalink
Browse files

skips_pre comes before desc

  • Loading branch information...
1 parent 79198cb commit d470acde5828951199c913a9f92baa0afdeb4c6f @pengwynn committed Dec 30, 2012
Showing with 15 additions and 13 deletions.
  1. +13 −12 lib/rdio.rb
  2. +1 −1 spec/rdio/desktop_bridge_spec.rb
  3. +1 −0 spec/rdio_spec.rb
View
25 lib/rdio.rb
@@ -72,70 +72,71 @@ def self.add_to_collection(tracks)
flag :access_token
flag :access_secret
+ skips_pre
desc 'Plays the current track'
command :play do |c|
c.action do |global_options,options,args|
bridge.play
end
end
- desc 'Pause the player'
skips_pre
+ desc 'Pause the player'
command :pause do |c|
c.action do |global_options,options,args|
bridge.pause
end
end
- desc 'Toggle playback'
skips_pre
+ desc 'Toggle playback'
command :toggle do |c|
c.action do |global_options,options,args|
bridge.toggle
end
end
+ skips_pre
desc 'Display the current track info'
long_desc %(
Display current track, artist, and album info. Pass
format string for custom output using
%{track}, %{artist}, and %{album} placeholders.
)
arg_name 'format'
- skips_pre
command :current do |c|
c.action do |global_options,options,args|
say bridge.now_playing(args.first)
end
end
- desc 'Skip to next track'
skips_pre
+ desc 'Skip to next track'
command :next do |c|
c.action do |global_options,options,args|
bridge.next_track
end
end
- desc 'Play previous track'
skips_pre
+ desc 'Play previous track'
command :previous, :prev do |c|
c.action do |global_options,options,args|
bridge.previous_track
end
end
- desc 'Open the current track in Rdio player'
skips_pre
+ desc 'Open the current track in Rdio player'
command :browse do |c|
c.action do |global_options,options,args|
protocol = args.first == 'app' ? 'rdio' : 'http'
exec "open '#{rdio_url protocol}'"
end
end
- desc 'Set volume for player'
skips_pre
+ desc 'Set volume for player'
arg_name 'level'
command :volume, :vol do |c|
c.action do |global_options,options,args|
@@ -144,40 +145,40 @@ def self.add_to_collection(tracks)
end
end
- desc 'Mute the Rdio player'
skips_pre
+ desc 'Mute the Rdio player'
command :mute do |c|
c.action do |global_options,options,args|
brdige.set_volume 0
end
end
- desc 'Get a shareable link for the current track'
skips_pre
+ desc 'Get a shareable link for the current track'
command :link do |c|
c.action do |global_options,options,args|
say bridge.current_url
end
end
- desc "Get CLI and application version info"
skips_pre
+ desc "Get CLI and application version info"
command :version, :v do |c|
c.action do |global_options,options,args|
say "rdio-cli #{Rdio::VERSION} / Rdio #{apple_script('get version of application "Rdio"')}"
end
end
- desc "Quit Rdio"
skips_pre
+ desc "Quit Rdio"
command :quit, :q do |c|
c.action do |global_options,options,args|
bridge.quit
end
end
- desc "Authorize Rdio account"
skips_pre
+ desc "Authorize Rdio account"
command :authorize, :auth do |c|
c.action do |global_options,options,args|
require 'highline/import'
View
2 spec/rdio/desktop_bridge_spec.rb
@@ -1,6 +1,6 @@
require 'spec_helper'
-describe 'Rdio::DesktopBridge' do
+describe Rdio::DesktopBridge do
before do
@bridge = Rdio::DesktopBridge.new
View
1 spec/rdio_spec.rb
@@ -116,6 +116,7 @@
Rdio.run %w(q)
end
+
context "when authenticated" do
it "snags the currently playing track to your collection" do

0 comments on commit d470acd

Please sign in to comment.