hearken 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.rdoc +8 -0
- data/README.rdoc +17 -11
- data/bin/hearken +2 -2
- data/bin/hearken_index +12 -0
- data/hearken.gemspec +1 -3
- data/lib/hearken.rb +1 -1
- data/lib/hearken/command/love.rb +7 -0
- data/lib/hearken/command/profile.rb +7 -0
- data/lib/hearken/command/remove.rb +15 -0
- data/lib/hearken/console.rb +5 -2
- data/lib/hearken/player.rb +13 -0
- data/lib/hearken/scrobbler.rb +23 -25
- data/lib/hearken/simple_scrobbler.rb +94 -0
- metadata +77 -100
- data/lib/hearken/cli.rb +0 -22
- data/lib/hearken/command/flush.rb +0 -7
data/HISTORY.rdoc
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
= 0.1.0
|
2
|
+
|
3
|
+
* removed several dependencies - simple_scrobbler and thor
|
4
|
+
* split hearken command into two
|
5
|
+
* added 'love' command (to mark current track as loved)
|
6
|
+
* added 'profile' command (to launch last.fm profile to see track history)
|
7
|
+
* replaced 'flush' with an 'rm' command that can remove tracks matches criteria
|
8
|
+
|
1
9
|
= 0.0.5
|
2
10
|
|
3
11
|
* fixed 'recent' command - the library is sorted on file modification date
|
data/README.rdoc
CHANGED
@@ -24,17 +24,18 @@ Growl notification (as new tracks are played) will work but only if 'growlnotify
|
|
24
24
|
|
25
25
|
== Indexing tracks
|
26
26
|
|
27
|
-
|
27
|
+
hearken_index DIRECTORY
|
28
28
|
|
29
|
-
Will create a track index at ~/.hearken/music.
|
29
|
+
Will create a track index at ~/.hearken/music.
|
30
30
|
|
31
|
-
|
31
|
+
Note that this will take a long time first time you run it if you have a large collection of music. Subsequent
|
32
|
+
runs will only query tags for new or modified files so will be very fast.
|
32
33
|
|
33
34
|
The index can be regenerated while the console is running and reloaded using the 'reload' command.
|
34
35
|
|
35
36
|
== Console
|
36
37
|
|
37
|
-
hearken
|
38
|
+
hearken
|
38
39
|
|
39
40
|
This enters an interactive prompt where you can start/stop the player, search and enqueue tracks.
|
40
41
|
|
@@ -62,7 +63,7 @@ Results will be displayed and the ids will be added to the clipboard (for conven
|
|
62
63
|
|
63
64
|
Enqueues tracks with ids abc, abd, abe, abf, 123 and 456
|
64
65
|
|
65
|
-
|
66
|
+
play
|
66
67
|
|
67
68
|
Starts the player
|
68
69
|
|
@@ -74,23 +75,28 @@ Stops the player
|
|
74
75
|
|
75
76
|
Stops and restarts the player (which will kill the currently playing track)
|
76
77
|
|
78
|
+
love
|
79
|
+
|
80
|
+
Tells last.fm that you love the current track (this will do nothing if last.fm is not configured or the player is
|
81
|
+
stopped)
|
82
|
+
|
83
|
+
rm iver bon
|
84
|
+
|
85
|
+
Removes any enqueued track with 'bon' and 'iver' in the track, artist or album name
|
86
|
+
|
77
87
|
setup_scrobbling
|
78
88
|
|
79
89
|
Runs through a wizard to configure scrobbling to last.fm
|
80
90
|
|
81
|
-
|
91
|
+
scrobbling on
|
82
92
|
|
83
93
|
Turns scrobbling on (has no effect if scrobbling has not been configured)
|
84
94
|
|
85
|
-
|
95
|
+
scrobbling off
|
86
96
|
|
87
97
|
Turns scrobbling off
|
88
98
|
|
89
99
|
= Future plans for world domination
|
90
100
|
|
91
|
-
* add a '-' command to remove tracks from queue
|
92
|
-
* add a command to launch last.fm profile (for track history)
|
93
|
-
* put some content on wiki to explain usage (especially use of track ranges '+ eft-z')
|
94
|
-
* eliminate last.fm setup command once setup and add lastfm commands only when setup
|
95
101
|
* Get working on linux
|
96
102
|
* Get working on windows
|
data/bin/hearken
CHANGED
data/bin/hearken_index
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
$: << File.dirname(__FILE__)+'/../lib'
|
4
|
+
|
5
|
+
require 'hearken/indexing'
|
6
|
+
|
7
|
+
unless ARGV.size == 1
|
8
|
+
puts "usage: hearken_index path_to_directory_containing_music_collection"
|
9
|
+
exit
|
10
|
+
end
|
11
|
+
|
12
|
+
Hearken::Indexing::Indexer.new(ARGV.shift).execute
|
data/hearken.gemspec
CHANGED
@@ -24,12 +24,10 @@ EOF
|
|
24
24
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
25
25
|
s.require_paths = ["lib"]
|
26
26
|
|
27
|
-
s.add_dependency 'thor', '~>0'
|
28
27
|
s.add_dependency 'splat', '~>0'
|
29
28
|
s.add_dependency 'shell_shock', '~>0'
|
30
|
-
s.add_dependency 'simple_scrobbler', '~> 0'
|
31
29
|
s.add_dependency 'rainbow', '~> 1'
|
32
|
-
s.add_dependency '
|
30
|
+
s.add_dependency 'nokogiri', '~> 1'
|
33
31
|
|
34
32
|
s.add_development_dependency 'rake', '~>0'
|
35
33
|
s.add_development_dependency 'rspec', '~>2'
|
data/lib/hearken.rb
CHANGED
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'hearken/command'
|
2
|
+
|
3
|
+
class Hearken::Command::Remove
|
4
|
+
include Hearken::Command
|
5
|
+
usage '*<word>'
|
6
|
+
help 'removes all tracks that match the specified criteria - specifying no criteria will flush entire queue'
|
7
|
+
execute do |text|
|
8
|
+
@terms = text.split(/\W/)
|
9
|
+
ids = []
|
10
|
+
while track = @player.dequeue
|
11
|
+
ids << track.id unless @terms.all? {|term| track.search_string.include? term }
|
12
|
+
end
|
13
|
+
ids.each {|id| @player.enqueue id }
|
14
|
+
end
|
15
|
+
end
|
data/lib/hearken/console.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'shell_shock/context'
|
2
2
|
|
3
|
+
require 'hearken'
|
3
4
|
require 'hearken/player'
|
4
5
|
require 'hearken/preferences'
|
5
6
|
require 'hearken/command'
|
@@ -27,8 +28,10 @@ module Hearken
|
|
27
28
|
with :status, "'"
|
28
29
|
with :restart, 'next'
|
29
30
|
with :list, 'ls'
|
30
|
-
with :enqueue, '
|
31
|
-
|
31
|
+
with :enqueue, 'add'
|
32
|
+
with :remove, 'rm'
|
33
|
+
with :start, 'play'
|
34
|
+
with_all *%w{reload search stop scrobbling shuffle setup_scrobbling recent love profile}
|
32
35
|
end
|
33
36
|
end
|
34
37
|
end
|
data/lib/hearken/player.rb
CHANGED
@@ -34,6 +34,14 @@ module Hearken
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
def love
|
38
|
+
@scrobbler.love current
|
39
|
+
end
|
40
|
+
|
41
|
+
def profile
|
42
|
+
@scrobbler.profile
|
43
|
+
end
|
44
|
+
|
37
45
|
def current
|
38
46
|
in_base_dir do
|
39
47
|
(@pid and File.exist?('current_song')) ? YAML.load_file('current_song') : nil
|
@@ -65,6 +73,11 @@ module Hearken
|
|
65
73
|
|
66
74
|
def start
|
67
75
|
return if @pid
|
76
|
+
if @library.count == 0
|
77
|
+
puts 'Player can not be started with an empty library'
|
78
|
+
puts 'Please run "hearken_index" in another shell and then \'reload\''
|
79
|
+
return
|
80
|
+
end
|
68
81
|
@pid = fork do
|
69
82
|
player_pid = nil
|
70
83
|
Signal.trap('TERM') do
|
data/lib/hearken/scrobbler.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
require 'splat'
|
2
|
-
require 'simple_scrobbler'
|
2
|
+
require 'hearken/simple_scrobbler'
|
3
3
|
require 'hearken/debug'
|
4
4
|
|
5
|
+
# Modified version of simple_scrobbler gem from https://github.com/threedaymonk/simple_scrobbler
|
5
6
|
module Hearken
|
6
7
|
class Scrobbler
|
8
|
+
API_KEY = '21f8c75ad38637220b20a03ad61219a4'
|
9
|
+
SECRET = 'ab77019c84eef8bc16bcfd5ba8db0c5d'
|
7
10
|
include Debug
|
8
11
|
|
9
12
|
def initialize preferences
|
@@ -14,14 +17,15 @@ module Hearken
|
|
14
17
|
@scrobbler = nil
|
15
18
|
if @preferences['lastfm'] and tf
|
16
19
|
debug "Configuring scrobbler with #{@preferences['lastfm'].inspect}"
|
17
|
-
|
20
|
+
user, session = *%w{user session_key}.map{|k| @preferences['lastfm'][k]}
|
21
|
+
@scrobbler = SimpleScrobbler.new API_KEY, SECRET, user, session
|
18
22
|
end
|
19
23
|
end
|
20
24
|
|
21
25
|
def finished track
|
22
26
|
return unless @scrobbler
|
23
27
|
debug "Scrobbling to last fm: #{track}"
|
24
|
-
send_to_scrobbler :
|
28
|
+
send_to_scrobbler :scrobble, track
|
25
29
|
end
|
26
30
|
|
27
31
|
def started track
|
@@ -30,36 +34,29 @@ module Hearken
|
|
30
34
|
send_to_scrobbler :now_playing, track
|
31
35
|
end
|
32
36
|
|
37
|
+
def love track
|
38
|
+
return unless @scrobbler and track
|
39
|
+
debug "Sending love to last fm: #{track}"
|
40
|
+
send_to_scrobbler :love, track
|
41
|
+
end
|
42
|
+
|
43
|
+
def profile
|
44
|
+
return unless @scrobbler
|
45
|
+
@scrobbler.with_profile_url {|url| url.to_launcher }
|
46
|
+
end
|
47
|
+
|
33
48
|
def ask question
|
34
49
|
print question
|
35
50
|
$stdin.gets.chomp
|
36
51
|
end
|
37
52
|
|
38
53
|
def setup
|
39
|
-
puts <<-EOF
|
40
|
-
Because of the way lastfm authentication works, setting up lastfm involves two steps:
|
41
|
-
Firstly, you need to register that you are developing an application. This will give you an api key and an associated 'secret'
|
42
|
-
Secondly, you need to gives your application access your lastfm account. This will give a authenticated session.
|
43
|
-
|
44
|
-
Step 1. Logging in to your lastfm account and register an application
|
45
|
-
This will launch a browser. You need to log in and fill out the API registration form
|
46
|
-
EOF
|
47
|
-
answer = ask 'Are you ready ? '
|
48
|
-
return unless answer.downcase.start_with? 'y'
|
49
|
-
"http://www.last.fm/api/account".to_launcher
|
50
54
|
preferences = {}
|
51
|
-
preferences['api_key'] = ask 'What is your API key ? '
|
52
|
-
preferences['secret'] = ask 'What is your secret ? '
|
53
|
-
puts <<-EOF
|
54
|
-
Now you've got you application details, you need to create an authentication session between your application and your lastfm account
|
55
|
-
Step 2. Authorising your application to access your lastfm account
|
56
|
-
This will launch another browser. You just need to give your application permission to access your account
|
57
|
-
EOF
|
58
55
|
preferences['user'] = ask 'What is your lastfm user name ? '
|
59
|
-
@scrobbler = SimpleScrobbler.new
|
56
|
+
@scrobbler = SimpleScrobbler.new API_KEY, SECRET, preferences['user']
|
60
57
|
preferences['session_key'] = @scrobbler.fetch_session_key do |url|
|
61
58
|
url.to_launcher
|
62
|
-
ask '
|
59
|
+
ask 'Please hit enter when you\'ve allowed this application access to your account'
|
63
60
|
end
|
64
61
|
@preferences['lastfm'] = preferences
|
65
62
|
end
|
@@ -69,9 +66,10 @@ private
|
|
69
66
|
debug %w{artist title time album track}.map {|k| "#{k}=#{track.send(k)}"}.join(',')
|
70
67
|
@scrobbler.send message, track.artist,
|
71
68
|
track.title,
|
72
|
-
:
|
69
|
+
:duration => track.time,
|
73
70
|
:album => track.album,
|
74
|
-
:
|
71
|
+
:trackNumber => track.track.to_i,
|
72
|
+
:timestamp => Time.now.to_i
|
75
73
|
rescue Exception => e
|
76
74
|
puts "Failed to scrobble: #{e}"
|
77
75
|
end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require "net/http"
|
2
|
+
require "digest/md5"
|
3
|
+
require "uri"
|
4
|
+
require "cgi"
|
5
|
+
require 'nokogiri'
|
6
|
+
require 'hearken/debug'
|
7
|
+
|
8
|
+
module Hearken; end
|
9
|
+
|
10
|
+
class Hearken::SimpleScrobbler
|
11
|
+
include Hearken::Debug
|
12
|
+
|
13
|
+
SCROBBLER_URL = 'http://ws.audioscrobbler.com/2.0/'
|
14
|
+
|
15
|
+
SubmissionError = Class.new(RuntimeError)
|
16
|
+
SessionError = Class.new(RuntimeError)
|
17
|
+
|
18
|
+
def initialize api_key, secret, user, session_key=nil
|
19
|
+
@api_key = api_key
|
20
|
+
@secret = secret
|
21
|
+
@user = user
|
22
|
+
@session_key = session_key
|
23
|
+
end
|
24
|
+
|
25
|
+
attr_reader :user, :api_key, :secret, :session_key
|
26
|
+
|
27
|
+
def session_key
|
28
|
+
@session_key or raise SessionError, "The session key must be set or fetched"
|
29
|
+
end
|
30
|
+
|
31
|
+
def fetch_session_key
|
32
|
+
doc = lfm :get, 'auth.gettoken'
|
33
|
+
request_token = doc.at('token').inner_text
|
34
|
+
yield "http://www.last.fm/api/auth/?api_key=#{api_key}&token=#{request_token}"
|
35
|
+
doc = lfm :get, 'auth.getsession', :token => request_token
|
36
|
+
@session_key = doc.at('key').inner_text
|
37
|
+
@user = doc.at('name').inner_text
|
38
|
+
@session_key
|
39
|
+
end
|
40
|
+
|
41
|
+
def with_profile_url
|
42
|
+
yield "http://www.last.fm/user/#{user}" if user
|
43
|
+
end
|
44
|
+
|
45
|
+
# http://www.last.fm/api/show?service=443
|
46
|
+
def scrobble artist, title, params={}
|
47
|
+
lfm_track 'track.scrobble', artist, title, params
|
48
|
+
end
|
49
|
+
|
50
|
+
# See http://www.last.fm/api/show?service=454 for more details
|
51
|
+
def now_playing artist, title, params={}
|
52
|
+
lfm_track 'track.updateNowPlaying', artist, title, params
|
53
|
+
end
|
54
|
+
|
55
|
+
# http://www.last.fm/api/show?service=260
|
56
|
+
def love artist, title, params={}
|
57
|
+
lfm_track 'track.love', artist, title, params
|
58
|
+
end
|
59
|
+
private
|
60
|
+
def lfm_track method, artist, title, params
|
61
|
+
doc = lfm :post, method, params.merge(:sk => session_key, :artist => artist, :track => title)
|
62
|
+
status = doc.at('lfm')['status']
|
63
|
+
raise SubmissionError, status unless status == 'ok'
|
64
|
+
end
|
65
|
+
|
66
|
+
def lfm get_or_post, method, parameters={}
|
67
|
+
p = signed_parameters parameters.merge :api_key => api_key, :method => method
|
68
|
+
debug p.inspect
|
69
|
+
xml = self.send get_or_post, SCROBBLER_URL, p
|
70
|
+
debug xml
|
71
|
+
Nokogiri::XML xml
|
72
|
+
end
|
73
|
+
|
74
|
+
def get url, parameters
|
75
|
+
query_string = sort_parameters(parameters).
|
76
|
+
map{ |k, v| "#{k}=#{CGI.escape(v)}" }.
|
77
|
+
join("&")
|
78
|
+
Net::HTTP.get_response(URI.parse(url + "?" + query_string)).body
|
79
|
+
end
|
80
|
+
|
81
|
+
def post url, parameters
|
82
|
+
Net::HTTP.post_form(URI.parse(url), parameters).body
|
83
|
+
end
|
84
|
+
|
85
|
+
def signed_parameters parameters
|
86
|
+
sorted = sort_parameters parameters
|
87
|
+
signature = Digest::MD5.hexdigest(sorted.flatten.join + secret)
|
88
|
+
parameters.merge :api_sig => signature
|
89
|
+
end
|
90
|
+
|
91
|
+
def sort_parameters parameters
|
92
|
+
parameters.map{ |k, v| [k.to_s, v.to_s] }.sort
|
93
|
+
end
|
94
|
+
end
|
metadata
CHANGED
@@ -1,122 +1,100 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: hearken
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
4
5
|
prerelease:
|
5
|
-
version: 0.0.6
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Mark Ryall
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
17
|
-
name: thor
|
18
|
-
prerelease: false
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
20
|
-
none: false
|
21
|
-
requirements:
|
22
|
-
- - ~>
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: "0"
|
25
|
-
type: :runtime
|
26
|
-
version_requirements: *id001
|
27
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-09-10 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
28
15
|
name: splat
|
29
|
-
|
30
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70202662970320 !ruby/object:Gem::Requirement
|
31
17
|
none: false
|
32
|
-
requirements:
|
18
|
+
requirements:
|
33
19
|
- - ~>
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version:
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
36
22
|
type: :runtime
|
37
|
-
version_requirements: *id002
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: shell_shock
|
40
23
|
prerelease: false
|
41
|
-
|
24
|
+
version_requirements: *70202662970320
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: shell_shock
|
27
|
+
requirement: &70202662969820 !ruby/object:Gem::Requirement
|
42
28
|
none: false
|
43
|
-
requirements:
|
29
|
+
requirements:
|
44
30
|
- - ~>
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version:
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
47
33
|
type: :runtime
|
48
|
-
version_requirements: *id003
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: simple_scrobbler
|
51
34
|
prerelease: false
|
52
|
-
|
53
|
-
|
54
|
-
requirements:
|
55
|
-
- - ~>
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version: "0"
|
58
|
-
type: :runtime
|
59
|
-
version_requirements: *id004
|
60
|
-
- !ruby/object:Gem::Dependency
|
35
|
+
version_requirements: *70202662969820
|
36
|
+
- !ruby/object:Gem::Dependency
|
61
37
|
name: rainbow
|
62
|
-
|
63
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
38
|
+
requirement: &70202662969360 !ruby/object:Gem::Requirement
|
64
39
|
none: false
|
65
|
-
requirements:
|
40
|
+
requirements:
|
66
41
|
- - ~>
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version:
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '1'
|
69
44
|
type: :runtime
|
70
|
-
version_requirements: *id005
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: ruby-growl
|
73
45
|
prerelease: false
|
74
|
-
|
46
|
+
version_requirements: *70202662969360
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: nokogiri
|
49
|
+
requirement: &70202662968900 !ruby/object:Gem::Requirement
|
75
50
|
none: false
|
76
|
-
requirements:
|
51
|
+
requirements:
|
77
52
|
- - ~>
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version:
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1'
|
80
55
|
type: :runtime
|
81
|
-
version_requirements: *id006
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
name: rake
|
84
56
|
prerelease: false
|
85
|
-
|
57
|
+
version_requirements: *70202662968900
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: rake
|
60
|
+
requirement: &70202662968440 !ruby/object:Gem::Requirement
|
86
61
|
none: false
|
87
|
-
requirements:
|
62
|
+
requirements:
|
88
63
|
- - ~>
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version:
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
91
66
|
type: :development
|
92
|
-
version_requirements: *id007
|
93
|
-
- !ruby/object:Gem::Dependency
|
94
|
-
name: rspec
|
95
67
|
prerelease: false
|
96
|
-
|
68
|
+
version_requirements: *70202662968440
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: &70202662967980 !ruby/object:Gem::Requirement
|
97
72
|
none: false
|
98
|
-
requirements:
|
73
|
+
requirements:
|
99
74
|
- - ~>
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version:
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '2'
|
102
77
|
type: :development
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70202662967980
|
80
|
+
description: ! 'A command line tool to enqueue and play music tracks.
|
81
|
+
|
82
|
+
|
107
83
|
This also extracts the tags from a collection of folders.
|
108
|
-
|
109
|
-
This replaces and combines the functionality from a couple of other gems (audio_library and songbirdsh).
|
110
84
|
|
111
|
-
|
85
|
+
|
86
|
+
This replaces and combines the functionality from a couple of other gems (audio_library
|
87
|
+
and songbirdsh).
|
88
|
+
|
89
|
+
'
|
90
|
+
email:
|
112
91
|
- mark@ryall.name
|
113
|
-
executables:
|
92
|
+
executables:
|
114
93
|
- hearken
|
94
|
+
- hearken_index
|
115
95
|
extensions: []
|
116
|
-
|
117
96
|
extra_rdoc_files: []
|
118
|
-
|
119
|
-
files:
|
97
|
+
files:
|
120
98
|
- .gitignore
|
121
99
|
- .rvmrc
|
122
100
|
- Gemfile
|
@@ -125,16 +103,18 @@ files:
|
|
125
103
|
- README.rdoc
|
126
104
|
- Rakefile
|
127
105
|
- bin/hearken
|
106
|
+
- bin/hearken_index
|
128
107
|
- hearken.gemspec
|
129
108
|
- lib/hearken.rb
|
130
|
-
- lib/hearken/cli.rb
|
131
109
|
- lib/hearken/colour.rb
|
132
110
|
- lib/hearken/command.rb
|
133
111
|
- lib/hearken/command/enqueue.rb
|
134
|
-
- lib/hearken/command/flush.rb
|
135
112
|
- lib/hearken/command/list.rb
|
113
|
+
- lib/hearken/command/love.rb
|
114
|
+
- lib/hearken/command/profile.rb
|
136
115
|
- lib/hearken/command/recent.rb
|
137
116
|
- lib/hearken/command/reload.rb
|
117
|
+
- lib/hearken/command/remove.rb
|
138
118
|
- lib/hearken/command/restart.rb
|
139
119
|
- lib/hearken/command/scrobbling.rb
|
140
120
|
- lib/hearken/command/search.rb
|
@@ -163,6 +143,7 @@ files:
|
|
163
143
|
- lib/hearken/queue.rb
|
164
144
|
- lib/hearken/range_expander.rb
|
165
145
|
- lib/hearken/scrobbler.rb
|
146
|
+
- lib/hearken/simple_scrobbler.rb
|
166
147
|
- lib/hearken/tagged.rb
|
167
148
|
- lib/hearken/track.rb
|
168
149
|
- media/applause.mp3
|
@@ -174,35 +155,31 @@ files:
|
|
174
155
|
- spec/hearken/player_spec.rb
|
175
156
|
- spec/hearken/range_expander_spec.rb
|
176
157
|
- spec/spec_helper.rb
|
177
|
-
has_rdoc: true
|
178
158
|
homepage: http://github.com/markryall/hearken
|
179
159
|
licenses: []
|
180
|
-
|
181
160
|
post_install_message:
|
182
161
|
rdoc_options: []
|
183
|
-
|
184
|
-
require_paths:
|
162
|
+
require_paths:
|
185
163
|
- lib
|
186
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
164
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
187
165
|
none: false
|
188
|
-
requirements:
|
189
|
-
- -
|
190
|
-
- !ruby/object:Gem::Version
|
191
|
-
version:
|
192
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
166
|
+
requirements:
|
167
|
+
- - ! '>='
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
170
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
171
|
none: false
|
194
|
-
requirements:
|
195
|
-
- -
|
196
|
-
- !ruby/object:Gem::Version
|
197
|
-
version:
|
172
|
+
requirements:
|
173
|
+
- - ! '>='
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
version: '0'
|
198
176
|
requirements: []
|
199
|
-
|
200
177
|
rubyforge_project: hearken
|
201
|
-
rubygems_version: 1.6
|
178
|
+
rubygems_version: 1.8.6
|
202
179
|
signing_key:
|
203
180
|
specification_version: 3
|
204
181
|
summary: command line music player
|
205
|
-
test_files:
|
182
|
+
test_files:
|
206
183
|
- spec/hearken/command/enqueue_spec.rb
|
207
184
|
- spec/hearken/command/list_spec.rb
|
208
185
|
- spec/hearken/command/reload_spec.rb
|
data/lib/hearken/cli.rb
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
require 'thor'
|
2
|
-
|
3
|
-
require 'hearken'
|
4
|
-
require 'hearken/indexing'
|
5
|
-
require 'hearken/console'
|
6
|
-
|
7
|
-
class Hearken::Cli < Thor
|
8
|
-
desc 'version', 'Prints the current version'
|
9
|
-
def version
|
10
|
-
puts "Current version is "+Hearken::VERSION
|
11
|
-
end
|
12
|
-
|
13
|
-
desc 'index DIRECTORY', 'Reindexes a music collection'
|
14
|
-
def index directory
|
15
|
-
Hearken::Indexing::Indexer.new(directory).execute
|
16
|
-
end
|
17
|
-
|
18
|
-
desc 'console', 'Enters console for queuing and playing tracks'
|
19
|
-
def console
|
20
|
-
Hearken::Console.new.push
|
21
|
-
end
|
22
|
-
end
|