avm-tools 0.39.0 → 0.40.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 87c59d534d4e8d100e29772a76fee5fb2442e1893871c7c6c62d2a061cd3d524
|
4
|
+
data.tar.gz: 392ae256280e52d2c04e319a0b1ad40ed8029da9ba9fb94fcbdbf4b9a962ff9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 322b86ee2e05bbc436fef2c10e2e7b577b551deb453de80aa2a7e5bf787a243d14f58e5be7e64c2f37dc9177c945b4877f530d85b7c5a3885512bbf550bcd779
|
7
|
+
data.tar.gz: f5bbcb44cdc733247020ee60ff0b1d48dbc0b2875c2c27e6ebaaea34c471c8b55fb0a067cb3c7fc79a093a25d6e4ad330333e63cc7656c35b90a528503026d36
|
data/lib/avm/files/formatter.rb
CHANGED
@@ -7,7 +7,7 @@ module Avm
|
|
7
7
|
class Formatter
|
8
8
|
module Formats
|
9
9
|
class GenericPlain < ::Avm::Files::Formatter::Formats::Base
|
10
|
-
VALID_EXTENSIONS = %w[.bat .css.coffee .java .js .
|
10
|
+
VALID_EXTENSIONS = %w[.bat .css.coffee .java .js .rb .scss .sql .tex .url .yml
|
11
11
|
.yaml].freeze
|
12
12
|
|
13
13
|
VALID_TYPES = %w[plain x-shellscript].freeze
|
@@ -0,0 +1,31 @@
|
|
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 Json < ::Avm::Files::Formatter::Formats::GenericPlain
|
10
|
+
VALID_EXTENSIONS = %w[.json].freeze
|
11
|
+
VALID_TYPES = [].freeze
|
12
|
+
|
13
|
+
def match?(file)
|
14
|
+
super || json_file?(file)
|
15
|
+
end
|
16
|
+
|
17
|
+
def file_apply(file)
|
18
|
+
::File.write(file, ::JSON.pretty_generate(::JSON.parse(::File.read(file))))
|
19
|
+
end
|
20
|
+
|
21
|
+
def json_file?(file)
|
22
|
+
::JSON.parse(::File.read(file))
|
23
|
+
true
|
24
|
+
rescue JSON::ParserError
|
25
|
+
false
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
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.40.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-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aranha-parsers
|
@@ -234,6 +234,7 @@ files:
|
|
234
234
|
- lib/avm/files/formatter/formats/base.rb
|
235
235
|
- lib/avm/files/formatter/formats/generic_plain.rb
|
236
236
|
- lib/avm/files/formatter/formats/html.rb
|
237
|
+
- lib/avm/files/formatter/formats/json.rb
|
237
238
|
- lib/avm/files/formatter/formats/php.rb
|
238
239
|
- lib/avm/files/formatter/formats/python.rb
|
239
240
|
- lib/avm/files/formatter/utf8_assert.rb
|