avm-tools 0.44.1 → 0.44.2
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/lib/avm/files/formatter.rb +8 -10
- data/lib/avm/patches/eac_launcher_git_base.rb +49 -26
- data/lib/avm/tools/runner/git.rb +1 -1
- data/lib/avm/tools/runner/git/auto_fixup.rb +1 -1
- data/lib/avm/tools/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c9d91dc20429e3c9c932f57e47152b19fb1e468f3e564c44f4f395f7d04b5d7
|
4
|
+
data.tar.gz: 18bfbdc67f8f8a9c93bccff6798f4b444fc6c20e3a9a4318e1acae168c6cccd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab35a0b3b98a2885cc1de50a117b5fa579429160aa1cae64d9edf4edc94fa819afad0bb470bcbd7b7f293ca3ff90bda4d56c37460455093dab45ac4879174532
|
7
|
+
data.tar.gz: 6f7ec8185a22da62ec5b5ada88065ba74ca6a0971235322732aff502c94d5853be532dc188fae5bef70830de18cd20412af536ff82f3c3dd991d08a69f7a4559
|
data/lib/avm/files/formatter.rb
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/core_ext'
|
4
|
-
require 'eac_ruby_utils/
|
4
|
+
require 'eac_ruby_utils/fs/traversable'
|
5
5
|
|
6
6
|
module Avm
|
7
7
|
module Files
|
8
8
|
class Formatter
|
9
|
+
include ::EacRubyUtils::Fs::Traversable
|
9
10
|
require_sub __FILE__
|
10
11
|
enable_simple_cache
|
11
12
|
enable_console_speaker
|
@@ -32,7 +33,7 @@ module Avm
|
|
32
33
|
end
|
33
34
|
end
|
34
35
|
|
35
|
-
def
|
36
|
+
def traverser_check_file(file)
|
36
37
|
format = find_format(file)
|
37
38
|
infov file, format ? format.class : '-' if options.fetch(:verbose)
|
38
39
|
return unless format
|
@@ -59,18 +60,11 @@ module Avm
|
|
59
60
|
end
|
60
61
|
end
|
61
62
|
|
62
|
-
def fs_traverser_uncached
|
63
|
-
r = ::EacRubyUtils::FilesystemTraverser.new
|
64
|
-
r.check_file = method(:check_file)
|
65
|
-
r.recursive = options.fetch(:recursive)
|
66
|
-
r
|
67
|
-
end
|
68
|
-
|
69
63
|
def search_files
|
70
64
|
infov 'Directories to search', source_paths.count
|
71
65
|
source_paths.each do |source_path|
|
72
66
|
infom "Searching files on \"#{source_path}\"..."
|
73
|
-
|
67
|
+
traverser_check_path(source_path)
|
74
68
|
end
|
75
69
|
end
|
76
70
|
|
@@ -83,6 +77,10 @@ module Avm
|
|
83
77
|
end
|
84
78
|
infov('Files changed', "#{changed.count}/#{@result.count}")
|
85
79
|
end
|
80
|
+
|
81
|
+
def traverser_recursive
|
82
|
+
options.fetch(:recursive)
|
83
|
+
end
|
86
84
|
end
|
87
85
|
end
|
88
86
|
end
|
@@ -9,43 +9,66 @@ require 'eac_ruby_utils/require_sub'
|
|
9
9
|
module Avm
|
10
10
|
module Patches
|
11
11
|
module EacLauncherGitBase
|
12
|
-
|
13
|
-
args, options = build_args(args)
|
14
|
-
::EacRubyUtils::Envs.local.command(*args).execute(options)
|
15
|
-
end
|
12
|
+
extend ::ActiveSupport::Concern
|
16
13
|
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
included do
|
15
|
+
extend ClassMethods
|
16
|
+
include InstanceMethods
|
20
17
|
end
|
21
18
|
|
22
|
-
|
23
|
-
|
24
|
-
|
19
|
+
module ClassMethods
|
20
|
+
# @return [EacLauncher::Git::Base]
|
21
|
+
def by_root(search_base_path)
|
22
|
+
new(find_root(search_base_path).to_path)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Searches the root path for the Git repository which includes +search_base_path+.
|
26
|
+
# @return [Pathname]
|
27
|
+
def find_root(search_base_path)
|
28
|
+
path = search_base_path.to_pathname.expand_path
|
29
|
+
loop do
|
30
|
+
return path if path.join('.git').exist?
|
31
|
+
raise "\".git\" not found for \"#{search_base_path}\"" if path.parent.root?
|
25
32
|
|
26
|
-
|
27
|
-
|
28
|
-
parse_status_line(line.gsub(/\n\z/, ''))
|
33
|
+
path = path.parent
|
34
|
+
end
|
29
35
|
end
|
30
36
|
end
|
31
37
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
38
|
+
module InstanceMethods
|
39
|
+
def execute(*args)
|
40
|
+
args, options = build_args(args)
|
41
|
+
::EacRubyUtils::Envs.local.command(*args).execute(options)
|
42
|
+
end
|
37
43
|
|
38
|
-
|
44
|
+
def command(*args)
|
45
|
+
args, _options = build_args(args)
|
46
|
+
::EacRubyUtils::Envs.local.command(*args)
|
39
47
|
end
|
40
|
-
end
|
41
48
|
|
42
|
-
|
49
|
+
def dirty?
|
50
|
+
dirty_files.any?
|
51
|
+
end
|
43
52
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
53
|
+
def dirty_files
|
54
|
+
execute!('status', '--porcelain', '--untracked-files').each_line.map do |line|
|
55
|
+
parse_status_line(line.gsub(/\n\z/, ''))
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# @return [Pathname]
|
60
|
+
def root_path
|
61
|
+
@root_path ||= self.class.find_root(to_s)
|
62
|
+
end
|
63
|
+
|
64
|
+
private
|
65
|
+
|
66
|
+
def parse_status_line(line)
|
67
|
+
m = /\A(.)(.)\s(.+)\z/.match(line)
|
68
|
+
::Kernel.raise "Status pattern does not match \"#{line}\"" unless m
|
69
|
+
::OpenStruct.new(index: m[1], worktree: m[2], path: m[3],
|
70
|
+
absolute_path: ::File.expand_path(m[3], self))
|
71
|
+
end
|
49
72
|
end
|
50
73
|
end
|
51
74
|
end
|
data/lib/avm/tools/runner/git.rb
CHANGED
data/lib/avm/tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avm-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.44.
|
4
|
+
version: 0.44.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Esquilo Azul Company
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha-parsers
|
@@ -98,14 +98,14 @@ dependencies:
|
|
98
98
|
requirements:
|
99
99
|
- - "~>"
|
100
100
|
- !ruby/object:Gem::Version
|
101
|
-
version: '0.
|
101
|
+
version: '0.30'
|
102
102
|
type: :runtime
|
103
103
|
prerelease: false
|
104
104
|
version_requirements: !ruby/object:Gem::Requirement
|
105
105
|
requirements:
|
106
106
|
- - "~>"
|
107
107
|
- !ruby/object:Gem::Version
|
108
|
-
version: '0.
|
108
|
+
version: '0.30'
|
109
109
|
- !ruby/object:Gem::Dependency
|
110
110
|
name: filesize
|
111
111
|
requirement: !ruby/object:Gem::Requirement
|