dacpclient 0.2.9 → 0.2.10

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
  SHA1:
3
- metadata.gz: 14943f6c9ee6b10cc14575ab008cea5ba669bef0
4
- data.tar.gz: 0d2df609607cf2f3f4f4fe949e033ea137b809fe
3
+ metadata.gz: 98de2006393ea258320fc611a9d344d83d0feb58
4
+ data.tar.gz: 841fb499caf9bc84be3c8475c178af7a4537ad80
5
5
  SHA512:
6
- metadata.gz: 282d58e2556fa3f6c605ef6fe73348f23795c3113d509066f995e1efdb2c8ded311839bc7801881852b5dc3c0d7e4cd684b4557b596600aaf94bc5803cdd70ef
7
- data.tar.gz: e5d45be377ad35efdd2a4551cec7bf5fe582bd435f6d383a02dee5bd70e9869f9fee4f78ea84a1970dce1820626b271113117ec018bdb4750452bdfc6ecce617
6
+ metadata.gz: 63854bcdbf6ee860bccf7844c8b054d5ef9e948cbdad86b843c9028b613a236b9645210f149ea073f028fc48cba1d2a9af1fb1e3328b4af283f70cf46c8cf5c2
7
+ data.tar.gz: ab1071e5f4518088e9bbc52f90f1f654826c23f0dbf846f808c732b3cf6c268419e4a3a02daa6d636f13aa8ab25dc2f379f45d90763202885100b0fbfc2d5e6e
data/bin/dacpclient CHANGED
@@ -87,24 +87,28 @@ class CLIClient < Thor
87
87
  def play
88
88
  login
89
89
  @client.play
90
+ show_status
90
91
  end
91
92
 
92
93
  desc :pause, 'Pause Playing'
93
94
  def pause
94
95
  login
95
96
  @client.pause
97
+ show_status
96
98
  end
97
99
 
98
100
  desc :playpause, 'Toggle Playing'
99
101
  def playpause
100
102
  login
101
103
  @client.playpause
104
+ show_status
102
105
  end
103
106
 
104
107
  desc :next, 'Go to next item'
105
108
  def next
106
109
  login
107
110
  @client.next
111
+ show_status
108
112
  end
109
113
 
110
114
  desc :prev, 'Go to previous item'
@@ -112,6 +116,7 @@ class CLIClient < Thor
112
116
  def prev
113
117
  login
114
118
  @client.prev
119
+ show_status
115
120
  end
116
121
 
117
122
  desc :playlists, 'Show the playlists'
@@ -141,12 +146,14 @@ class CLIClient < Thor
141
146
  puts "#{title} - #{artist} (#{album}) [#{format_time(item.song_time)}]"
142
147
  end
143
148
  puts
149
+ show_status
144
150
  end
145
151
 
146
152
  desc :stop, 'Stop playing'
147
153
  def stop
148
154
  login
149
155
  @client.stop
156
+ show_status
150
157
  end
151
158
 
152
159
  # rubocop:disable Debugger
@@ -166,7 +173,7 @@ class CLIClient < Thor
166
173
  def version
167
174
  puts "DACPClient v#{DACPClient::VERSION}"
168
175
  puts "using DMAPParser v#{DMAPParser::VERSION}"
169
- print "DACPClient and DMAPParser are Copyright (c) "
176
+ print 'DACPClient and DMAPParser are Copyright (c) '
170
177
  puts "#{Time.now.year} Jurriaan Pruis"
171
178
  end
172
179
 
@@ -227,9 +234,9 @@ class CLIClient < Thor
227
234
  minutes, seconds = seconds.divmod(60)
228
235
  hours, minutes = minutes.divmod(60)
229
236
  if hours == 0
230
- sprintf('%02d:%02d', minutes, seconds)
237
+ format('%02d:%02d', minutes, seconds)
231
238
  else
