pult 0.0.19 → 0.0.20
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 +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/pult/panel/provider/rake.rb +20 -24
- data/lib/pult/panel/provider.rb +6 -0
- data/lib/pult/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bfca2fba5db79bb8b9c88ea72819ae2e28524c95a245f8cfe5312496b32ca59
|
4
|
+
data.tar.gz: c7be9aeac950d548b2ba917b36fb5ef16095f8c346ce018ae2ef524209caf874
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45a20a0843ef79d94d5e066e95bbe45a1c69db1bdd1dee17db47d083eb0f7eb1fc3bbbdb236d3b99795b877be7915f9b73dbb6d6f99b9f7577b1c253e482c409
|
7
|
+
data.tar.gz: 5bc0c40f1c4f51623d722332af50e5ce0d7e28f145c5529d0c55a9bc495b685eaced4a65e1e8f9e20af070e9942482f7d9eb707072331c197aa4e62055a6f397
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## [0.0.20] - 2019-26-09
|
8
|
+
### Status
|
9
|
+
- Dev version
|
10
|
+
|
11
|
+
### Updates
|
12
|
+
- Fix/Ref `rake` provider, add `rails` command for `<command> --tasks`
|
13
|
+
|
7
14
|
## [0.0.19] - 2019-23-09
|
8
15
|
### Status
|
9
16
|
- Dev version
|
@@ -1,58 +1,54 @@
|
|
1
1
|
module Pult::Panel::Provider::Rake
|
2
2
|
|
3
3
|
FILE = 'Rakefile'
|
4
|
-
COMMAND =
|
4
|
+
COMMAND = %w{rake rails}
|
5
5
|
|
6
6
|
PATH = Pult::RAKEPATH || 'r'
|
7
7
|
|
8
8
|
def self.mixin! panel
|
9
|
-
|
9
|
+
app_dirs = Pult::Panel::Provider.app_dirs(panel)
|
10
10
|
|
11
|
-
|
11
|
+
app_dirs.map{|a, d| [a, "#{d}/#{FILE}"] }.each do |app, rake_file|
|
12
12
|
hash = pult_hash rake_file
|
13
13
|
|
14
|
-
|
15
|
-
panel[app_name(rake_file)]&.merge! hash
|
14
|
+
panel[app]&.merge! hash
|
16
15
|
end
|
17
16
|
end
|
18
17
|
|
19
18
|
def self.pult_hash file
|
20
19
|
hash = {}
|
21
|
-
tasks = self.tasks(file)
|
22
|
-
|
23
|
-
for task in tasks.sort.reverse
|
24
|
-
count = task.count(':')
|
25
20
|
|
21
|
+
maker = lambda do |task, command, count|
|
26
22
|
n = -1
|
27
23
|
task.split(':').reduce(hash) do |h, t|
|
28
|
-
(n += 1) && n == count ? h[t] = "#{
|
24
|
+
(n += 1) && n == count ? h[t] = "#{command} #{task}" : h[t] ||= {}
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
for command in COMMAND
|
29
|
+
tasks = self.tasks command, file
|
30
|
+
|
31
|
+
for task in tasks.sort.reverse
|
32
|
+
count = task.count(':')
|
33
|
+
maker.(task, command, count)
|
29
34
|
end
|
35
|
+
|
36
|
+
break if hash.any?
|
30
37
|
end
|
31
38
|
|
32
39
|
{ PATH => hash }
|
33
40
|
end
|
34
41
|
|
35
|
-
def self.tasks file
|
42
|
+
def self.tasks command, file
|
36
43
|
app_dir = Pathname.new(file).dirname.to_s
|
37
44
|
|
38
|
-
runner = Pult::Executor.run! "#{
|
45
|
+
runner = Pult::Executor.run! "#{command} --tasks", app_dir
|
39
46
|
|
40
47
|
tasks = runner[:stdout].split(/\n/).map do |s|
|
41
|
-
s.sub(/^#{
|
48
|
+
s.sub(/^#{command} (\S+).*/, '\1')
|
42
49
|
end
|
43
50
|
|
44
51
|
# temp ignore params
|
45
52
|
tasks.map{ |t| t.sub /\[.+/, '' }
|
46
53
|
end
|
47
|
-
|
48
|
-
# tmp; await for refactoring mixins in panel.rb
|
49
|
-
def self.app_name file
|
50
|
-
app_dir = Pathname.new(file).dirname.to_s
|
51
|
-
pult_file = Pult::Panel::Provider::Pult::FILE
|
52
|
-
|
53
|
-
pult_hash = \
|
54
|
-
Pult::Panel::Provider::Pult.pult_hash("#{app_dir}/#{pult_file}")
|
55
|
-
|
56
|
-
pult_hash.keys&.first
|
57
|
-
end
|
58
54
|
end
|
data/lib/pult/panel/provider.rb
CHANGED
data/lib/pult/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pult
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.20
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dmitryck
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|