arli 0.6.2 → 0.7.0

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: 1457403161e523852f76082f9c5549abcaeb4277
4
- data.tar.gz: 9835a1952e3a3baf19ff0e795d71851b9c4d7bab
3
+ metadata.gz: c24d0e256205e016bc76654f761283e2f7bf2b21
4
+ data.tar.gz: 67cf5af188033eee75bdcdb430623464c36f40a4
5
5
  SHA512:
6
- metadata.gz: d0478e06f8baf8e6a71591128d917947d3017d118c3ff231edd0c0d63e1167134912c8cc950409c6dcdc0803bd1a8525bd932ab64d60285c1f708eea68cf06e0
7
- data.tar.gz: 3a1498015f130059065f2c21fb3fb11eb12316579a082d73d3c6ea2144780497909b6b801ae16256093f9a66f7efb4f82ff9a4107efca54a56411bf0d53d4269
6
+ metadata.gz: 7d34e117d98f741237f0de0a15c1e0ebae3251d85a614c7e70179e123fe0c66ac8d72523fece8a9f0d9f189fdb67ea163e32efea1260390f68b675337ce663c6
7
+ data.tar.gz: fddbd83b57fbbc4fe57147fd9209ea9ed9ebad1141c6a3327643b48b1292fdd454e162504e99da8448012e73bbcbac77b55a08ab58b6ec2962ec436a80be2fe7
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --format progress
2
2
  --color
3
+ --order random
data/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  [![Maintainability](https://api.codeclimate.com/v1/badges/0812671b4bec27ba89b9/maintainability)](https://codeclimate.com/github/kigster/arli/maintainability)
4
4
  [![Test Coverage](https://api.codeclimate.com/v1/badges/0812671b4bec27ba89b9/test_coverage)](https://codeclimate.com/github/kigster/arli/test_coverage)
5
5
 
6
+ **NOTE: This software is currently in BETA. Bugs are possible, and reporting them is encouraged.**
7
+
6
8
  # Arli
7
9
 
8
10
  Arli is an awesomely simple and very easy to use Arduino Library Installer. It allows your Arduino projects to be portable by including a small text file called `Arlifile` that defines your project's Arduino library dependencies. Using either this file, or command line flags, Arli is able to search for libraries, install them locally to a custom location, and do it all consistently and reliably.
@@ -120,6 +122,7 @@ Here is the `arli install` command inside CMake-based project to build a [Wall C
120
122
  ---
121
123
  dependencies:
122
124
  - name: "Adafruit GFX Library"
125
+ version: '1.2.0'
123
126
  - name: "DS1307RTC"
124
127
  - name: "Adafruit LED Backpack Library"
125
128
  - name: "Adafruit Unified Sensor"
@@ -201,7 +204,7 @@ The search argument can also be a ruby-syntaxed expression, that (if you know ru
201
204
  You can also use regular expressions, and set maximum number of results printed by the `-m MAX` flag.
202
205
 
203
206
  ```bash
204
- ❯ arli search 'name: /adafruit/i'
207
+ ❯ arli search 'name: /adafruit/i' -m 0
205
208
  Adafruit ADS1X15 (1.0.0), by Adafruit
206
209
  Adafruit ADXL345 (1.0.0), by Adafruit
207
210
  Adafruit AM2315 (1.0.0), by Adafruit
@@ -51,7 +51,20 @@ module Arli
51
51
  end
52
52
 
53
53
  def make_lib(lib)
54
- ::Arli::Library.new(::Arduino::Library::Model.from(lib))
54
+ ::Arli::Library.new(library_model(lib))
55
+ end
56
+
57
+ def library_model(lib)
58
+ ::Arduino::Library::Model.from(lib).tap do |model|
59
+ if model.nil?
60
+ lib_output = (lib && lib['name']) ? lib['name'] : lib.inspect
61
+ raise Arli::Errors::LibraryNotFound, 'Error: '.bold.red +
62
+ "Library #{lib_output.yellow} ".red + "was not found.\n\n".red +
63
+ %Q[ HINT: run #{"arli search 'name: /#{lib_output}/'".green}\n] +
64
+ %Q[ to find the exact name of the library you are trying\n] +
65
+ %Q[ to install. Alternatively, provide a url: field.\n]
66
+ end
67
+ end
55
68
  end
56
69
  end
57
70
  end
data/lib/arli/errors.rb CHANGED
@@ -12,6 +12,8 @@ module Arli
12
12
 
13
13
  class LibraryAlreadyExists < ArliError; end
14
14
 
15
+ class LibraryNotFound < ArliError; end
16
+
15
17
  class InstallerError < ArliError; end
16
18
 
17
19
  class ZipFileError < InstallerError; end
data/lib/arli/library.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require_relative 'installer'
2
+ require_relative 'errors'
2
3
 
3
4
  module Arli
4
5
  class Library
data/lib/arli/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Arli
2
- VERSION = '0.6.2'.freeze
2
+ VERSION = '0.7.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Gredeskoul
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-28 00:00:00.000000000 Z
11
+ date: 2017-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: arduino-library