arli 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/arli/actions/action.rb +6 -3
- data/lib/arli/actions/move_to_library_path.rb +6 -1
- data/lib/arli/commands/install.rb +16 -8
- data/lib/arli/helpers/inherited.rb +1 -0
- data/lib/arli/library.rb +1 -1
- data/lib/arli/library/single_version.rb +3 -1
- data/lib/arli/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5cbff710fa5c642b1c785d3e5f57acd716383c27a5638ce1164ac4539c655706
|
4
|
+
data.tar.gz: 36918da039ee3f764296e3d6073af80a89d39690199ef6e80b4a15d8ed310929
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b73273990d8bd70ad20f1925068060bb486b74535a75f69c42ab01789502cefb555255745d6c12a805faf7778ab6851e6c68686517e2ed7b8db15738cf41af9
|
7
|
+
data.tar.gz: 89f52802678e11a45f2f2a6424f0aa08d4e2fde5bdcdfaf7edc8230e65fd1d0c6c75d93bc702ddc748cc956fcae710f8e0170f29d74a8ea150c48d153513c8fb
|
data/lib/arli/actions/action.rb
CHANGED
@@ -13,9 +13,12 @@ module Arli
|
|
13
13
|
extend Forwardable
|
14
14
|
def_delegators :@library,
|
15
15
|
:exists?,
|
16
|
-
:path,
|
17
|
-
:
|
18
|
-
:
|
16
|
+
:path,
|
17
|
+
:temp_path,
|
18
|
+
:dir,
|
19
|
+
:temp_dir,
|
20
|
+
:libraries_home,
|
21
|
+
:folder
|
19
22
|
|
20
23
|
class << self
|
21
24
|
def inherited(base)
|
@@ -15,7 +15,12 @@ module Arli
|
|
15
15
|
if Dir.exist?(temp_path) && !Dir.exist?(path)
|
16
16
|
FileUtils.mkdir_p(File.dirname(path))
|
17
17
|
___ "current: #{Dir.pwd.yellow}\ntemp_path: #{temp_path.yellow}\nlibrary_path: #{path.yellow}\n" if debug?
|
18
|
-
|
18
|
+
if folder && Dir.exist?("#{temp_path}/#{folder}")
|
19
|
+
mv("#{temp_path}/#{folder}", path)
|
20
|
+
FileUtils.rm_rf(temp_path)
|
21
|
+
else
|
22
|
+
mv(temp_path, path)
|
23
|
+
end
|
19
24
|
elsif Dir.exist?(path)
|
20
25
|
raise ::Arli::Errors::InstallerError,
|
21
26
|
"Directory #{path} was not expected to still be there!"
|
@@ -12,6 +12,7 @@ module Arli
|
|
12
12
|
module Commands
|
13
13
|
class Install < Base
|
14
14
|
require 'arduino/library/include'
|
15
|
+
include Arduino::Library::InstanceMethods
|
15
16
|
|
16
17
|
attr_accessor :library,
|
17
18
|
:arlifile,
|
@@ -47,22 +48,24 @@ module Arli
|
|
47
48
|
def identify_library(arg)
|
48
49
|
results = if arg =~ %r[https?://]i
|
49
50
|
self.install_method = :url
|
50
|
-
|
51
|
-
|
51
|
+
result = search url: /^#{arg}$/i
|
52
|
+
|
53
|
+
if result.empty?
|
52
54
|
self.install_method = :website
|
53
|
-
|
55
|
+
result = search(website: /^#{arg}$/i)
|
54
56
|
end
|
55
|
-
|
57
|
+
|
58
|
+
if result.empty?
|
56
59
|
self.install_method = :custom
|
57
|
-
|
60
|
+
result = [Arduino::Library::Model.from_hash(url: arg, name: File.basename(arg))]
|
58
61
|
end
|
59
|
-
|
62
|
+
result
|
60
63
|
elsif File.exist?(arg) || arg =~ /\.zip$/
|
61
64
|
self.install_method = :archiveFileName
|
62
|
-
search
|
65
|
+
search archiveFileName: "#{File.basename(arg)}"
|
63
66
|
else
|
64
67
|
self.install_method = :name
|
65
|
-
search
|
68
|
+
search name: /^#{arg}$/
|
66
69
|
end
|
67
70
|
|
68
71
|
validate_search(arg, results)
|
@@ -77,6 +80,11 @@ module Arli
|
|
77
80
|
#
|
78
81
|
end
|
79
82
|
|
83
|
+
def search(**opts)
|
84
|
+
# noinspection RubyArgCount
|
85
|
+
super(opts)
|
86
|
+
end
|
87
|
+
|
80
88
|
private
|
81
89
|
|
82
90
|
def validate_search(arg, results)
|
data/lib/arli/library.rb
CHANGED
@@ -16,7 +16,8 @@ module Arli
|
|
16
16
|
|
17
17
|
# Additional attributes that can be set via Arlifile
|
18
18
|
attr_accessor :headers_only,
|
19
|
-
:depends
|
19
|
+
:depends,
|
20
|
+
:folder # indicates a sub-folder of the library
|
20
21
|
|
21
22
|
def initialize(lib, config: Arli.config)
|
22
23
|
self.lib = lib
|
@@ -24,6 +25,7 @@ module Arli
|
|
24
25
|
self.lib_dir = lib.name.gsub(/ /, '_')
|
25
26
|
self.headers_only = false
|
26
27
|
self.depends = nil
|
28
|
+
self.folder = nil
|
27
29
|
end
|
28
30
|
|
29
31
|
def install
|
data/lib/arli/version.rb
CHANGED
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: 1.
|
4
|
+
version: 1.3.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: 2018-07-
|
11
|
+
date: 2018-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: arduino-library
|
@@ -329,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
329
329
|
version: '0'
|
330
330
|
requirements: []
|
331
331
|
rubyforge_project:
|
332
|
-
rubygems_version: 2.6
|
332
|
+
rubygems_version: 2.7.6
|
333
333
|
signing_key:
|
334
334
|
specification_version: 4
|
335
335
|
summary: This is an Arduino helper toolkit that builds on top of the arduino-cmake
|