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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5a39fbcaf3eda478ae7480a5e792c31ec0f4a01f4ee3b5dedfddb8791e868781
4
- data.tar.gz: dc9bd252985efbd8b3f027ef66d1f83230ea993009618b760f3752674bb2ffb2
3
+ metadata.gz: 5bfca2fba5db79bb8b9c88ea72819ae2e28524c95a245f8cfe5312496b32ca59
4
+ data.tar.gz: c7be9aeac950d548b2ba917b36fb5ef16095f8c346ce018ae2ef524209caf874
5
5
  SHA512:
6
- metadata.gz: 6672fc57572bcd811ed3228393705b3cab9dd84a044a4ff3179d90316f692370eb385177dbc2c2fd3cfeaf569ddb1d693debcf78f021a56025d53984ff33f920
7
- data.tar.gz: 4aee322a1a980181f47f8c718c655a21104a88974f0beb365ad58361951c3077548d06752fd799add3ced09412859d5a6d2389a0251ad8191bbc3300d0e74d36
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 = 'rake'
4
+ COMMAND = %w{rake rails}
5
5
 
6
6
  PATH = Pult::RAKEPATH || 'r'
7
7
 
8
8
  def self.mixin! panel
9
- rake_files = Pult::Panel::Provider.files(FILE, panel._root)
9
+ app_dirs = Pult::Panel::Provider.app_dirs(panel)
10
10
 
11
- Dir[rake_files].each do |rake_file|
11
+ app_dirs.map{|a, d| [a, "#{d}/#{FILE}"] }.each do |app, rake_file|
12
12
  hash = pult_hash rake_file
13
13
 
14
- # merge in app
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] = "#{COMMAND} #{task}" : 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! "#{COMMAND} --tasks", app_dir
45
+ runner = Pult::Executor.run! "#{command} --tasks", app_dir
39
46
 
40
47
  tasks = runner[:stdout].split(/\n/).map do |s|
41
- s.sub(/^#{COMMAND} (\S+).*/, '\1')
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
@@ -6,4 +6,10 @@ module Pult::Panel::Provider
6
6
  def self.files file, root
7
7
  root + '/**/' + file
8
8
  end
9
+
10
+ def self.app_dirs panel
11
+ arr = []
12
+ panel.each{|app, h| arr << [app, h.dig(*%w{config dir})] }
13
+ arr
14
+ end
9
15
  end
data/lib/pult/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pult
2
- VERSION = "0.0.19"
2
+ VERSION = "0.0.20"
3
3
  end
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.19
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-23 00:00:00.000000000 Z
11
+ date: 2019-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler