mirror of
https://github.com/danbee/mpd-client
synced 2025-03-04 08:39:09 +00:00
First commit. MPD connects.
This commit is contained in:
commit
0af2663bb6
14
Gemfile
Normal file
14
Gemfile
Normal file
@ -0,0 +1,14 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'sinatra'
|
||||
gem 'foreman'
|
||||
|
||||
gem 'ruby-mpd'
|
||||
|
||||
group :development do
|
||||
gem 'shotgun'
|
||||
end
|
||||
|
||||
group :production do
|
||||
gem 'thin'
|
||||
end
|
||||
35
Gemfile.lock
Normal file
35
Gemfile.lock
Normal file
@ -0,0 +1,35 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
daemons (1.1.9)
|
||||
dotenv (0.8.0)
|
||||
eventmachine (1.0.3)
|
||||
foreman (0.63.0)
|
||||
dotenv (>= 0.7)
|
||||
thor (>= 0.13.6)
|
||||
rack (1.5.2)
|
||||
rack-protection (1.5.0)
|
||||
rack
|
||||
ruby-mpd (0.2.4)
|
||||
shotgun (0.9)
|
||||
rack (>= 1.0)
|
||||
sinatra (1.4.3)
|
||||
rack (~> 1.4)
|
||||
rack-protection (~> 1.4)
|
||||
tilt (~> 1.3, >= 1.3.4)
|
||||
thin (1.5.1)
|
||||
daemons (>= 1.0.9)
|
||||
eventmachine (>= 0.12.6)
|
||||
rack (>= 1.0.0)
|
||||
thor (0.18.1)
|
||||
tilt (1.4.1)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
foreman
|
||||
ruby-mpd
|
||||
shotgun
|
||||
sinatra
|
||||
thin
|
||||
6
config.ru
Normal file
6
config.ru
Normal file
@ -0,0 +1,6 @@
|
||||
require 'bundler'
|
||||
|
||||
Bundler.setup
|
||||
require './mpd_client'
|
||||
|
||||
run MPDClient
|
||||
14
mpd_client.rb
Normal file
14
mpd_client.rb
Normal file
@ -0,0 +1,14 @@
|
||||
require 'sinatra'
|
||||
require 'json'
|
||||
require 'ruby-mpd'
|
||||
|
||||
class MPDClient < Sinatra::Base
|
||||
before do
|
||||
@mpd = MPD.new
|
||||
@mpd.connect
|
||||
end
|
||||
|
||||
get '/api/albums' do
|
||||
@mpd.albums
|
||||
end
|
||||
end
|
||||
Loading…
Reference in New Issue
Block a user