Module: Arli::Library
- Included in:
- ArliFile, Commands::Install
- Defined in:
- lib/arli/library.rb,
lib/arli/library/installer.rb,
lib/arli/library/multi_version.rb,
lib/arli/library/single_version.rb
Defined Under Namespace
Classes: Installer, MultiVersion, SingleVersion
Instance Method Summary
collapse
Instance Method Details
#library_model(lib) ⇒ Object
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/arli/library.rb', line 8
def library_model(lib)
return lib if lib.is_a?(::Arduino::Library::Model)
::Arduino::Library::Model.from(lib).tap do |model|
if model.nil?
lib_output = (lib && lib['name']) ? lib['name'] : lib.to_s
raise Arli::Errors::LibraryNotFound, 'Error: '.bold.red +
"Library #{lib_output.yellow} ".red + "was not found.\n\n".red +
%Q[ HINT: run #{"arli search 'name: /#{lib_output}/'".green}\n] +
%Q[ to find the exact name of the library you are trying\n] +
%Q[ to install. Alternatively, provide a url: field.\n]
end
end
end
|