arli 0.5.1 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rake_tasks~ +8 -0
- data/README.md +122 -30
- data/Rakefile +24 -2
- data/arli.gemspec +4 -1
- data/exe/arli +2 -4
- data/lib/arli.rb +19 -21
- data/lib/arli/actions.rb +19 -0
- data/lib/arli/actions/action.rb +32 -0
- data/lib/arli/actions/backup.rb +30 -0
- data/lib/arli/actions/dir_name.rb +66 -0
- data/lib/arli/actions/git_repo.rb +43 -0
- data/lib/arli/actions/zip_file.rb +54 -0
- data/lib/arli/arli_file.rb +22 -37
- data/lib/arli/cli.rb +4 -190
- data/lib/arli/cli/app.rb +73 -0
- data/lib/arli/cli/command_finder.rb +72 -0
- data/lib/arli/{parser.rb → cli/parser.rb} +66 -56
- data/lib/arli/cli/parser_factory.rb +97 -0
- data/lib/arli/cli/runner.rb +40 -0
- data/lib/arli/commands.rb +8 -0
- data/lib/arli/commands/base.rb +23 -30
- data/lib/arli/commands/install.rb +14 -9
- data/lib/arli/commands/search.rb +35 -10
- data/lib/arli/configuration.rb +62 -0
- data/lib/arli/extensions.rb +9 -0
- data/lib/arli/installer.rb +30 -78
- data/lib/arli/library.rb +49 -0
- data/lib/arli/output.rb +94 -0
- data/lib/arli/version.rb +1 -1
- metadata +63 -8
- data/lib/arli/config.rb +0 -16
- data/lib/arli/installers/zip_file.rb +0 -61
- data/lib/arli/logger.rb +0 -13
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: 0.
|
4
|
+
version: 0.6.1
|
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-
|
11
|
+
date: 2017-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: arduino-library
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.5.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.5.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: colored2
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: dry-configurable
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: awesome_print
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,6 +122,20 @@ dependencies:
|
|
108
122
|
- - ">="
|
109
123
|
- !ruby/object:Gem::Version
|
110
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: yard
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
111
139
|
- !ruby/object:Gem::Dependency
|
112
140
|
name: simplecov
|
113
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,6 +206,20 @@ dependencies:
|
|
178
206
|
- - ">="
|
179
207
|
- !ruby/object:Gem::Version
|
180
208
|
version: '0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: aruba
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '0'
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - ">="
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '0'
|
181
223
|
description: " This is a command-line installer of any number of dependent Github\n
|
182
224
|
\ projects, or libraries. Arli was created to offer Arduino-based projects \n an
|
183
225
|
easy to use and consistent library manager.\n"
|
@@ -189,6 +231,7 @@ extensions: []
|
|
189
231
|
extra_rdoc_files: []
|
190
232
|
files:
|
191
233
|
- ".gitignore"
|
234
|
+
- ".rake_tasks~"
|
192
235
|
- ".rspec"
|
193
236
|
- ".travis.yml"
|
194
237
|
- Gemfile
|
@@ -200,17 +243,29 @@ files:
|
|
200
243
|
- bin/setup
|
201
244
|
- exe/arli
|
202
245
|
- lib/arli.rb
|
246
|
+
- lib/arli/actions.rb
|
247
|
+
- lib/arli/actions/action.rb
|
248
|
+
- lib/arli/actions/backup.rb
|
249
|
+
- lib/arli/actions/dir_name.rb
|
250
|
+
- lib/arli/actions/git_repo.rb
|
251
|
+
- lib/arli/actions/zip_file.rb
|
203
252
|
- lib/arli/arli_file.rb
|
204
253
|
- lib/arli/cli.rb
|
254
|
+
- lib/arli/cli/app.rb
|
255
|
+
- lib/arli/cli/command_finder.rb
|
256
|
+
- lib/arli/cli/parser.rb
|
257
|
+
- lib/arli/cli/parser_factory.rb
|
258
|
+
- lib/arli/cli/runner.rb
|
259
|
+
- lib/arli/commands.rb
|
205
260
|
- lib/arli/commands/base.rb
|
206
261
|
- lib/arli/commands/install.rb
|
207
262
|
- lib/arli/commands/search.rb
|
208
|
-
- lib/arli/
|
263
|
+
- lib/arli/configuration.rb
|
209
264
|
- lib/arli/errors.rb
|
265
|
+
- lib/arli/extensions.rb
|
210
266
|
- lib/arli/installer.rb
|
211
|
-
- lib/arli/
|
212
|
-
- lib/arli/
|
213
|
-
- lib/arli/parser.rb
|
267
|
+
- lib/arli/library.rb
|
268
|
+
- lib/arli/output.rb
|
214
269
|
- lib/arli/version.rb
|
215
270
|
homepage: https://github.com/kigster/arli
|
216
271
|
licenses:
|
data/lib/arli/config.rb
DELETED
@@ -1,61 +0,0 @@
|
|
1
|
-
require 'archive/zip'
|
2
|
-
|
3
|
-
module Arli
|
4
|
-
module Installers
|
5
|
-
class ZipFile
|
6
|
-
attr_accessor :lib, :lib_dir
|
7
|
-
|
8
|
-
def initialize(lib:)
|
9
|
-
self.lib = lib
|
10
|
-
self.lib_dir = lib.name.gsub(/ /, '_')
|
11
|
-
raise 'Invalid URL for this installer: ' + lib.url unless lib.url =~ /\.zip$/i
|
12
|
-
end
|
13
|
-
|
14
|
-
def install
|
15
|
-
download!
|
16
|
-
|
17
|
-
remove_library!
|
18
|
-
remove_library_versions!
|
19
|
-
|
20
|
-
unzip(zip_archive, '.')
|
21
|
-
|
22
|
-
dir = dirs_matching(lib_dir).first
|
23
|
-
|
24
|
-
FileUtils.move(dir, lib_dir) if dir
|
25
|
-
|
26
|
-
FileUtils.rm_f(zip_archive) if File.exist?(zip_archive)
|
27
|
-
end
|
28
|
-
|
29
|
-
def remove_library!
|
30
|
-
FileUtils.rm_rf(lib_dir)
|
31
|
-
end
|
32
|
-
|
33
|
-
def remove_library_versions!
|
34
|
-
dirs = dirs_matching(lib_dir)
|
35
|
-
dirs.delete(lib_dir) # we don't want to delete the actual library
|
36
|
-
dirs.each { |d| FileUtils.rm_f(d) }
|
37
|
-
end
|
38
|
-
|
39
|
-
private
|
40
|
-
|
41
|
-
def dirs_matching(name)
|
42
|
-
Dir.glob("#{name}*").select { |d| File.directory?(d) }
|
43
|
-
end
|
44
|
-
|
45
|
-
def zip_archive
|
46
|
-
@zip_archive ||= File.basename(lib.url)
|
47
|
-
end
|
48
|
-
|
49
|
-
def download!
|
50
|
-
File.write(zip_archive, Net::HTTP.get(URI.parse(lib.url)))
|
51
|
-
end
|
52
|
-
|
53
|
-
# def unzip(file, destination)
|
54
|
-
# Archive::Zip.extract(file, destination, on_error: :skip)
|
55
|
-
# end
|
56
|
-
def unzip(file, destination)
|
57
|
-
`unzip -o #{file} -d #{destination}`
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
data/lib/arli/logger.rb
DELETED