ligo 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,5 @@
1
+ .rbx
2
+ .ruby-version
3
+ .yardoc
1
4
  doc/
2
5
  pkg/
3
- .yardoc
@@ -1,3 +1,8 @@
1
+ ### 0.1.1 / 2013-04-13
2
+
3
+ * Fix a major issue due to bad refactoring (get_device should return to device)
4
+ * Upgrade dependencies
5
+
1
6
  ### 0.1.0 / 2012-12-24
2
7
 
3
8
  * Initial release
@@ -187,7 +187,7 @@
187
187
  same "printed page" as the copyright notice for easier
188
188
  identification within third-party archives.
189
189
 
190
- Copyright [yyyy] [name of copyright owner]
190
+ Copyright 2012, 2013 Renaud AUBIN
191
191
 
192
192
  Licensed under the Apache License, Version 2.0 (the "License");
193
193
  you may not use this file except in compliance with the License.
data/NOTICE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  The ligo project
3
- Copyright (C) 2012 Renaud AUBIN
3
+ Copyright (C) 2012, 2013 Renaud AUBIN
4
4
 
5
5
  This product includes software developed by
6
6
  Renaud AUBIN (http://blog.renaud.io/).
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  <!--- coding: utf-8; fill-column: 80 --->
2
2
  # ligō
3
3
 
4
+ [![Code Climate](https://codeclimate.com/github/nibua-r/ligo.png)](https://codeclimate.com/github/nibua-r/ligo)
5
+
4
6
  * [Homepage](https://github.com/nibua-r/ligo#readme)
5
7
  * [Issues](https://github.com/nibua-r/ligo/issues)
6
8
  * [Documentation](http://rubydoc.info/gems/ligo/frames)
@@ -71,25 +73,38 @@ is available for usage demonstration.
71
73
 
72
74
  ## Install
73
75
 
74
- ligō is currently under developement, as a consequence you'll need to live on the edge:
76
+ You may install ligō by using:
77
+
78
+ $ gem install ligo
79
+
80
+ Or, you can install it from the github repository:
75
81
 
76
82
  $ git clone https://github.com/nibua-r/ligo.git
77
83
  $ cd ligo
78
84
  $ rake install
79
85
 
80
- As soon as the ligō gem is released, you shall install by using:
81
-
82
- $ gem install ligo
83
86
 
84
87
  ## Pending tasks
85
88
 
86
89
  * Write the specs and automate testing!
87
- * Provide an Android demo application
88
- * Improve the documentation
89
- * Release and push the gem to rubygems.org
90
+ * <s>Provide an Android demo application</s> → See
91
+ [sample LigoTextDemo Android application](https://github.com/nibua-r/LigoTextDemo),
92
+ more to come soon…
93
+ * Improve the documentation → in progress, a first pass has been made…
94
+ * <s>Release and push the gem to rubygems.org</s>
95
+ * Finalize and publish a [celluloid](https://github.com/celluloid/celluloid)-based write-back usage
96
+ sample (already working with the
97
+ [sample LigoTextDemo Android application](https://github.com/nibua-r/LigoTextDemo) and the
98
+ [libusb 0.3.0 gem](https://github.com/larskanis/libusb) async and polling APIs)
99
+ * Create a wiki with FAQ, supported devices listing, UMS/accessory interactions, etc.
100
+
101
+ ## Contributing to ligō
102
+
103
+ * Follow the usual fork/branch/PR workflow to send changes, if I like them I'll merge them
104
+ * Help me to create a supported device listing
90
105
 
91
106
  ## Copyright
92
107
 
93
- Copyright (c) 2012 Renaud AUBIN
108
+ Copyright (c) 2012, 2013 Renaud AUBIN
94
109
 
95
110
  See {file:LICENSE.txt} for details.
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8; fill-column: 80 -*-
2
2
  #
3
- # Copyright (c) 2012 Renaud AUBIN
3
+ # Copyright (c) 2012, 2013 Renaud AUBIN
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8; fill-column: 80 -*-
2
2
  #
3
- # Copyright (c) 2012 Renaud AUBIN
3
+ # Copyright (c) 2012, 2013 Renaud AUBIN
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,5 +1,6 @@
1
+ # -*- coding: utf-8; fill-column: 80 -*-
1
2
  #
2
- # Copyright (c) 2012 Renaud AUBIN
3
+ # Copyright (c) 2012, 2013 Renaud AUBIN
3
4
  #
4
5
  # Licensed under the Apache License, Version 2.0 (the "License");
5
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8; fill-column: 80 -*-
2
2
  #
3
- # Copyright (c) 2012 Renaud AUBIN
3
+ # Copyright (c) 2012, 2013 Renaud AUBIN
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8; fill-column: 80 -*-
2
2
  #
3
- # Copyright (c) 2012 Renaud AUBIN
3
+ # Copyright (c) 2012, 2013 Renaud AUBIN
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -201,9 +201,7 @@ module Ligo
201
201
  logger.debug 'set_configuration'
202
202
  res = nil
203
203
  sn = self.serial_number
204
- device = @context.devices(idVendor: GOOGLE_VID).collect do |d|
205
- d.serial_number == sn ? d : nil
206
- end.compact.first
204
+ device = get_device(sn)
207
205
 
208
206
  begin
209
207
  device.open_interface(0) do |handle|
@@ -303,15 +301,24 @@ module Ligo
303
301
  end
304
302
  private :send_start
305
303
 
304
+ # Retrieves an AOAP device by its serial number
305
+ # @api private
306
+ # @param [String] sn
307
+ # The serial number of the device to be found.
308
+ # @return [LIBUSB::Device] the device matching the given serial number.
309
+ def get_device(sn)
310
+ device = @context.devices(idVendor: GOOGLE_VID).collect do |d|
311
+ d.serial_number == sn ? d : nil
312
+ end.compact.first
313
+ end
314
+
306
315
  # @api private
307
316
  # @return [true, false] true for success, false otherwise.
308
317
  def wait_and_retrieve_by_serial(sn)
309
318
  sleep REENUMERATION_DELAY
310
319
  # The device should now reappear on the usb bus with the Google vendor id.
311
320
  # We retrieve it by using its serial number.
312
- device = @context.devices(idVendor: GOOGLE_VID).collect do |d|
313
- d.serial_number == sn ? d : nil
314
- end.compact.first
321
+ device = get_device(sn)
315
322
 
316
323
  if device
317
324
  # Retrieve new pointers (check if the old ones should be dereferenced)
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8; fill-column: 80 -*-
2
2
  #
3
- # Copyright (c) 2012 Renaud AUBIN
3
+ # Copyright (c) 2012, 2013 Renaud AUBIN
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8; fill-column: 80 -*-
2
2
  #
3
- # Copyright (c) 2012 Renaud AUBIN
3
+ # Copyright (c) 2012, 2013 Renaud AUBIN
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -17,5 +17,5 @@
17
17
 
18
18
  module Ligo
19
19
  # ligō version
20
- VERSION = "0.1.0"
20
+ VERSION = "0.1.1"
21
21
  end
@@ -19,11 +19,11 @@ Gem::Specification.new do |gem|
19
19
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
20
20
  gem.require_paths = ['lib']
21
21
 
22
- gem.add_dependency 'libusb', '~> 0.2.2'
22
+ gem.add_dependency 'libusb', '>= 0.3.4'
23
23
 
24
- gem.add_development_dependency 'rspec', '~> 2.4'
25
- gem.add_development_dependency 'rubygems-tasks', '~> 0.2'
26
- gem.add_development_dependency 'yard', '~> 0.8'
27
- gem.add_development_dependency 'yardstick', '~> 0.8.0'
28
- gem.add_development_dependency 'pry', '~> 0.9.10'
24
+ gem.add_development_dependency 'rspec', '~> 2.13'
25
+ gem.add_development_dependency 'rubygems-tasks', '~> 0.2.4'
26
+ gem.add_development_dependency 'yard', '~> 0.8.5.2'
27
+ gem.add_development_dependency 'yardstick', '~> 0.9.5'
28
+ gem.add_development_dependency 'pry', '~> 0.9.12'
29
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ligo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,24 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-24 00:00:00.000000000 Z
12
+ date: 2013-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: libusb
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
- version: 0.2.2
21
+ version: 0.3.4
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ~>
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.2.2
29
+ version: 0.3.4
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rspec
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ~>
36
36
  - !ruby/object:Gem::Version
37
- version: '2.4'
37
+ version: '2.13'
38
38
  type: :development
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
- version: '2.4'
45
+ version: '2.13'
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: rubygems-tasks
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: '0.2'
53
+ version: 0.2.4
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '0.2'
61
+ version: 0.2.4
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: yard
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -66,7 +66,7 @@ dependencies:
66
66
  requirements:
67
67
  - - ~>
68
68
  - !ruby/object:Gem::Version
69
- version: '0.8'
69
+ version: 0.8.5.2
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
@@ -74,7 +74,7 @@ dependencies:
74
74
  requirements:
75
75
  - - ~>
76
76
  - !ruby/object:Gem::Version
77
- version: '0.8'
77
+ version: 0.8.5.2
78
78
  - !ruby/object:Gem::Dependency
79
79
  name: yardstick
80
80
  requirement: !ruby/object:Gem::Requirement
@@ -82,7 +82,7 @@ dependencies:
82
82
  requirements:
83
83
  - - ~>
84
84
  - !ruby/object:Gem::Version
85
- version: 0.8.0
85
+ version: 0.9.5
86
86
  type: :development
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
@@ -90,7 +90,7 @@ dependencies:
90
90
  requirements:
91
91
  - - ~>
92
92
  - !ruby/object:Gem::Version
93
- version: 0.8.0
93
+ version: 0.9.5
94
94
  - !ruby/object:Gem::Dependency
95
95
  name: pry
96
96
  requirement: !ruby/object:Gem::Requirement
@@ -98,7 +98,7 @@ dependencies:
98
98
  requirements:
99
99
  - - ~>
100
100
  - !ruby/object:Gem::Version
101
- version: 0.9.10
101
+ version: 0.9.12
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,7 +106,7 @@ dependencies:
106
106
  requirements:
107
107
  - - ~>
108
108
  - !ruby/object:Gem::Version
109
- version: 0.9.10
109
+ version: 0.9.12
110
110
  description: ! 'Ligo: virtual accessories for Android'
111
111
  email: root@renaud.io
112
112
  executables: