avm-tools 0.37.1 → 0.38.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/avm/executables.rb +8 -13
- data/lib/avm/files/formatter.rb +1 -1
- data/lib/avm/files/formatter/formats/generic_plain.rb +2 -2
- data/lib/avm/files/formatter/formats/php.rb +2 -3
- data/lib/avm/files/formatter/formats/python.rb +21 -0
- data/lib/avm/tools/version.rb +1 -1
- metadata +3 -3
- data/lib/avm/files/formatter/formats/per_file_base.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 585031f042e816f18293f7db1e5319c947db381562c87a6aad9f6c61ddfb1f1b
|
4
|
+
data.tar.gz: 44f66d7bdd9776e640dd4cd2e3df43acfea139366676f84d32bf07877c04c9b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: debbe214e6e984483870ed64d9a0a8d2eac5dc5231b6dc5d4f1408e93f81aaa98baec2d1c260aaaf9366a6565eacc49a7e090c2f188eac766d2e74ceeb48f9b5
|
7
|
+
data.tar.gz: d7a5a4597ee14bf3e1f05c4a021fc678c4cc297bafda9f5e3268160210d9605d5ef7be1408b41b0a9aa2439b9ebe1550082fa58f0accc4aa08b16dd29b03621a
|
data/lib/avm/executables.rb
CHANGED
@@ -1,28 +1,23 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'eac_ruby_utils/envs'
|
4
|
+
require 'eac_ruby_utils/simple_cache'
|
4
5
|
|
5
6
|
module Avm
|
6
7
|
module Executables
|
7
8
|
class << self
|
9
|
+
include ::EacRubyUtils::SimpleCache
|
10
|
+
|
8
11
|
def env
|
9
12
|
::EacRubyUtils::Envs.local
|
10
13
|
end
|
11
14
|
|
12
|
-
|
13
|
-
@file ||= env.executable('file', '--version')
|
14
|
-
end
|
15
|
-
|
16
|
-
def git
|
17
|
-
@git ||= env.executable('git', '--version')
|
18
|
-
end
|
19
|
-
|
20
|
-
def docker
|
21
|
-
@docker ||= env.executable('docker', '--version')
|
22
|
-
end
|
15
|
+
private
|
23
16
|
|
24
|
-
|
25
|
-
|
17
|
+
%w[docker file git php-cs-fixer yapf].each do |program|
|
18
|
+
define_method(program.underscore + '_uncached') do
|
19
|
+
env.executable(program, '--version')
|
20
|
+
end
|
26
21
|
end
|
27
22
|
end
|
28
23
|
end
|
data/lib/avm/files/formatter.rb
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/files/formatter/formats/
|
3
|
+
require 'avm/files/formatter/formats/base'
|
4
4
|
|
5
5
|
module Avm
|
6
6
|
module Files
|
7
7
|
class Formatter
|
8
8
|
module Formats
|
9
|
-
class GenericPlain < ::Avm::Files::Formatter::Formats::
|
9
|
+
class GenericPlain < ::Avm::Files::Formatter::Formats::Base
|
10
10
|
VALID_EXTENSIONS = %w[.bat .css.coffee .java .js .json .rb .scss .sql .tex .url .yml
|
11
11
|
.yaml].freeze
|
12
12
|
|
@@ -1,19 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'avm/files/formatter/formats/per_file_base'
|
4
3
|
require 'avm/files/formatter/formats/generic_plain'
|
5
4
|
|
6
5
|
module Avm
|
7
6
|
module Files
|
8
7
|
class Formatter
|
9
8
|
module Formats
|
10
|
-
class Php < ::Avm::Files::Formatter::Formats::
|
9
|
+
class Php < ::Avm::Files::Formatter::Formats::GenericPlain
|
11
10
|
VALID_EXTENSIONS = %w[.php].freeze
|
12
11
|
VALID_TYPES = ['x-php'].freeze
|
13
12
|
|
14
13
|
def file_apply(file)
|
15
14
|
::Avm::Executables.php_cs_fixer.command.append(['fix', file]).system!
|
16
|
-
|
15
|
+
super(file)
|
17
16
|
end
|
18
17
|
end
|
19
18
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/files/formatter/formats/generic_plain'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Files
|
7
|
+
class Formatter
|
8
|
+
module Formats
|
9
|
+
class Python < ::Avm::Files::Formatter::Formats::GenericPlain
|
10
|
+
VALID_EXTENSIONS = %w[.py].freeze
|
11
|
+
VALID_TYPES = ['x-python'].freeze
|
12
|
+
|
13
|
+
def internal_apply(files)
|
14
|
+
::Avm::Executables.yapf.command.append(['--in-place', *files]).system!
|
15
|
+
super(files)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
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.
|
4
|
+
version: 0.38.0
|
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-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha-parsers
|
@@ -213,8 +213,8 @@ files:
|
|
213
213
|
- lib/avm/files/formatter/formats.rb
|
214
214
|
- lib/avm/files/formatter/formats/base.rb
|
215
215
|
- lib/avm/files/formatter/formats/generic_plain.rb
|
216
|
-
- lib/avm/files/formatter/formats/per_file_base.rb
|
217
216
|
- lib/avm/files/formatter/formats/php.rb
|
217
|
+
- lib/avm/files/formatter/formats/python.rb
|
218
218
|
- lib/avm/files/formatter/utf8_assert.rb
|
219
219
|
- lib/avm/files/info.rb
|
220
220
|
- lib/avm/files/rotate.rb
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'avm/files/formatter/formats/base'
|
4
|
-
|
5
|
-
module Avm
|
6
|
-
module Files
|
7
|
-
class Formatter
|
8
|
-
module Formats
|
9
|
-
class PerFileBase < ::Avm::Files::Formatter::Formats::Base
|
10
|
-
def internal_apply(files)
|
11
|
-
files.each { |file| file_apply(file) }
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|