232
- sprintf('%02d:%02d:%02d', hours, minutes, seconds)
239
+ format('%02d:%02d:%02d', hours, minutes, seconds)
233
240
  end
234
241
  end
235
242
 
data/dacpclient.gemspec CHANGED
@@ -23,13 +23,13 @@ Gem::Specification.new do |spec|
23
23
  spec.add_runtime_dependency 'dnssd', '~> 2.0'
24
24
  spec.add_runtime_dependency 'plist', '~> 3.1.0'
25
25
  spec.add_runtime_dependency 'dmapparser', '~> 0.0.2'
26
- spec.add_runtime_dependency 'thor', '~> 0.18.1'
26
+ spec.add_runtime_dependency 'thor', '~> 0.19.1'
27
27
 
28
28
  spec.add_development_dependency 'yard'
29
29
  spec.add_development_dependency 'redcarpet'
30
30
  spec.add_development_dependency 'github-markup'
31
- spec.add_development_dependency 'minitest', '~> 5.2.0'
32
- spec.add_development_dependency 'rubocop', '~> 0.18.0'
31
+ spec.add_development_dependency 'minitest', '~> 5.3.1'
32
+ spec.add_development_dependency 'rubocop', '~> 0.19.1'
33
33
  spec.add_development_dependency 'rake'
34
34
 
35
35
  spec.required_ruby_version = '>= 2.0.0'
@@ -6,11 +6,11 @@ module DACPClient
6
6
  class Browser
7
7
  class Device < Struct.new(:host, :port, :text_records)
8
8
  def name
9
- text_records['Machine Name'] || text_records['CtlN']
9
+ text_records['Machine Name'] || text_records['CtlN']
10
10
  end
11
11
 
12
12
  def database_id
13
- text_records['Database ID'] || text_records['DbId']
13
+ text_records['Database ID'] || text_records['DbId']
14
14
  end
15
15
  end
16
16
 
@@ -270,7 +270,7 @@ module DACPClient
270
270
  action = '/ctrl-int/1' + action unless clean_url
271
271
  end
272
272
  params['hsgid'] = @hsgid unless @hsgid.nil?
273
-
273
+
274
274
  result = @client.get do |request|
275
275
  request.options.params_encoder = Faraday::FlatterParamsEncoder
276
276
  request.url action
@@ -26,7 +26,7 @@ module DACPClient
26
26
  @pairing_string = generate_pairing_string(@pair, @name, @device_type)
27
27
  @expected = PairingServer.generate_pin_challenge(@pair, @pin)
28
28
  @service = DNSSD.register!(@name, MDNS_TYPE, 'local', @port, text_record)
29
- @pairing_string
29
+
30
30
  PairInfo.new(DMAPParser::Parser.parse(@pairing_string))
31
31
  super
32
32
  join
@@ -51,7 +51,7 @@ module DACPClient
51
51
  device.host == peer_addr
52
52
  end
53
53
  if data =~ /pairingcode=#{@expected}/i && @peer
54
- client.print "HTTP/1.1 200 OK\n" +
54
+ client.print "HTTP/1.1 200 OK\n" \
55
55
  "Content-Length: #{@pairing_string.length}\n\n"
56
56
  client.print @pairing_string
57
57
  client.close
@@ -1,4 +1,4 @@
1
1
  # The DACPClient module
2
2
  module DACPClient
3
- VERSION = '0.2.9'
3
+ VERSION = '0.2.10'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dacpclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jurriaan Pruis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-02 00:00:00.000000000 Z
11
+ date: 2014-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.18.1
75
+ version: 0.19.1
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.18.1
82
+ version: 0.19.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: yard
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -128,28 +128,28 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 5.2.0
131
+ version: 5.3.1
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 5.2.0
138
+ version: 5.3.1
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: rubocop
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.18.0
145
+ version: 0.19.1
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.18.0
152
+ version: 0.19.1
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rake
155
155
  requirement: !ruby/object:Gem::Requirement