audio_addict 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e4976f81d40edb501b5e1bd16d741a2145aede7a91cac66606c4c8812429feb7
4
- data.tar.gz: 6011eeaf3b2c74e2648af08d0cfb25dd999e976a06fabc8181d80ca1fe6ce703
3
+ metadata.gz: 4e98bede170290fa6e000488a47a72cea69f075d4459eed74e41c2a8a62b1e2d
4
+ data.tar.gz: a0affe335ff060dc9cb9c1c01bdf52a40d72306790b80ed071d5e01fa5360f48
5
5
  SHA512:
6
- metadata.gz: c5f40c5d64faabc2c5d37d6d4734ff212484f46e8aa8467c8a8adb0159f2f3b465e940eeb67c99f8dceb5c9721b8d74856be6aeb3fcc8883c6a601e35dd28782
7
- data.tar.gz: 6abed1cd956046de5e9ca2c6f25ecde44d039ea7d014288146ce203390cee0174bd1feb34865c6d114cfbf498d111477033aa2ef2dd351c62294196bd90d3a55
6
+ metadata.gz: 0f0761d4670e92c4f7ca8c3af73f36dce7740cc23f76b8b0377f6764c52749eecea885e78a0671695ad0db162c7ef6c87e334f5f1606de9f6ffe31ea9b22a3b5
7
+ data.tar.gz: f30f1e8c47646cd1c34ef065c5b223492f5ffc8d72e31aafaf8c83bf7b446c699db6bd76815e009f80ddc7ff518bbb89b575576831578c8f6c220e37344f6cec
@@ -14,10 +14,8 @@ module AudioAddict
14
14
  example "radio get track_history/channel/1"
15
15
  example "radio post tracks/1/vote/2/up"
16
16
 
17
- def run(args)
17
+ def run
18
18
  needs :network
19
- @args = args
20
-
21
19
  response = api.send(api_method, endpoint)
22
20
  puts response.to_yaml
23
21
  end
@@ -25,13 +23,13 @@ module AudioAddict
25
23
  private
26
24
 
27
25
  def api_method
28
- return :post if @args['post']
29
- return :delete if @args['delete']
26
+ return :post if args['post']
27
+ return :delete if args['delete']
30
28
  return :get
31
29
  end
32
30
 
33
31
  def endpoint
34
- @args['ENDPOINT']
32
+ args['ENDPOINT']
35
33
  end
36
34
 
37
35
  def api
@@ -17,7 +17,7 @@ module AudioAddict
17
17
  example "radio channels metal"
18
18
  example "radio channels metal -i"
19
19
 
20
- def run(args)
20
+ def run
21
21
  needs :network
22
22
 
23
23
  say "!undgrn!#{radio.name}\n"
@@ -29,13 +29,13 @@ module AudioAddict
29
29
  example "radio config del session_key"
30
30
  example "radio config get listen_key"
31
31
 
32
- def get_command(args)
32
+ def get_command
33
33
  key = args['KEY'].to_sym
34
34
  value = Config.properties[key]
35
35
  say value ? "!txtgrn!#{value}" : "!txtred!<Unset>"
36
36
  end
37
37
 
38
- def set_command(args)
38
+ def set_command
39
39
  key = args['KEY'].to_sym
40
40
  value = args['VALUE']
41
41
  Config.properties[key] = value
@@ -43,14 +43,14 @@ module AudioAddict
43
43
  say "!txtgrn!#{key}=#{value}"
44
44
  end
45
45
 
46
- def del_command(args)
46
+ def del_command
47
47
  key = args['KEY'].to_sym
48
48
  Config.delete key
49
49
  Config.save
50
50
  say "!txtgrn!Deleted"
51
51
  end
52
52
 
53
- def show_command(args)
53
+ def show_command
54
54
  say "!undpur!# #{Config.path}"
55
55
  if File.exist? Config.path
56
56
  puts File.read Config.path
@@ -59,12 +59,12 @@ module AudioAddict
59
59
  end
60
60
  end
61
61
 
62
- def edit_command(args)
62
+ def edit_command
63
63
  editor = ENV['EDITOR'] || 'vi'
64
64
  system "#{editor} #{Config.path}"
65
65
  end
66
66
 
67
- def guide_command(args)
67
+ def guide_command
68
68
  key_guide.each do |key, value|
69
69
  say "!txtgrn!#{key}"
70
70
  say word_wrap " #{value}"
@@ -6,7 +6,7 @@ module AudioAddict
6
6
  usage "radio history"
7
7
  usage "radio history --help"
8
8
 
9
- def run(args)
9
+ def run
10
10
  needs :network, :channel
11
11
  say "!undgrn!#{radio.name} > #{current_channel.name}"
12
12
  say ''
@@ -28,25 +28,25 @@ module AudioAddict
28
28
  example "radio log sort"
29
29
  example "radio log tree --save out.yml"
30
30
 
31
- def show_command(args)
31
+ def show_command
32
32
  needs :like_log
