littlewire 0.9.9 → 0.9.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/littlewire.rb +14 -11
- data/lib/littlewire/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faff763dc04f2ffe58f2822cf20432ef26d3a345
|
4
|
+
data.tar.gz: 1a2416192c3d6a0bd2edc981d9609120dbec324a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5463faeef169647d0b1afd5b01f55678bb2df76b0c0c60daf79e69beffbf4f7834152010f88c9512a934b973e3e5b864405f9f85286ba97b5393e22c69ff82a4
|
7
|
+
data.tar.gz: 055e35724c43efcb91b678cfc0238f4d48e6a4e6d2f765db4069283d02c7a5997322e1e2552ea7688163250b736f312c2961b4dba46fc8627c57a00dd29ef63b
|
data/bin/littlewire.rb
CHANGED
@@ -6,7 +6,8 @@ require 'littlewire/gadgets/micronucleus'
|
|
6
6
|
|
7
7
|
class LittleWireUtility < Thor
|
8
8
|
# for ruby 1.9 compatibility, we use this instead of ruby 2.0 __dir__
|
9
|
-
Directory = defined?(__dir__) ? __dir__ : File.pathname(__FILE__)
|
9
|
+
#Directory = defined?(__dir__) ? __dir__ : File.pathname(__FILE__)
|
10
|
+
Directory = File.dirname(__FILE__)
|
10
11
|
|
11
12
|
desc "install [version]", "Install a specific firmware on to the littlewire device"
|
12
13
|
def install version = 'latest'
|
@@ -55,17 +56,19 @@ class LittleWireUtility < Thor
|
|
55
56
|
puts "Library Version: #{LittleWire.version}"
|
56
57
|
|
57
58
|
wire = LittleWire.connect
|
58
|
-
|
59
|
+
if wire
|
60
|
+
puts "Device Firmware: #{wire.version}"
|
59
61
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
62
|
+
latest_path = File.join(Directory, "..", "firmware", "#{LittleWire::SupportedVersions.first}.hex")
|
63
|
+
if LittleWire::SupportedVersions.index(wire.version) != 0 and File.exists? latest_path
|
64
|
+
puts "An updated firmware is available, version #{LittleWire::SupportedVersions.first}"
|
65
|
+
puts "To update, run:"
|
66
|
+
puts " littlewire.rb install #{LittleWire::SupportedVersions.first}"
|
67
|
+
puts ""
|
68
|
+
puts "If you bought your LittleWire as a kit from Seeed Studios, you may need to first"
|
69
|
+
puts "install the Micronucleus bootloader as described on the littlewire.cc website."
|
70
|
+
puts ""
|
71
|
+
end
|
69
72
|
end
|
70
73
|
end
|
71
74
|
|
data/lib/littlewire/version.rb
CHANGED