vkpd 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -0
- data/lib/vkpd/auth.rb +2 -3
- data/lib/vkpd/cli.rb +4 -0
- data/lib/vkpd/version.rb +1 -1
- data/lib/vkpd.rb +2 -2
- data/vkpd.gemspec +1 -0
- metadata +18 -2
data/README.md
CHANGED
@@ -2,8 +2,10 @@
|
|
2
2
|
|
3
3
|
VKPD searches for music on social network vk.com and adds/plays it with MPD.
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/vkpd.png)](http://badge.fury.io/rb/vkpd)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/alesguzik/vkpd.png)](https://codeclimate.com/github/alesguzik/vkpd)
|
5
6
|
|
6
7
|
##Run
|
8
|
+
vkpd auth
|
7
9
|
vkpd [options] [search request]
|
8
10
|
|
9
11
|
##Options
|
@@ -24,6 +26,7 @@ VKPD searches for music on social network vk.com and adds/plays it with MPD.
|
|
24
26
|
Add songs to current playlist instead of replacing it
|
25
27
|
|
26
28
|
##Some examples
|
29
|
+
vkpd auth # authenticate vkpd in vk.com
|
27
30
|
vkpd Beatles # replaces current mpd playlist with The Beatles' songs and starts playing
|
28
31
|
vkpd play Beatles # the same
|
29
32
|
vkpd add Beatles # adds found songs to playlist and starts playing
|
data/lib/vkpd/auth.rb
CHANGED
@@ -23,10 +23,9 @@ module Vkpd
|
|
23
23
|
end
|
24
24
|
Thread.new do
|
25
25
|
sleep 0.5
|
26
|
-
|
27
|
-
Kernel.exec("true")
|
26
|
+
Process.kill 'INT', Process.pid
|
28
27
|
end
|
29
|
-
"
|
28
|
+
"<html><head><script>window.close()</script></head><body>Authorized. Now close me and go back to your term</body></html>"
|
30
29
|
end
|
31
30
|
end
|
32
31
|
end
|
data/lib/vkpd/cli.rb
CHANGED
data/lib/vkpd/version.rb
CHANGED
data/lib/vkpd.rb
CHANGED
@@ -6,6 +6,7 @@ require 'yaml'
|
|
6
6
|
require 'json'
|
7
7
|
require 'pathname'
|
8
8
|
require 'sinatra/base'
|
9
|
+
require 'launchy'
|
9
10
|
require 'ruby-mpd'
|
10
11
|
require 'vkpd/version'
|
11
12
|
require 'vkpd/cli'
|
@@ -22,8 +23,7 @@ module Vkpd
|
|
22
23
|
# Reads config file, parses it as yaml and caches the result
|
23
24
|
def config
|
24
25
|
unless File.exist? config_path
|
25
|
-
|
26
|
-
exit 1
|
26
|
+
system("vkpd auth 2>&1 >/dev/null")
|
27
27
|
end
|
28
28
|
@config ||= YAML.load File.read(config_path)
|
29
29
|
end
|
data/vkpd.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vkpd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
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-07-
|
12
|
+
date: 2013-07-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: sinatra
|
@@ -43,6 +43,22 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: 0.2.4
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: launchy
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
46
62
|
- !ruby/object:Gem::Dependency
|
47
63
|
name: bundler
|
48
64
|
requirement: !ruby/object:Gem::Requirement
|