33
33
  query = args['SEARCH']
34
34
  puts query ? log.search(query) : log.data
35
35
  end
36
36
 
37
- def tail_command(args)
37
+ def tail_command
38
38
  needs :like_log
39
39
  lines = args['--lines'].to_i
40
40
  puts log.data[-lines..-1]
41
41
  end
42
42
 
43
- def sort_command(args)
43
+ def sort_command
44
44
  needs :like_log
45
45
  log.sort
46
46
  say "!txtgrn!Sorted"
47
47
  end
48
48
 
49
- def browse_command(args=nil)
49
+ def browse_command
50
50
  tree = log.tree
51
51
 
52
52
  say ""
@@ -61,7 +61,7 @@ module AudioAddict
61
61
  browse_command if prompt.yes?("Again?")
62
62
  end
63
63
 
64
- def tree_command(args)
64
+ def tree_command
65
65
  yaml = log.tree.to_yaml
66
66
  filename = args['--save']
67
67
 
@@ -8,7 +8,7 @@ module AudioAddict
8
8
  usage "radio login"
9
9
  usage "radio login --help"
10
10
 
11
- def run(args)
11
+ def run
12
12
  proceed = true
13
13
 
14
14
  if radio.api.logged_in?
@@ -8,7 +8,7 @@ module AudioAddict
8
8
  usage "radio now"
9
9
  usage "radio now --help"
10
10
 
11
- def run(args = nil)
11
+ def run
12
12
  needs :network, :channel
13
13
 
14
14
  say "!txtblu! Network !txtrst!: !txtgrn!#{radio.name}!txtrst! # #{radio.network}"
@@ -15,7 +15,7 @@ module AudioAddict
15
15
  example "radio playlist init MyRockMusic"
16
16
  example "radio playlist generate MyRockMusic"
17
17
 
18
- def init_command(args)
18
+ def init_command
19
19
  needs :network, :channel, :listen_key
20
20
 
21
21
  require_premium_account
@@ -28,16 +28,16 @@ module AudioAddict
28
28
  if proceed
29
29
  generate_config outfile
30
30
  say ""
31
- generate_command({ 'NAME' => name }) # we also generate the playlist
31
+ generate_command name
32
32
  end
33
33
  end
34
34
 
35
- def generate_command(args)
35
+ def generate_command(name=nil)
36
36
  needs :network, :channel, :listen_key
37
37
 
38
38
  require_premium_account
39
39
 
40
- name = args['NAME']
40
+ name ||= args['NAME']
41
41
 
42
42
  infile = "#{name}.yml"
43
43
  outfile = "#{name}.pls"
@@ -18,7 +18,7 @@ module AudioAddict
18
18
  example "radio set metal rockradio"
19
19
  example "radio set - rockradio"
20
20
 
21
- def run(args)
21
+ def run
22
22
  channel = args['CHANNEL']
23
23
  network = args['NETWORK']
24
24
 
@@ -33,7 +33,7 @@ module AudioAddict
33
33
  }
34
34
  end
35
35
 
36
- def run(args)
36
+ def run
37
37
  keys.each do |key, info|
38
38
  value = info[:value] || Config.properties[key]
39
39
 
@@ -17,9 +17,8 @@ module AudioAddict
17
17
  example "radio vote --all --past"
18
18
  example "radio vote -ap"
19
19
 
20
- def run(args)
20
+ def run
21
21
  needs :network, :channel, :session_key
22
- @args = args
23
22
  vote_mode == :now ? vote_now : vote_past
24
23
  end
25
24
 
@@ -34,7 +33,7 @@ module AudioAddict
34
33
  end
35
34
 
36
35
  def vote_now
37
- NowCmd.new.run
36
+ NowCmd.new(args).run
38
37
  puts ""
39
38
  vote = get_user_vote
40
39
  send_vote vote unless vote == :cancel
@@ -76,13 +75,13 @@ module AudioAddict
76
75
  end
77
76
 
78
77
  def vote_style
79
- @args['--all'] ? :menu : :simple
78
+ args['--all'] ? :menu : :simple
80
79
  end
81
80
 
82
81
  def vote_mode
83
- @args['--past'] ? :past : :now
82
+ args['--past'] ? :past : :now
84
83
  end
85
84
 
86
85
  end
87
86
  end
88
- end
87
+ end
@@ -17,9 +17,8 @@ module AudioAddict
17
17
  properties['track_id']
18
18
  end
19
19
 
20
- # This is only here due to the global Runfile method with the same name
21
20
  def title
22
- properties['title']
21
+ properties['title'].strip
23
22
  end
24
23
  end
25
24
  end
@@ -1,3 +1,3 @@
1
1
  module AudioAddict
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: audio_addict
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-12 00:00:00.000000000 Z
11
+ date: 2018-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colsole
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '0.5'
61
+ version: '0.6'
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '0.5'
68
+ version: '0.6'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: requires
71
71
  requirement: !ruby/object:Gem::Requirement