rdio-cli 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,12 @@ module Rdio
6
6
  end
7
7
 
8
8
  def tell_rdio(cmd)
9
- apple_script "tell app \"Rdio\" to #{cmd}"
9
+ apple_script "tell app \"#{app_name}\" to #{cmd}"
10
+ end
11
+
12
+ def app_name
13
+ running_apps = apple_script 'tell application "System Events" to get the name of every process whose background only is false'
14
+ running_apps.split(', ').grep(/Rdio/)[0].to_s.strip || 'Rdio'
10
15
  end
11
16
 
12
17
  def quit
@@ -1,3 +1,3 @@
1
1
  module Rdio
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdio-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-18 00:00:00.000000000 Z
12
+ date: 2013-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: highline
@@ -188,3 +188,4 @@ signing_key:
188
188
  specification_version: 3
189
189
  summary: CLI for Rdio for Mac
190
190
  test_files: []
191
+ has_rdoc: false