quiyo 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/Gemfile +17 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +18 -0
- data/Rakefile +54 -0
- data/VERSION +1 -0
- data/bin/quiyo +29 -0
- data/lib/quiyo/colors.rb +9 -0
- data/lib/quiyo/core.rb +59 -0
- data/lib/quiyo/database.rb +40 -0
- data/lib/quiyo/playback.rb +14 -0
- data/lib/quiyo/playlist.rb +28 -0
- data/lib/quiyo/server.rb +45 -0
- data/lib/quiyo/status.rb +77 -0
- data/lib/quiyo.rb +42 -0
- data/quiyo.gemspec +75 -0
- data/test/helper.rb +18 -0
- data/test/test_quiyo.rb +7 -0
- metadata +164 -0
data/.document
ADDED
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
# Add dependencies required to use your gem here.
|
3
|
+
# Example:
|
4
|
+
# gem "activesupport", ">= 2.3.5"
|
5
|
+
gem "dm-core"
|
6
|
+
gem "dm-migrations"
|
7
|
+
gem "dm-sqlite-adapter"
|
8
|
+
gem "librmpd"
|
9
|
+
|
10
|
+
# Add dependencies to develop your gem here.
|
11
|
+
# Include everything needed to run rake, tests, features, etc.
|
12
|
+
group :development do
|
13
|
+
# gem "shoulda", ">= 0"
|
14
|
+
gem "bundler", "~> 1.0.0"
|
15
|
+
gem "jeweler", "~> 1.6.4"
|
16
|
+
# gem "rcov", ">= 0"
|
17
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Christian Brassat
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
= quiyo
|
2
|
+
|
3
|
+
Readline client for MPD
|
4
|
+
|
5
|
+
== Contributing to quiyo
|
6
|
+
|
7
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
8
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
9
|
+
* Fork the project
|
10
|
+
* Start a feature/bugfix branch
|
11
|
+
* Commit and push until you are happy with your contribution
|
12
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
13
|
+
|
14
|
+
== Copyright
|
15
|
+
|
16
|
+
Copyright (c) 2011 Christian Brassat. See LICENSE.txt for
|
17
|
+
further details.
|
18
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "quiyo"
|
18
|
+
gem.homepage = "http://github.com/crshd/quiyo"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{Readline client for MPD}
|
21
|
+
gem.description = %Q{Inspired by pimpd2}
|
22
|
+
gem.email = "crshd@mail.com"
|
23
|
+
gem.authors = ["crshd"]
|
24
|
+
gem.files.exclude 'test'
|
25
|
+
# dependencies defined in Gemfile
|
26
|
+
end
|
27
|
+
Jeweler::RubygemsDotOrgTasks.new
|
28
|
+
|
29
|
+
# require 'rake/testtask'
|
30
|
+
# Rake::TestTask.new(:test) do |test|
|
31
|
+
# test.libs << 'lib' << 'test'
|
32
|
+
# test.pattern = 'test/**/test_*.rb'
|
33
|
+
# test.verbose = true
|
34
|
+
# end
|
35
|
+
#
|
36
|
+
# require 'rcov/rcovtask'
|
37
|
+
# Rcov::RcovTask.new do |test|
|
38
|
+
# test.libs << 'test'
|
39
|
+
# test.pattern = 'test/**/test_*.rb'
|
40
|
+
# test.verbose = true
|
41
|
+
# test.rcov_opts << '--exclude "gems/*"'
|
42
|
+
# end
|
43
|
+
#
|
44
|
+
# task :default => :test
|
45
|
+
|
46
|
+
require 'rdoc/task'
|
47
|
+
Rake::RDocTask.new do |rdoc|
|
48
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
49
|
+
|
50
|
+
rdoc.rdoc_dir = 'rdoc'
|
51
|
+
rdoc.title = "quiyo #{version}"
|
52
|
+
rdoc.rdoc_files.include('README*')
|
53
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
54
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/bin/quiyo
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Tested on 1.9.2p180=<
|
3
|
+
|
4
|
+
print " __
|
5
|
+
__ __ __/\\_\\ __ __ ___
|
6
|
+
/'__`\\/\\ \\/\\ \\/\\ \\/\\ \\/\\ \\ / __`\\
|
7
|
+
/\\ \\L\\ \\ \\ \\_\\ \\ \\ \\ \\ \\_\\ \\/\\ \\L\\ \\
|
8
|
+
\\ \\___, \\ \\____/\\ \\_\\/`____ \\ \\____/
|
9
|
+
\\/___/\\ \\/___/ \\/_/`/___/> \\/___/
|
10
|
+
\\ \\_\\ /\\___/
|
11
|
+
\\/_/ \\/__/ is starting. Have patience, fool!
|
12
|
+
"
|
13
|
+
|
14
|
+
unless File.exists?("#{ENV["HOME"]}/.config/quiyo")
|
15
|
+
p "Generating configuration"
|
16
|
+
Dir.mkdir("#{ENV["HOME"]}/.config/quiyo")
|
17
|
+
File.open("#{ENV["HOME"]}/.config/quiyo/config.yml", "w") { |f| f.write("
|
18
|
+
server: localhost
|
19
|
+
port: 6600
|
20
|
+
mpd_user: #{ENV["USER"]}
|
21
|
+
|
22
|
+
music_path: #{ENV["HOME"]}/Music
|
23
|
+
database: #{ENV["HOME"]}/.config/quiyo/database.db") }
|
24
|
+
p "Sample configuration can be found at #{ENV["HOME"]}/.config/quiyo"
|
25
|
+
p "Edit the configuration, and re-run Quiyo"
|
26
|
+
abort
|
27
|
+
end
|
28
|
+
|
29
|
+
require "quiyo"
|
data/lib/quiyo/colors.rb
ADDED
data/lib/quiyo/core.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
module Core
|
2
|
+
def showprompt
|
3
|
+
Readline.completion_append_character = " "
|
4
|
+
Readline.completion_proc = Proc.new { |str|
|
5
|
+
Dir[PATH+str+'*'].grep( /^#{Regexp.escape(str)}/ )
|
6
|
+
}
|
7
|
+
|
8
|
+
def readline_hist
|
9
|
+
line = Readline.readline(prompt, true)
|
10
|
+
return nil if line.nil?
|
11
|
+
if line =~ /^\s*$/ or Readline::HISTORY.to_a[-2] == line
|
12
|
+
Readline::HISTORY.pop
|
13
|
+
end
|
14
|
+
line
|
15
|
+
end
|
16
|
+
|
17
|
+
while line = readline_hist
|
18
|
+
@mpd.connect unless @mpd.connected?
|
19
|
+
action = line.split
|
20
|
+
case action[0]
|
21
|
+
when "np", "now-playing"; nowplaying
|
22
|
+
when "info", "stats"; info
|
23
|
+
|
24
|
+
when "pl", "play"; play(action[1])
|
25
|
+
when "pa", "pause"; pause
|
26
|
+
when "st", "stop"; stop
|
27
|
+
when "nx", "next"; playnext
|
28
|
+
when "prev", "previous"; playprevious
|
29
|
+
|
30
|
+
when "lspl", "lsplaylist"; lsplist
|
31
|
+
when "clear", "clearplaylist"; clearplist
|
32
|
+
when "add", "addtoplaylist"; addtoplist(action)
|
33
|
+
|
34
|
+
when "search"; search(action)
|
35
|
+
when "lsartists", "list-artists"; list("artists")
|
36
|
+
when "lsalbums", "list-albums"; list("albums", action)
|
37
|
+
|
38
|
+
when "love"; love
|
39
|
+
when "loved", "loves"; loved
|
40
|
+
|
41
|
+
when "vol", "volume"; vol(action[1])
|
42
|
+
|
43
|
+
when "quit", "exit"; quit
|
44
|
+
|
45
|
+
when "v", "verbose"; eval(action.drop(1).join(" "))
|
46
|
+
|
47
|
+
else; help
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def help
|
53
|
+
p "Some help text here"
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
class Quiyo
|
58
|
+
include Core
|
59
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Database
|
2
|
+
DataMapper.setup(:default, "sqlite3://" + CONF["database"])
|
3
|
+
|
4
|
+
class Love # {{{
|
5
|
+
include DataMapper::Resource
|
6
|
+
|
7
|
+
property :id, Serial
|
8
|
+
property :song, String
|
9
|
+
property :loved_at, Time
|
10
|
+
end # }}}
|
11
|
+
|
12
|
+
def love
|
13
|
+
@love = Love.create(
|
14
|
+
:song => @mpd.current_song["file"],
|
15
|
+
:loved_at => Time.now
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
def loved
|
20
|
+
Love.each { |s|
|
21
|
+
song = @mpd.songs(s.song).first
|
22
|
+
printf "[%s] %s : %s [%s]\n" % [
|
23
|
+
s.id,
|
24
|
+
colorize(song["artist"], 99),
|
25
|
+
colorize(song["title"], 202),
|
26
|
+
colorize(song["album"], 107)
|
27
|
+
]
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
if(!File.exists?(CONF["database"]))
|
32
|
+
DataMapper.auto_migrate!
|
33
|
+
else
|
34
|
+
DataMapper.auto_upgrade!
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class Quiyo
|
39
|
+
include Database
|
40
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module Playback
|
2
|
+
def play(arg = nil); @mpd.play(arg); nowplaying; end
|
3
|
+
def playnext; @mpd.next; nowplaying; end
|
4
|
+
def playprevious; @mpd.previous; nowplaying; end
|
5
|
+
def stop; @mpd.stop; nowplaying; end
|
6
|
+
def pause
|
7
|
+
@mpd.paused? ? @mpd.pause=(false) : @mpd.pause=(true)
|
8
|
+
nowplaying
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class Quiyo
|
13
|
+
include Playback
|
14
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
module Playlist
|
2
|
+
def lsplist
|
3
|
+
@mpd.playlist.each { |s|
|
4
|
+
printf "[%s] %s : %s [%s]\n" % [
|
5
|
+
s.pos,
|
6
|
+
colorize(s.artist, 99),
|
7
|
+
colorize(s.title, 202),
|
8
|
+
colorize(s.album, 107)
|
9
|
+
]
|
10
|
+
}
|
11
|
+
end
|
12
|
+
|
13
|
+
def clearplist
|
14
|
+
@mpd.clear
|
15
|
+
end
|
16
|
+
|
17
|
+
def addtoplist(action)
|
18
|
+
@mpd.search(action[1], action.drop(2).join(" ")).each { |s|
|
19
|
+
@mpd.add(s.file)
|
20
|
+
}
|
21
|
+
rescue
|
22
|
+
puts "Usage: addtoplaylist searchstring"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class Quiyo
|
27
|
+
include Playlist
|
28
|
+
end
|
data/lib/quiyo/server.rb
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
module Server
|
2
|
+
def quit
|
3
|
+
@mpd.disconnect
|
4
|
+
Process.exit
|
5
|
+
end
|
6
|
+
|
7
|
+
def vol(arg)
|
8
|
+
@mpd.volume=(arg)
|
9
|
+
rescue
|
10
|
+
p "Usage: vol [0-100]"
|
11
|
+
end
|
12
|
+
|
13
|
+
def search(action)
|
14
|
+
@mpd.search(action[1], action.drop(2).join(" ")).each { |s|
|
15
|
+
printf "%s : %s [%s]\n" % [
|
16
|
+
yellow(s.artist),
|
17
|
+
blue(s.title),
|
18
|
+
green(s.album)
|
19
|
+
]
|
20
|
+
}
|
21
|
+
rescue
|
22
|
+
p "Usage: search [artist|title|album] name"
|
23
|
+
end
|
24
|
+
|
25
|
+
def list(type, arg = nil)
|
26
|
+
case type
|
27
|
+
when "artists"
|
28
|
+
@mpd.artists.each { |s| p s }
|
29
|
+
when "albums"
|
30
|
+
@mpd.albums(arg.drop(1).join(" ")).each { |s| p s }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class Quiyo
|
36
|
+
include Server
|
37
|
+
|
38
|
+
def initialize(server, port, version)
|
39
|
+
print colorize("++", 197) + " Connecting to MPD at #{server}:#{port}..."
|
40
|
+
@mpd = MPD.new server, port
|
41
|
+
@mpd.connect
|
42
|
+
print colorize("Connected!\n", 70)
|
43
|
+
print colorize("++", 197) + " This is quiyo #{version}\n\n"
|
44
|
+
end
|
45
|
+
end
|
data/lib/quiyo/status.rb
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
module Status
|
2
|
+
def nowplaying
|
3
|
+
song = @mpd.current_song
|
4
|
+
puts colorize(song["title"], 202) +
|
5
|
+
" by " +
|
6
|
+
colorize(song["artist"], 99) +
|
7
|
+
" on " +
|
8
|
+
colorize(song["album"], 107) +
|
9
|
+
" [" + colorize(song["date"], 213) + "]"
|
10
|
+
rescue
|
11
|
+
puts "#{colorize("Nothing", 196)} playing right now #{colorize(":(", 229)}"
|
12
|
+
end
|
13
|
+
|
14
|
+
def info
|
15
|
+
def _print(key, value)
|
16
|
+
print "%-20s %s\n" % [ colorize(key.capitalize + ":", 99), colorize(value, 202) ]
|
17
|
+
end
|
18
|
+
|
19
|
+
sep = "----~---~-~---------~~------~-"
|
20
|
+
|
21
|
+
s = @mpd.status
|
22
|
+
sid = @mpd.song_with_id(s[:songid])
|
23
|
+
|
24
|
+
# Get current song
|
25
|
+
%w{artist title album date file}.each { |k|
|
26
|
+
_print(k, sid[k])
|
27
|
+
}
|
28
|
+
_print "DURATION", time(sid["time"])
|
29
|
+
puts sep
|
30
|
+
|
31
|
+
# Get MPD Status
|
32
|
+
%w{volume repeat random playlistlength xfade}.each { |k|
|
33
|
+
_print(k, s[k])
|
34
|
+
}
|
35
|
+
puts sep
|
36
|
+
|
37
|
+
s = @mpd.stats
|
38
|
+
|
39
|
+
# Get MPD Stats
|
40
|
+
%w{artists albums songs}.each { |k|
|
41
|
+
_print(k, s[k])
|
42
|
+
}
|
43
|
+
puts sep
|
44
|
+
|
45
|
+
# Get MPD Times
|
46
|
+
%w{uptime playtime db_playtime}.each { |k,v|
|
47
|
+
_print(k, time(s[k]))
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
def time(sec)
|
52
|
+
string = ""
|
53
|
+
time = sec.to_i
|
54
|
+
days = (time/86400)
|
55
|
+
hours = (time/3600 - days * 24)
|
56
|
+
minutes = (time/60 - (hours * 60 + days * 1440))
|
57
|
+
seconds = (time - (minutes * 60 + hours * 3600 + days * 86400))
|
58
|
+
{ "d" => days, "h" => hours, "m" => minutes, "s" => seconds}.each { |k,v|
|
59
|
+
string += "%02d%s " % [v, k] if v > 0
|
60
|
+
}
|
61
|
+
return string
|
62
|
+
end
|
63
|
+
|
64
|
+
def prompt
|
65
|
+
return "%s(%s%s%s) %s " % [
|
66
|
+
colorize(@mpd.status["state"], 67),
|
67
|
+
colorize(@mpd.status["repeat"] == "1" ? "r" : "", 107),
|
68
|
+
colorize(@mpd.status["random"] == "1" ? "z" : "", 107),
|
69
|
+
colorize(@mpd.status["xfade"] != "0" ? "x" : "", 107),
|
70
|
+
colorize(">>>", 142)
|
71
|
+
]
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
class Quiyo
|
76
|
+
include Status
|
77
|
+
end
|
data/lib/quiyo.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Tested on 1.9.2p180=<
|
3
|
+
|
4
|
+
# We need this...
|
5
|
+
|
6
|
+
%w[
|
7
|
+
dm-core
|
8
|
+
dm-do-adapter
|
9
|
+
dm-migrations
|
10
|
+
dm-sqlite-adapter
|
11
|
+
librmpd
|
12
|
+
readline
|
13
|
+
yaml
|
14
|
+
].each { |m| require m }
|
15
|
+
|
16
|
+
# ...and this...
|
17
|
+
config_paths = [ ENV["XDG_CONFIG_HOME"] ]
|
18
|
+
ENV["XDG_CONFIG_DIRS"].split(":").each { |d|
|
19
|
+
config_paths << d
|
20
|
+
}
|
21
|
+
|
22
|
+
config_paths.each { |p|
|
23
|
+
if File.exists?("#{p}/quiyo/config.yml")
|
24
|
+
CONF = YAML.load_file "#{p}/quiyo/config.yml"
|
25
|
+
break
|
26
|
+
end
|
27
|
+
}
|
28
|
+
|
29
|
+
# ...and this, too!
|
30
|
+
%w[
|
31
|
+
core
|
32
|
+
colors
|
33
|
+
playback
|
34
|
+
playlist
|
35
|
+
server
|
36
|
+
status
|
37
|
+
database
|
38
|
+
].each { |m| require "quiyo/#{m}" }
|
39
|
+
|
40
|
+
# Start everything up
|
41
|
+
quiyo = Quiyo.new(CONF["server"], CONF["port"], "0.1.0")
|
42
|
+
quiyo.showprompt
|
data/quiyo.gemspec
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{quiyo}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["crshd"]
|
12
|
+
s.date = %q{2011-07-19}
|
13
|
+
s.default_executable = %q{quiyo}
|
14
|
+
s.description = %q{Inspired by pimpd2}
|
15
|
+
s.email = %q{crshd@mail.com}
|
16
|
+
s.executables = ["quiyo"]
|
17
|
+
s.extra_rdoc_files = [
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.rdoc"
|
20
|
+
]
|
21
|
+
s.files = [
|
22
|
+
".document",
|
23
|
+
"Gemfile",
|
24
|
+
"LICENSE.txt",
|
25
|
+
"README.rdoc",
|
26
|
+
"Rakefile",
|
27
|
+
"VERSION",
|
28
|
+
"bin/quiyo",
|
29
|
+
"lib/quiyo.rb",
|
30
|
+
"lib/quiyo/colors.rb",
|
31
|
+
"lib/quiyo/core.rb",
|
32
|
+
"lib/quiyo/database.rb",
|
33
|
+
"lib/quiyo/playback.rb",
|
34
|
+
"lib/quiyo/playlist.rb",
|
35
|
+
"lib/quiyo/server.rb",
|
36
|
+
"lib/quiyo/status.rb",
|
37
|
+
"quiyo.gemspec",
|
38
|
+
"test/helper.rb",
|
39
|
+
"test/test_quiyo.rb"
|
40
|
+
]
|
41
|
+
s.homepage = %q{http://github.com/crshd/quiyo}
|
42
|
+
s.licenses = ["MIT"]
|
43
|
+
s.require_paths = ["lib"]
|
44
|
+
s.rubygems_version = %q{1.3.7}
|
45
|
+
s.summary = %q{Readline client for MPD}
|
46
|
+
|
47
|
+
if s.respond_to? :specification_version then
|
48
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
49
|
+
s.specification_version = 3
|
50
|
+
|
51
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
52
|
+
s.add_runtime_dependency(%q<dm-core>, [">= 0"])
|
53
|
+
s.add_runtime_dependency(%q<dm-migrations>, [">= 0"])
|
54
|
+
s.add_runtime_dependency(%q<dm-sqlite-adapter>, [">= 0"])
|
55
|
+
s.add_runtime_dependency(%q<librmpd>, [">= 0"])
|
56
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
57
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
58
|
+
else
|
59
|
+
s.add_dependency(%q<dm-core>, [">= 0"])
|
60
|
+
s.add_dependency(%q<dm-migrations>, [">= 0"])
|
61
|
+
s.add_dependency(%q<dm-sqlite-adapter>, [">= 0"])
|
62
|
+
s.add_dependency(%q<librmpd>, [">= 0"])
|
63
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
64
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
65
|
+
end
|
66
|
+
else
|
67
|
+
s.add_dependency(%q<dm-core>, [">= 0"])
|
68
|
+
s.add_dependency(%q<dm-migrations>, [">= 0"])
|
69
|
+
s.add_dependency(%q<dm-sqlite-adapter>, [">= 0"])
|
70
|
+
s.add_dependency(%q<librmpd>, [">= 0"])
|
71
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
72
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
data/test/helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :development)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
require 'test/unit'
|
11
|
+
require 'shoulda'
|
12
|
+
|
13
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
+
require 'quiyo'
|
16
|
+
|
17
|
+
class Test::Unit::TestCase
|
18
|
+
end
|
data/test/test_quiyo.rb
ADDED
metadata
ADDED
@@ -0,0 +1,164 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: quiyo
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
version: 0.1.0
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- crshd
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-07-19 00:00:00 +08:00
|
18
|
+
default_executable: quiyo
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: dm-core
|
22
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
23
|
+
none: false
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 0
|
29
|
+
version: "0"
|
30
|
+
type: :runtime
|
31
|
+
prerelease: false
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: dm-migrations
|
35
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
segments:
|
41
|
+
- 0
|
42
|
+
version: "0"
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: *id002
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: dm-sqlite-adapter
|
48
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
segments:
|
54
|
+
- 0
|
55
|
+
version: "0"
|
56
|
+
type: :runtime
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *id003
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: librmpd
|
61
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
segments:
|
67
|
+
- 0
|
68
|
+
version: "0"
|
69
|
+
type: :runtime
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: *id004
|
72
|
+
- !ruby/object:Gem::Dependency
|
73
|
+
name: bundler
|
74
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ~>
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
segments:
|
80
|
+
- 1
|
81
|
+
- 0
|
82
|
+
- 0
|
83
|
+
version: 1.0.0
|
84
|
+
type: :development
|
85
|
+
prerelease: false
|
86
|
+
version_requirements: *id005
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
name: jeweler
|
89
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ~>
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
segments:
|
95
|
+
- 1
|
96
|
+
- 6
|
97
|
+
- 4
|
98
|
+
version: 1.6.4
|
99
|
+
type: :development
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *id006
|
102
|
+
description: Inspired by pimpd2
|
103
|
+
email: crshd@mail.com
|
104
|
+
executables:
|
105
|
+
- quiyo
|
106
|
+
extensions: []
|
107
|
+
|
108
|
+
extra_rdoc_files:
|
109
|
+
- LICENSE.txt
|
110
|
+
- README.rdoc
|
111
|
+
files:
|
112
|
+
- .document
|
113
|
+
- Gemfile
|
114
|
+
- LICENSE.txt
|
115
|
+
- README.rdoc
|
116
|
+
- Rakefile
|
117
|
+
- VERSION
|
118
|
+
- bin/quiyo
|
119
|
+
- lib/quiyo.rb
|
120
|
+
- lib/quiyo/colors.rb
|
121
|
+
- lib/quiyo/core.rb
|
122
|
+
- lib/quiyo/database.rb
|
123
|
+
- lib/quiyo/playback.rb
|
124
|
+
- lib/quiyo/playlist.rb
|
125
|
+
- lib/quiyo/server.rb
|
126
|
+
- lib/quiyo/status.rb
|
127
|
+
- quiyo.gemspec
|
128
|
+
- test/helper.rb
|
129
|
+
- test/test_quiyo.rb
|
130
|
+
has_rdoc: true
|
131
|
+
homepage: http://github.com/crshd/quiyo
|
132
|
+
licenses:
|
133
|
+
- MIT
|
134
|
+
post_install_message:
|
135
|
+
rdoc_options: []
|
136
|
+
|
137
|
+
require_paths:
|
138
|
+
- lib
|
139
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
140
|
+
none: false
|
141
|
+
requirements:
|
142
|
+
- - ">="
|
143
|
+
- !ruby/object:Gem::Version
|
144
|
+
hash: -1485489352837026096
|
145
|
+
segments:
|
146
|
+
- 0
|
147
|
+
version: "0"
|
148
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
149
|
+
none: false
|
150
|
+
requirements:
|
151
|
+
- - ">="
|
152
|
+
- !ruby/object:Gem::Version
|
153
|
+
segments:
|
154
|
+
- 0
|
155
|
+
version: "0"
|
156
|
+
requirements: []
|
157
|
+
|
158
|
+
rubyforge_project:
|
159
|
+
rubygems_version: 1.3.7
|
160
|
+
signing_key:
|
161
|
+
specification_version: 3
|
162
|
+
summary: Readline client for MPD
|
163
|
+
test_files: []
|
164
|
+
|