isaac_toolbelt 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isaac_toolbelt.rb +18 -12
- data/lib/isaac_toolbelt/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01eeb3a9a2a8173a9059f47bd45c50d569f050c3
|
4
|
+
data.tar.gz: 6b66188c4c5d9c6f2c0ac090f91545435c5dae6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2d8cedc9bf9bc326c196088e73e70d2018f987b5913b450802592d72feb9669e556e989bf438d750b806356ce638cd031105fa8c24d8b53d9bb0755daef63c5
|
7
|
+
data.tar.gz: be3a23b24ed7bc56b8cd6e2f816d49f2f95863b200df06f4fa67cfd0650a448447bda83fedfd3dffa0d940535c2071e65eede1216f5c43c17da2f12d747652be
|
data/lib/isaac_toolbelt.rb
CHANGED
@@ -436,6 +436,7 @@ module IsaacToolbelt
|
|
436
436
|
end
|
437
437
|
|
438
438
|
def dfu_download(usb_vid, usb_pid, alt_name, file_path, do_reboot=false)
|
439
|
+
retry_count = 0
|
439
440
|
loop do
|
440
441
|
params = %W(dfu-util -v -d #{usb_vid}:#{usb_pid} --alt #{alt_name} -D #{file_path})
|
441
442
|
params << '-R' if do_reboot
|
@@ -446,8 +447,13 @@ module IsaacToolbelt
|
|
446
447
|
puts "dfu-util exit with: #{status.to_i}"
|
447
448
|
if status.to_i == 0
|
448
449
|
break
|
450
|
+
elsif retry_count >= 10
|
451
|
+
STDERR.puts 'USB Error!!!'
|
452
|
+
STDERR.puts 'Please reboot your workstation, then try again.'
|
453
|
+
exit 1
|
449
454
|
else
|
450
|
-
|
455
|
+
retry_count += 1
|
456
|
+
sleep 0.1
|
451
457
|
end
|
452
458
|
end
|
453
459
|
end
|
@@ -479,21 +485,21 @@ module IsaacToolbelt
|
|
479
485
|
`dfu-util -l -d #{usb_vid}:#{usb_pid}`.split("\n").select{|l0|
|
480
486
|
l0 =~ /Found/
|
481
487
|
}.map {|str|
|
482
|
-
ver = str.slice(/ver=.+?,/).chop.split('=')[1]
|
483
|
-
devnum = str.slice(/devnum=.+?,/).chop.split('=')[1]
|
484
|
-
cfg = str.slice(/cfg=.+?,/).chop.split('=')[1]
|
485
|
-
intf = str.slice(/intf=.+?,/).chop.split('=')[1]
|
488
|
+
#ver = str.slice(/ver=.+?,/).chop.split('=')[1]
|
489
|
+
#devnum = str.slice(/devnum=.+?,/).chop.split('=')[1]
|
490
|
+
#cfg = str.slice(/cfg=.+?,/).chop.split('=')[1]
|
491
|
+
#intf = str.slice(/intf=.+?,/).chop.split('=')[1]
|
486
492
|
alt = str.slice(/alt=.+?,/).chop.split('=')[1]
|
487
493
|
name = str.slice(/name=.+?,/).gsub('"', '').chop.split('=')[1]
|
488
|
-
serial = str.slice(/serial.+/).gsub('"', '').split('=')[1]
|
494
|
+
#serial = str.slice(/serial.+/).gsub('"', '').split('=')[1]
|
489
495
|
{
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
496
|
+
#:ver => ver,
|
497
|
+
#:devnum => devnum,
|
498
|
+
#:cfg => cfg,
|
499
|
+
#:intf => intf,
|
494
500
|
:alt => alt,
|
495
|
-
:name => name
|
496
|
-
|
501
|
+
:name => name
|
502
|
+
#:serial => serial
|
497
503
|
}
|
498
504
|
}
|
499
505
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isaac_toolbelt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- xshell inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|