dacpclient 0.2.2 → 0.2.3

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: 47b6989afaa41c759ab24b568018a41419d1b1d8
4
- data.tar.gz: 5f336fce8d68d1efc0321e1b8d82dc251eecfb7e
3
+ metadata.gz: 20b7236a5ab83767fe89d6cf209479bfcf82a74f
4
+ data.tar.gz: 3a0efd4010272d54cf56881037302194488529d3
5
5
  SHA512:
6
- metadata.gz: 09fc95a3af1ca384a49fd3839247385f9620dc32f87d1c9ffa345b48c2287ee385b31d5761bc50ca0aad3fb4d28b5e47161ff3d542213f7f6b9e2fbef610fcd6
7
- data.tar.gz: 1c8773f2ba867fb9395064a4ba0a2537f0004bdcbc22c82d0c3f1d6f51449ebd9fa64376a3cc84a56599020cc2e7486136d3ab2006b6ca1e7d41926143a19b4f
6
+ metadata.gz: b4fd7451d4e3a7fe559ba64656388c16ff9cc84aa67a75ba69951adf55ed448b75182d9f0ccfefbe9e068b7ba020b697ff5b123a3f0feff765df8c92bae394d4
7
+ data.tar.gz: addcdeb4add40740e95c31631cfea95c0d93b0705db10b05bb581f29e35f882521b5e9a102979480466ecf274e1310ba94b0713efcc136588ef3b85405361ac5
data/Gemfile CHANGED
@@ -1,4 +1,3 @@
1
- # ruby '2.0.0'
2
1
  gemspec
3
2
 
4
3
  source 'https://rubygems.org'
data/bin/dacpclient CHANGED
@@ -15,7 +15,7 @@ class CLIClient
15
15
 
16
16
  @client = DACPClient::Client.new(@config['client_name'], 'localhost', 3689)
17
17
  if @config['guid'].nil? || @config['guid'] !~ /^[a-f0-9]{16}$/
18
- @config['guid'] = @client.get_guid
18
+ @config['guid'] = @client.guid
19
19
  save_config
20
20
  end
21
21
  @client.guid = @config['guid']
data/dacpclient.gemspec CHANGED
@@ -19,15 +19,15 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
  spec.extra_rdoc_files = ['README.md', 'LICENSE']
21
21
 
22
+ spec.add_runtime_dependency 'faraday', '~> 0.9.0'
22
23
  spec.add_runtime_dependency 'dnssd', '~> 2.0'
23
- spec.add_runtime_dependency 'faraday', '~> 0.8.8'
24
24
  spec.add_runtime_dependency 'plist', '~> 3.1.0'
25
25
 
26
26
  spec.add_development_dependency 'yard'
27
27
  spec.add_development_dependency 'redcarpet'
28
28
  spec.add_development_dependency 'github-markup'
29
29
  spec.add_development_dependency 'minitest', '~> 5.2.0'
30
- spec.add_development_dependency 'rubocop', '~> 0.15.0'
30
+ spec.add_development_dependency 'rubocop', '~> 0.17.0'
31
31
  spec.add_development_dependency 'rake'
32
32
 
33
33
  spec.required_ruby_version = '>= 2.0.0'
@@ -51,7 +51,7 @@ module DACPClient
51
51
  @hsgid = response['sgid']
52
52
  end
53
53
 
54
- def get_guid
54
+ def guid
55
55
  return @guid unless @guid.nil?
56
56
  d = Digest::SHA2.hexdigest(@name)
57
57
  d[0..15]
@@ -70,7 +70,7 @@ module DACPClient
70
70
  def login
71
71
  response = nil
72
72
  if @hsgid.nil?
73
- pairing_guid = '0x' + get_guid
73
+ pairing_guid = '0x' + guid
74
74
  response = do_action(:login, 'pairing-guid' => pairing_guid)
75
75
  else
76
76
  response = do_action(:login, 'hasFP' => '1')
@@ -118,12 +118,11 @@ module DACPClient
118
118
  do_action(:setproperty, 'dacp.playingtime' => ms)
119
119
  end
120
120
 
121
- def get_position
121
+ def position
122
122
  response = do_action(:getproperty, properties: 'dacp.playingtime')
123
123
  response['cast'] - response['cant']
124
124
  end
125
125
 
126
- alias_method :position, :get_position
127
126
  alias_method :position=, :seek
128
127
 
129
128
  def status(wait = false)
@@ -149,37 +148,34 @@ module DACPClient
149
148
 
150
149
  alias_method :previous, :prev
151
150
 
152
- def get_volume
151
+ def volume
153
152
  response = do_action(:getproperty, properties: 'dmcp.volume')
154
153
  response[:cmvo]
155
154
  end
156
155
 
157
- def set_volume(volume)
156
+ def volume=(volume)
158
157
  do_action(:setproperty, 'dmcp.volume' => volume)
159
158
  end
160
159
 
161
- alias_method :volume, :get_volume
162
- alias_method :volume=, :set_volume
163
-
164
- def get_repeat
160
+ def repeat
165
161
  response = do_action(:getproperty, properties: 'dacp.repeatstate')
166
162
  response[:carp]
167
163
  end
168
164
 
169
- def set_repeat(volume)
170
- do_action(:setproperty, 'dmcp.volume' => volume)
165
+ def repeat=(repeatstate)
166
+ do_action(:setproperty, 'dacp.repeatstate' => repeatstate)
171
167
  end
172
168
 
173
- def get_shuffle
169
+ def shuffle
174
170
  response = do_action(:getproperty, properties: 'dmcp.shufflestate')
175
171
  response[:cash]
176
172
  end
177
173
 
178
- def set_shuffle(volume)
179
- do_action(:setproperty, 'dmcp.volume' => volume)
174
+ def shuffle=(shufflestate)
175
+ do_action(:setproperty, 'dmcp.shufflestate' => shufflestate)
180
176
  end
181
177
 
182
- def getspeakers
178
+ def speakers
183
179
  do_action(:getspeakers)
184
180
  end
185
181
 
@@ -1,4 +1,4 @@
1
1
  # The DACPClient module
2
2
  module DACPClient
3
- VERSION = '0.2.2'
3
+ VERSION = '0.2.3'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dacpclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jurriaan Pruis
@@ -11,33 +11,33 @@ cert_chain: []
11
11
  date: 2014-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: dnssd
14
+ name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2.0'
19
+ version: 0.9.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2.0'
26
+ version: 0.9.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: faraday
28
+ name: dnssd
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.8.8
33
+ version: '2.0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.8.8
40
+ version: '2.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: plist
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: 0.15.0
117
+ version: 0.17.0
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: 0.15.0
124
+ version: 0.17.0
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: rake
127
127
  requirement: !ruby/object:Gem::Requirement