playa 0.0.15 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/playa/application.rb +30 -4
- data/lib/playa/controllers/controller.rb +12 -48
- data/lib/playa/views/help_view.rb +51 -5
- data/lib/playa/views/playlist_view.rb +55 -52
- data/lib/playa/views/progress_view.rb +32 -21
- data/lib/playa/views/startup_view.rb +23 -8
- data/lib/playa/views/status_view.rb +19 -14
- data/playa.gemspec +2 -2
- data/test/lib/playa/views/help_view_test.rb +1 -35
- data/test/lib/playa/views/playlist_view_test.rb +1 -1
- data/test/lib/playa/views/progress_view_test.rb +0 -53
- data/test/lib/playa/views/startup_view_test.rb +1 -83
- data/test/lib/playa/views/status_view_test.rb +1 -153
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4069c82bc0e714daf84b7d715fc0ea75ec268224
|
|
4
|
+
data.tar.gz: 2c0938d959b74f1dbd6c66373fe5735d702ccfa1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 87a3698dc1165287b2598f59b085acdd7142c700ba48ce6a6c51e01e92add6b2bcbde2c9aae62480cbf6a312cc9891e66ff03e1b6ea7073e481d1568e144dc55
|
|
7
|
+
data.tar.gz: 72fe0f93bfee657daee08bdab4598ded48144995c322947220d5a65fb9124c0eb5b5006c35114ba73bac568c9b9294a4dfc8dab5b8386b09cee5054c66862113
|
data/lib/playa/application.rb
CHANGED
|
@@ -9,7 +9,6 @@ module Playa
|
|
|
9
9
|
interface 'help' do
|
|
10
10
|
centred true
|
|
11
11
|
colour foreground: '#ffffff', background: '#000000'
|
|
12
|
-
cursor false
|
|
13
12
|
group 'help'
|
|
14
13
|
height 9
|
|
15
14
|
width 60
|
|
@@ -17,7 +16,6 @@ module Playa
|
|
|
17
16
|
|
|
18
17
|
interface 'playlist' do
|
|
19
18
|
colour foreground: '#afd700', background: '#000000'
|
|
20
|
-
cursor false
|
|
21
19
|
width 60
|
|
22
20
|
height 5
|
|
23
21
|
centred true
|
|
@@ -26,7 +24,6 @@ module Playa
|
|
|
26
24
|
|
|
27
25
|
interface 'progress' do
|
|
28
26
|
colour foreground: '#005aff', background: '#000000'
|
|
29
|
-
cursor false
|
|
30
27
|
width 60
|
|
31
28
|
height 1
|
|
32
29
|
y { use('playlist').north(2) }
|
|
@@ -38,7 +35,6 @@ module Playa
|
|
|
38
35
|
|
|
39
36
|
interface 'status' do
|
|
40
37
|
colour foreground: '#d70000', background: '#000000'
|
|
41
|
-
cursor false
|
|
42
38
|
width 60
|
|
43
39
|
height 1
|
|
44
40
|
y { use('playlist').south(1) }
|
|
@@ -47,6 +43,36 @@ module Playa
|
|
|
47
43
|
group 'player'
|
|
48
44
|
end
|
|
49
45
|
|
|
46
|
+
keys do
|
|
47
|
+
key('p', 's') { trigger(:show_player) }
|
|
48
|
+
key('?') { trigger(:show_help) }
|
|
49
|
+
key(' ') { trigger(:toggle) } # pause/unpause
|
|
50
|
+
key('h', :left) { trigger(:rewind) }
|
|
51
|
+
key('l', :right) { trigger(:forward) }
|
|
52
|
+
|
|
53
|
+
key('k', :up) do
|
|
54
|
+
trigger(:_menu_prev_, 'playlist')
|
|
55
|
+
trigger(:update)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
key('j', :down) do
|
|
59
|
+
trigger(:_menu_next_, 'playlist')
|
|
60
|
+
trigger(:update)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
key(:enter) do
|
|
64
|
+
trigger(:_menu_select_, 'playlist')
|
|
65
|
+
trigger(:select, trigger(:_menu_selected_, 'playlist'))
|
|
66
|
+
trigger(:update)
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
configure do
|
|
71
|
+
colour_mode 16777216
|
|
72
|
+
interactive!
|
|
73
|
+
raw!
|
|
74
|
+
end
|
|
75
|
+
|
|
50
76
|
def self.start(args = [])
|
|
51
77
|
Controller.new(args)
|
|
52
78
|
|
|
@@ -9,72 +9,36 @@ module Playa
|
|
|
9
9
|
trigger(:update)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
event
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
event :key do |key|
|
|
17
|
-
case key
|
|
18
|
-
when :left, 'h' then trigger(:rewind)
|
|
19
|
-
when :right, 'l' then trigger(:forward)
|
|
20
|
-
when ' ' then trigger(:toggle)
|
|
21
|
-
when :up, 'k' then
|
|
22
|
-
trigger(:_menu_prev_, 'playlist')
|
|
23
|
-
trigger(:update)
|
|
24
|
-
|
|
25
|
-
when :down, 'j' then
|
|
26
|
-
trigger(:_menu_next_, 'playlist')
|
|
27
|
-
trigger(:update)
|
|
28
|
-
|
|
29
|
-
when '?' then trigger(:show_help)
|
|
30
|
-
when 'p', 's' then trigger(:show_player)
|
|
31
|
-
when 'q' then trigger(:_exit_)
|
|
32
|
-
when :enter then
|
|
33
|
-
trigger(:_menu_select_, 'playlist')
|
|
34
|
-
trigger(:select, trigger(:_menu_selected_, 'playlist'))
|
|
35
|
-
trigger(:update)
|
|
36
|
-
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
event :select do |track|
|
|
41
|
-
trigger(:play, track)
|
|
42
|
-
end
|
|
12
|
+
event(:_initialize_) { trigger(:show_startup) }
|
|
13
|
+
event(:select) { |track| trigger(:play, track) }
|
|
14
|
+
event(:show_startup) { StartupView.new.show }
|
|
15
|
+
event(:show_help) { HelpView.new.show }
|
|
43
16
|
|
|
44
17
|
event :update do
|
|
45
|
-
PlaylistView.
|
|
18
|
+
PlaylistView.new.show
|
|
19
|
+
|
|
46
20
|
trigger(:_refresh_playlist_)
|
|
47
21
|
end
|
|
48
22
|
|
|
49
23
|
def initialize(args = [])
|
|
50
24
|
@args = args
|
|
51
|
-
|
|
52
25
|
@player = Player.new
|
|
53
26
|
@player.events.on(:position_change) { trigger(:progress_update) }
|
|
54
27
|
@player.events.on(:complete) { trigger(:complete) }
|
|
55
28
|
|
|
56
|
-
event :
|
|
29
|
+
event :show_player do
|
|
57
30
|
trigger(:_clear_)
|
|
58
|
-
StartupView.render
|
|
59
|
-
trigger(:_refresh_group_player_)
|
|
60
|
-
end
|
|
61
31
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
trigger(:_refresh_help_)
|
|
66
|
-
end
|
|
32
|
+
PlaylistView.new.show
|
|
33
|
+
StatusView.new.show
|
|
34
|
+
ProgressView.new(@player).show
|
|
67
35
|
|
|
68
|
-
event :show_player do
|
|
69
|
-
trigger(:_clear_)
|
|
70
|
-
PlaylistView.render
|
|
71
|
-
StatusView.render
|
|
72
|
-
ProgressView.render(@player)
|
|
73
36
|
trigger(:_refresh_group_player_)
|
|
74
37
|
end
|
|
75
38
|
|
|
76
39
|
event(:progress_update, { delay: 0.5 }) do
|
|
77
|
-
ProgressView.
|
|
40
|
+
ProgressView.new(@player).show
|
|
41
|
+
|
|
78
42
|
trigger(:_refresh_progress_)
|
|
79
43
|
end
|
|
80
44
|
|
|
@@ -1,9 +1,55 @@
|
|
|
1
1
|
module Playa
|
|
2
|
-
class HelpView
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
class HelpView
|
|
3
|
+
include Vedeu
|
|
4
|
+
|
|
5
|
+
def show
|
|
6
|
+
trigger(:_clear_)
|
|
7
|
+
|
|
8
|
+
render do
|
|
9
|
+
view 'help' do
|
|
10
|
+
line do
|
|
11
|
+
colour foreground: '#aadd00'
|
|
12
|
+
stream do
|
|
13
|
+
align centre
|
|
14
|
+
width use('help').width
|
|
15
|
+
text 'Wow, you found the really useful help page!'
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
line ''
|
|
20
|
+
|
|
21
|
+
line do
|
|
22
|
+
colour foreground: '#ffffff'
|
|
23
|
+
stream do
|
|
24
|
+
align centre
|
|
25
|
+
width use('help').width
|
|
26
|
+
text 'Whilst a track is playing you can press:'
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
line ''
|
|
31
|
+
|
|
32
|
+
line do
|
|
33
|
+
foreground('#ff0000') { text " \u{25C0}" }
|
|
34
|
+
foreground('#ffffff') { text ' to rewind 5 seconds' }
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
line do
|
|
38
|
+
foreground('#ff0000') { text " \u{25B6}" }
|
|
39
|
+
foreground('#ffffff') { text ' to go forward 5 seconds' }
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
line ''
|
|
43
|
+
line ''
|
|
44
|
+
|
|
45
|
+
line do
|
|
46
|
+
colour foreground: '#ffff00'
|
|
47
|
+
stream do
|
|
48
|
+
align centre
|
|
49
|
+
width use('help').width
|
|
50
|
+
text 'Press `p` to return to Playa.'
|
|
51
|
+
end
|
|
52
|
+
end
|
|
7
53
|
end
|
|
8
54
|
end
|
|
9
55
|
end
|
|
@@ -1,66 +1,69 @@
|
|
|
1
1
|
module Playa
|
|
2
|
-
class PlaylistView
|
|
2
|
+
class PlaylistView
|
|
3
|
+
include Vedeu
|
|
3
4
|
include Playa::Helpers
|
|
4
5
|
|
|
5
|
-
def
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
def show
|
|
7
|
+
render do
|
|
8
|
+
view 'playlist' do
|
|
9
|
+
playlist_menu.each do |sel, cur, item|
|
|
10
|
+
if sel && cur
|
|
11
|
+
line do
|
|
12
|
+
stream do
|
|
13
|
+
width title_width(item)
|
|
14
|
+
text "\u{25B6}> #{item.title}"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
stream do
|
|
18
|
+
width timer_width(item)
|
|
19
|
+
text "#{timer(item)}"
|
|
20
|
+
align :right
|
|
21
|
+
end
|
|
13
22
|
end
|
|
14
23
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
elsif cur
|
|
25
|
+
line do
|
|
26
|
+
stream do
|
|
27
|
+
width title_width(item)
|
|
28
|
+
text " > #{item.title}"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
stream do
|
|
32
|
+
width timer_width(item)
|
|
33
|
+
text "#{timer(item)}"
|
|
34
|
+
align :right
|
|
35
|
+
end
|
|
27
36
|
end
|
|
28
37
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
elsif sel
|
|
39
|
+
line do
|
|
40
|
+
stream do
|
|
41
|
+
width title_width(item)
|
|
42
|
+
text "\u{25B6} #{item.title}"
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
stream do
|
|
46
|
+
width timer_width(item)
|
|
47
|
+
text "#{timer(item)}"
|
|
48
|
+
align :right
|
|
49
|
+
end
|
|
33
50
|
end
|
|
34
|
-
end
|
|
35
51
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
52
|
+
else
|
|
53
|
+
line do
|
|
54
|
+
stream do
|
|
55
|
+
width title_width(item)
|
|
56
|
+
text " #{item.title}"
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
stream do
|
|
60
|
+
width timer_width(item)
|
|
61
|
+
text "#{timer(item)}"
|
|
62
|
+
align :right
|
|
63
|
+
end
|
|
41
64
|
end
|
|
42
65
|
|
|
43
|
-
stream do
|
|
44
|
-
width timer_width(item)
|
|
45
|
-
text "#{timer(item)}"
|
|
46
|
-
align :right
|
|
47
|
-
end
|
|
48
66
|
end
|
|
49
|
-
|
|
50
|
-
else
|
|
51
|
-
line do
|
|
52
|
-
stream do
|
|
53
|
-
width title_width(item)
|
|
54
|
-
text " #{item.title}"
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
stream do
|
|
58
|
-
width timer_width(item)
|
|
59
|
-
text "#{timer(item)}"
|
|
60
|
-
align :right
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
67
|
end
|
|
65
68
|
end
|
|
66
69
|
end
|
|
@@ -81,7 +84,7 @@ module Playa
|
|
|
81
84
|
end
|
|
82
85
|
|
|
83
86
|
def view_width
|
|
84
|
-
Vedeu.use('playlist').
|
|
87
|
+
Vedeu.use('playlist').width
|
|
85
88
|
end
|
|
86
89
|
|
|
87
90
|
def playlist_menu
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
module Playa
|
|
2
|
-
class ProgressView
|
|
2
|
+
class ProgressView
|
|
3
|
+
include Vedeu
|
|
3
4
|
include Playa::Helpers
|
|
4
5
|
|
|
5
|
-
def
|
|
6
|
-
|
|
6
|
+
def initialize(player)
|
|
7
|
+
@player = player
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def show
|
|
11
|
+
if player.track
|
|
7
12
|
track_loaded
|
|
8
13
|
|
|
9
14
|
else
|
|
@@ -14,29 +19,35 @@ module Playa
|
|
|
14
19
|
|
|
15
20
|
private
|
|
16
21
|
|
|
22
|
+
attr_reader :player
|
|
23
|
+
|
|
17
24
|
def track_loaded
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
render do
|
|
26
|
+
view 'progress' do
|
|
27
|
+
line do
|
|
28
|
+
stream do
|
|
29
|
+
width progress_width
|
|
30
|
+
text progress_bar
|
|
31
|
+
end
|
|
24
32
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
33
|
+
stream do
|
|
34
|
+
width timer_width
|
|
35
|
+
text timer
|
|
36
|
+
align :right
|
|
37
|
+
end
|
|
29
38
|
end
|
|
30
39
|
end
|
|
31
40
|
end
|
|
32
41
|
end
|
|
33
42
|
|
|
34
43
|
def no_track_loaded
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
44
|
+
render do
|
|
45
|
+
view 'progress' do
|
|
46
|
+
line do
|
|
47
|
+
stream do
|
|
48
|
+
width view_width
|
|
49
|
+
text ' '
|
|
50
|
+
end
|
|
40
51
|
end
|
|
41
52
|
end
|
|
42
53
|
end
|
|
@@ -47,7 +58,7 @@ module Playa
|
|
|
47
58
|
end
|
|
48
59
|
|
|
49
60
|
def progress_bar
|
|
50
|
-
"\u{25FC}" * (
|
|
61
|
+
"\u{25FC}" * (player.progress * progress_width).ceil
|
|
51
62
|
end
|
|
52
63
|
|
|
53
64
|
def timer_width
|
|
@@ -55,11 +66,11 @@ module Playa
|
|
|
55
66
|
end
|
|
56
67
|
|
|
57
68
|
def timer
|
|
58
|
-
remaining(
|
|
69
|
+
remaining(player.track, player)
|
|
59
70
|
end
|
|
60
71
|
|
|
61
72
|
def view_width
|
|
62
|
-
Vedeu.use('progress').
|
|
73
|
+
Vedeu.use('progress').width
|
|
63
74
|
end
|
|
64
75
|
end
|
|
65
76
|
end
|
|
@@ -1,23 +1,38 @@
|
|
|
1
1
|
module Playa
|
|
2
|
-
class StartupView
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
class StartupView
|
|
3
|
+
include Vedeu
|
|
4
|
+
|
|
5
|
+
def show
|
|
6
|
+
trigger(:_clear_)
|
|
7
|
+
|
|
8
|
+
render do
|
|
5
9
|
view 'progress' do
|
|
6
10
|
line do
|
|
7
|
-
|
|
11
|
+
stream do
|
|
12
|
+
text 'Welcome to Playa.'
|
|
13
|
+
align centre
|
|
14
|
+
width use('progress').width
|
|
15
|
+
end
|
|
8
16
|
end
|
|
9
17
|
end
|
|
18
|
+
|
|
10
19
|
view 'playlist' do
|
|
11
|
-
line
|
|
12
|
-
|
|
13
|
-
|
|
20
|
+
line ''
|
|
21
|
+
line ''
|
|
22
|
+
line 'Playa is a simple, interactive mp3 player for your terminal.'
|
|
14
23
|
end
|
|
24
|
+
|
|
15
25
|
view 'status' do
|
|
16
26
|
line do
|
|
17
|
-
|
|
27
|
+
stream do
|
|
28
|
+
text 'Press `s` to begin.'
|
|
29
|
+
align centre
|
|
30
|
+
width use('progress').width
|
|
31
|
+
end
|
|
18
32
|
end
|
|
19
33
|
end
|
|
20
34
|
end
|
|
21
35
|
end
|
|
36
|
+
|
|
22
37
|
end
|
|
23
38
|
end
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
module Playa
|
|
2
|
-
class StatusView
|
|
3
|
-
|
|
4
|
-
view 'status' do
|
|
5
|
-
line do
|
|
6
|
-
foreground('#ff0000') { text " \u{25B2}" }
|
|
7
|
-
foreground('#ffffff') { text ' Prev ' }
|
|
2
|
+
class StatusView
|
|
3
|
+
include Vedeu
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
def show
|
|
6
|
+
render do
|
|
7
|
+
view 'status' do
|
|
8
|
+
line do
|
|
9
|
+
foreground('#ff0000') { text " \u{25B2}" }
|
|
10
|
+
foreground('#ffffff') { text ' Prev ' }
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
foreground('#ff0000') { text "\u{25BC}" }
|
|
13
|
+
foreground('#ffffff') { text ' Next ' }
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
foreground('#ff0000') { text "\u{21B2}" }
|
|
16
|
+
foreground('#ffffff') { text ' Play ' }
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
foreground('#ff0000') { text "\u{2395}" }
|
|
19
|
+
foreground('#ffffff') { text ' Pause ' }
|
|
20
|
+
|
|
21
|
+
foreground('#ff0000') { text 'Q' }
|
|
22
|
+
foreground('#ffffff') { text ' Quit ' }
|
|
23
|
+
end
|
|
20
24
|
end
|
|
21
25
|
end
|
|
22
26
|
end
|
|
27
|
+
|
|
23
28
|
end
|
|
24
29
|
end
|
data/playa.gemspec
CHANGED
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
4
4
|
|
|
5
5
|
Gem::Specification.new do |spec|
|
|
6
6
|
spec.name = 'playa'
|
|
7
|
-
spec.version = '0.0
|
|
7
|
+
spec.version = '0.1.0'
|
|
8
8
|
spec.authors = ['Gavin Laking']
|
|
9
9
|
spec.email = ['gavinlaking@gmail.com']
|
|
10
10
|
spec.summary = 'Plays mp3s from a directory.'
|
|
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
|
|
|
29
29
|
|
|
30
30
|
spec.add_dependency 'audite', '0.3.0'
|
|
31
31
|
spec.add_dependency 'ruby-mp3info', '0.8.4'
|
|
32
|
-
spec.add_dependency 'vedeu', '0.2.
|
|
32
|
+
spec.add_dependency 'vedeu', '0.2.4'
|
|
33
33
|
end
|
|
@@ -2,40 +2,6 @@ require 'test_helper'
|
|
|
2
2
|
|
|
3
3
|
module Playa
|
|
4
4
|
describe HelpView do
|
|
5
|
-
|
|
6
|
-
it 'returns output suitable for Vedeu to parse' do
|
|
7
|
-
HelpView.new.render.must_equal(
|
|
8
|
-
{
|
|
9
|
-
interfaces: [
|
|
10
|
-
{
|
|
11
|
-
name: "help",
|
|
12
|
-
group: "",
|
|
13
|
-
lines: [
|
|
14
|
-
{
|
|
15
|
-
colour: {},
|
|
16
|
-
streams: [
|
|
17
|
-
{
|
|
18
|
-
text: "Help!"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
style: [],
|
|
22
|
-
parent: {
|
|
23
|
-
colour: {},
|
|
24
|
-
style: ''
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
colour: {},
|
|
29
|
-
style: "",
|
|
30
|
-
geometry: {},
|
|
31
|
-
cursor: true,
|
|
32
|
-
delay: 0.0,
|
|
33
|
-
parent: {}
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
)
|
|
38
|
-
end
|
|
39
|
-
end
|
|
5
|
+
|
|
40
6
|
end
|
|
41
7
|
end
|
|
@@ -2,58 +2,5 @@ require 'test_helper'
|
|
|
2
2
|
|
|
3
3
|
module Playa
|
|
4
4
|
describe ProgressView do
|
|
5
|
-
describe '#render' do
|
|
6
|
-
describe 'when there is no track loaded' do
|
|
7
|
-
let(:player) { Player.new }
|
|
8
|
-
|
|
9
|
-
it 'returns output suitable for Vedeu to parse' do
|
|
10
|
-
ProgressView.new(player).render.must_equal(
|
|
11
|
-
{
|
|
12
|
-
interfaces: [
|
|
13
|
-
{
|
|
14
|
-
name: "progress",
|
|
15
|
-
group: "",
|
|
16
|
-
lines: [
|
|
17
|
-
{
|
|
18
|
-
colour: {},
|
|
19
|
-
streams: [
|
|
20
|
-
{
|
|
21
|
-
colour: {},
|
|
22
|
-
style: [],
|
|
23
|
-
text: " ",
|
|
24
|
-
width: 60,
|
|
25
|
-
align: :left,
|
|
26
|
-
parent: {
|
|
27
|
-
colour: {},
|
|
28
|
-
style: []
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
],
|
|
32
|
-
style: [],
|
|
33
|
-
parent: {
|
|
34
|
-
colour: {},
|
|
35
|
-
style: ''
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
],
|
|
39
|
-
colour: {},
|
|
40
|
-
style: "",
|
|
41
|
-
geometry: {},
|
|
42
|
-
cursor: true,
|
|
43
|
-
delay: 0.0,
|
|
44
|
-
parent: {}
|
|
45
|
-
}
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
)
|
|
49
|
-
end
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
describe 'when there is a track loaded' do
|
|
53
|
-
it 'returns output suitable for Vedeu to parse' do
|
|
54
|
-
skip
|
|
55
|
-
end
|
|
56
|
-
end
|
|
57
|
-
end
|
|
58
5
|
end
|
|
59
6
|
end
|
|
@@ -2,88 +2,6 @@ require 'test_helper'
|
|
|
2
2
|
|
|
3
3
|
module Playa
|
|
4
4
|
describe StartupView do
|
|
5
|
-
|
|
6
|
-
it 'returns output suitable for Vedeu to parse' do
|
|
7
|
-
StartupView.new.render.must_equal(
|
|
8
|
-
{
|
|
9
|
-
interfaces: [
|
|
10
|
-
{
|
|
11
|
-
name: "progress",
|
|
12
|
-
group: "",
|
|
13
|
-
lines: [
|
|
14
|
-
{
|
|
15
|
-
colour: {},
|
|
16
|
-
streams: [
|
|
17
|
-
{
|
|
18
|
-
text: "Welcome to Playa."
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
style: [],
|
|
22
|
-
parent: {
|
|
23
|
-
colour: {},
|
|
24
|
-
style: ''
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
colour: {},
|
|
29
|
-
style: "",
|
|
30
|
-
geometry: {},
|
|
31
|
-
cursor: true,
|
|
32
|
-
delay: 0.0,
|
|
33
|
-
parent: {}
|
|
34
|
-
}, {
|
|
35
|
-
name: "playlist",
|
|
36
|
-
group: "",
|
|
37
|
-
lines: [
|
|
38
|
-
{
|
|
39
|
-
colour: {},
|
|
40
|
-
streams: [
|
|
41
|
-
{
|
|
42
|
-
text: "An mp3 player in your console."
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
style: [],
|
|
46
|
-
parent: {
|
|
47
|
-
colour: {},
|
|
48
|
-
style: ''
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
colour: {},
|
|
53
|
-
style: "",
|
|
54
|
-
geometry: {},
|
|
55
|
-
cursor: true,
|
|
56
|
-
delay: 0.0,
|
|
57
|
-
parent: {}
|
|
58
|
-
}, {
|
|
59
|
-
name: "status",
|
|
60
|
-
group: "",
|
|
61
|
-
lines: [
|
|
62
|
-
{
|
|
63
|
-
colour: {},
|
|
64
|
-
streams: [
|
|
65
|
-
{
|
|
66
|
-
text: "Press `s` to begin."
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
style: [],
|
|
70
|
-
parent: {
|
|
71
|
-
colour: {},
|
|
72
|
-
style: ''
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
],
|
|
76
|
-
colour: {},
|
|
77
|
-
style: "",
|
|
78
|
-
geometry: {},
|
|
79
|
-
cursor: true,
|
|
80
|
-
delay: 0.0,
|
|
81
|
-
parent: {}
|
|
82
|
-
}
|
|
83
|
-
]
|
|
84
|
-
}
|
|
85
|
-
)
|
|
86
|
-
end
|
|
87
|
-
end
|
|
5
|
+
|
|
88
6
|
end
|
|
89
7
|
end
|
|
@@ -2,158 +2,6 @@ require 'test_helper'
|
|
|
2
2
|
|
|
3
3
|
module Playa
|
|
4
4
|
describe StatusView do
|
|
5
|
-
|
|
6
|
-
it 'returns output suitable for Vedeu to parse' do
|
|
7
|
-
StatusView.new.render.must_equal(
|
|
8
|
-
{
|
|
9
|
-
interfaces: [
|
|
10
|
-
{
|
|
11
|
-
name: "status",
|
|
12
|
-
group: "",
|
|
13
|
-
lines: [
|
|
14
|
-
{
|
|
15
|
-
colour: {},
|
|
16
|
-
streams: [
|
|
17
|
-
{
|
|
18
|
-
colour: {
|
|
19
|
-
foreground: "#ff0000"
|
|
20
|
-
},
|
|
21
|
-
style: [],
|
|
22
|
-
text: " ▲",
|
|
23
|
-
width: nil,
|
|
24
|
-
align: :left,
|
|
25
|
-
parent: {
|
|
26
|
-
colour: {},
|
|
27
|
-
style: []
|
|
28
|
-
}
|
|
29
|
-
}, {
|
|
30
|
-
colour: {
|
|
31
|
-
foreground: "#ffffff"
|
|
32
|
-
},
|
|
33
|
-
style: [],
|
|
34
|
-
text: " Prev ",
|
|
35
|
-
width: nil,
|
|
36
|
-
align: :left,
|
|
37
|
-
parent: {
|
|
38
|
-
colour: {},
|
|
39
|
-
style: []
|
|
40
|
-
}
|
|
41
|
-
}, {
|
|
42
|
-
colour: {
|
|
43
|
-
foreground: "#ff0000"
|
|
44
|
-
},
|
|
45
|
-
style: [],
|
|
46
|
-
text: "▼",
|
|
47
|
-
width: nil,
|
|
48
|
-
align: :left,
|
|
49
|
-
parent: {
|
|
50
|
-
colour: {},
|
|
51
|
-
style: []
|
|
52
|
-
}
|
|
53
|
-
}, {
|
|
54
|
-
colour: {
|
|
55
|
-
foreground: "#ffffff"
|
|
56
|
-
},
|
|
57
|
-
style: [],
|
|
58
|
-
text: " Next ",
|
|
59
|
-
width: nil,
|
|
60
|
-
align: :left,
|
|
61
|
-
parent: {
|
|
62
|
-
colour: {},
|
|
63
|
-
style: []
|
|
64
|
-
}
|
|
65
|
-
}, {
|
|
66
|
-
colour: {
|
|
67
|
-
foreground: "#ff0000"
|
|
68
|
-
},
|
|
69
|
-
style: [],
|
|
70
|
-
text: "↲",
|
|
71
|
-
width: nil,
|
|
72
|
-
align: :left,
|
|
73
|
-
parent: {
|
|
74
|
-
colour: {},
|
|
75
|
-
style: []
|
|
76
|
-
}
|
|
77
|
-
}, {
|
|
78
|
-
colour: {
|
|
79
|
-
foreground: "#ffffff"
|
|
80
|
-
},
|
|
81
|
-
style: [],
|
|
82
|
-
text: " Select ",
|
|
83
|
-
width: nil,
|
|
84
|
-
align: :left,
|
|
85
|
-
parent: {
|
|
86
|
-
colour: {},
|
|
87
|
-
style: []
|
|
88
|
-
}
|
|
89
|
-
}, {
|
|
90
|
-
colour: {
|
|
91
|
-
foreground: "#ff0000"
|
|
92
|
-
},
|
|
93
|
-
style: [],
|
|
94
|
-
text: "⎕",
|
|
95
|
-
width: nil,
|
|
96
|
-
align: :left,
|
|
97
|
-
parent: {
|
|
98
|
-
colour: {},
|
|
99
|
-
style: []
|
|
100
|
-
}
|
|
101
|
-
}, {
|
|
102
|
-
colour: {
|
|
103
|
-
foreground: "#ffffff"
|
|
104
|
-
},
|
|
105
|
-
style: [],
|
|
106
|
-
text: " Pause ",
|
|
107
|
-
width: nil,
|
|
108
|
-
align: :left,
|
|
109
|
-
parent: {
|
|
110
|
-
colour: {},
|
|
111
|
-
style: []
|
|
112
|
-
}
|
|
113
|
-
}, {
|
|
114
|
-
colour: {
|
|
115
|
-
foreground: "#ff0000"
|
|
116
|
-
},
|
|
117
|
-
style: [],
|
|
118
|
-
text: "Q",
|
|
119
|
-
width: nil,
|
|
120
|
-
align: :left,
|
|
121
|
-
parent: {
|
|
122
|
-
colour: {},
|
|
123
|
-
style: []
|
|
124
|
-
}
|
|
125
|
-
}, {
|
|
126
|
-
colour: {
|
|
127
|
-
foreground: "#ffffff"
|
|
128
|
-
},
|
|
129
|
-
style: [],
|
|
130
|
-
text: " Quit ",
|
|
131
|
-
width: nil,
|
|
132
|
-
align: :left,
|
|
133
|
-
parent: {
|
|
134
|
-
colour: {},
|
|
135
|
-
style: []
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
],
|
|
139
|
-
style: [],
|
|
140
|
-
parent: {
|
|
141
|
-
colour: {},
|
|
142
|
-
style: ''
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
],
|
|
146
|
-
colour: {},
|
|
147
|
-
style: "",
|
|
148
|
-
geometry: {},
|
|
149
|
-
cursor: true,
|
|
150
|
-
delay: 0.0,
|
|
151
|
-
parent: {}
|
|
152
|
-
}
|
|
153
|
-
]
|
|
154
|
-
}
|
|
155
|
-
)
|
|
156
|
-
end
|
|
157
|
-
end
|
|
5
|
+
|
|
158
6
|
end
|
|
159
7
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: playa
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 0.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gavin Laking
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-
|
|
11
|
+
date: 2014-10-20 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -170,14 +170,14 @@ dependencies:
|
|
|
170
170
|
requirements:
|
|
171
171
|
- - '='
|
|
172
172
|
- !ruby/object:Gem::Version
|
|
173
|
-
version: 0.2.
|
|
173
|
+
version: 0.2.4
|
|
174
174
|
type: :runtime
|
|
175
175
|
prerelease: false
|
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
|
177
177
|
requirements:
|
|
178
178
|
- - '='
|
|
179
179
|
- !ruby/object:Gem::Version
|
|
180
|
-
version: 0.2.
|
|
180
|
+
version: 0.2.4
|
|
181
181
|
description: An example app using Vedeu.
|
|
182
182
|
email:
|
|
183
183
|
- gavinlaking@gmail.com
|