avm-tools 0.36.0 → 0.37.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd0fc54aa88d5a418257e41542446fd247ecacc10764babfc6b1c74c329c4560
4
- data.tar.gz: 163c224656cb2db01b66c756e186ea57f532fba2d225334f77573f18dfbce52e
3
+ metadata.gz: e112c35554da958b5bcee6263e3ad3d6c2cd93cf70ab56eba9fb9bb689199cb8
4
+ data.tar.gz: 877e71a8bb6c19ab1285a88e54feba27e59bdbbc05c574c6e183c6d9d8625159
5
5
  SHA512:
6
- metadata.gz: 66bfb3911d0cf5ea1c84a4ccbb6df1f9e80a4f28819b364a54835259d3561068a09f49a874221789e53a3bb46cb616bcef4bb25407f1431ee930f389dd55177b
7
- data.tar.gz: 8585671f0d8aaa316124354b9390beedc7667e49a667be6db76a744590a2cb74cdda96691111bac2e7c20808b1bf61286ece822bb68ca48affd4679a5d192331
6
+ metadata.gz: 05d3e02a29bf1e45049f22dfd194e6d33d71d25967616544496d77d1b72f95753aac1e4b7365689fcf644d92fef4df0b08b7d0762f43fef97c48829f23548021
7
+ data.tar.gz: 4ab2a54b3b9d0c94925d47759ca7b05bd40ed8db9219aa36e2e57f3ff1b68aca330e3ebf7a82fb2a0024158d2693daa9f8f1cc2111bc9f56bf207a637ad34e84
@@ -16,6 +16,10 @@ module Avm
16
16
  def docker
17
17
  @docker ||= env.executable('docker', '--version')
18
18
  end
19
+
20
+ def php_cs_fixer
21
+ @php_cs_fixer ||= env.executable('php-cs-fixer', '--version')
22
+ end
19
23
  end
20
24
  end
21
25
  end
@@ -11,7 +11,7 @@ module Avm
11
11
  enable_console_speaker
12
12
  common_constructor :source_paths, :options
13
13
 
14
- FORMATS = %w[generic_plain].freeze
14
+ FORMATS = %w[php generic_plain].freeze
15
15
 
16
16
  def run
17
17
  clear
@@ -77,7 +77,7 @@ module Avm
77
77
  def show_results
78
78
  changed = @result.select(&:changed)
79
79
  changed.each do |h|
80
- out h.file.t_s.cyan
80
+ out h.file.to_s.cyan
81
81
  out " (#{h.format})".yellow
82
82
  puts ' changed'.green
83
83
  end
@@ -1,12 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'avm/files/formatter/formats/base'
3
+ require 'avm/files/formatter/formats/per_file_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::Base
9
+ class GenericPlain < ::Avm::Files::Formatter::Formats::PerFileBase
10
10
  VALID_EXTENSIONS = %w[.bat .css.coffee .java .js .json .php .rb .scss .sql .tex .url .yml
11
11
  .yaml].freeze
12
12
 
@@ -0,0 +1,17 @@
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
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/files/formatter/formats/per_file_base'
4
+ require 'avm/files/formatter/formats/generic_plain'
5
+
6
+ module Avm
7
+ module Files
8
+ class Formatter
9
+ module Formats
10
+ class Php < ::Avm::Files::Formatter::Formats::PerFileBase
11
+ VALID_EXTENSIONS = %w[.php].freeze
12
+ VALID_TYPES = ['PHP script'].freeze
13
+
14
+ def file_apply(file)
15
+ ::Avm::Executables.php_cs_fixer.command.append(['fix', file]).system!
16
+ ::Avm::Files::Formatter::Formats::GenericPlain.new.file_apply(file)
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.36.0'
5
+ VERSION = '0.37.0'
6
6
  end
7
7
  end
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.36.0
4
+ version: 0.37.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-03-21 00:00:00.000000000 Z
11
+ date: 2020-04-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -16,20 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.1'
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.1.1
19
+ version: '0.4'
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
24
  - - "~>"
28
25
  - !ruby/object:Gem::Version
29
- version: '0.1'
30
- - - ">="
31
- - !ruby/object:Gem::Version
32
- version: 0.1.1
26
+ version: '0.4'
33
27
  - !ruby/object:Gem::Dependency
34
28
  name: clipboard
35
29
  requirement: !ruby/object:Gem::Requirement
@@ -205,6 +199,8 @@ files:
205
199
  - lib/avm/files/formatter/formats.rb
206
200
  - lib/avm/files/formatter/formats/base.rb
207
201
  - lib/avm/files/formatter/formats/generic_plain.rb
202
+ - lib/avm/files/formatter/formats/per_file_base.rb
203
+ - lib/avm/files/formatter/formats/php.rb
208
204
  - lib/avm/files/rotate.rb
209
205
  - lib/avm/fs_cache.rb
210
206
  - lib/avm/git.rb