dorian-pretty 0.1.0
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 +7 -0
- data/bin/pretty +90 -0
- metadata +76 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0d26032defd1dda1b84fc727fbcb0bc32d95e667d95c422d9339447525ee24ae
|
4
|
+
data.tar.gz: 1fcd7e68c442b9e823d9ffd5b5e8a482aa9544926e789c3a91e5ee56e1fcdad0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 930903fc8b3cc884bca77074dc3a53f03ec2a86cfb5b92931113f764ef7d033bba4bb800da07f91dc89713f543cca5018a2c96ce96c5942ebbd675c677f60635
|
7
|
+
data.tar.gz: f190ea10fad025473d69299438479d5c74ae38c708d7ccac2b19c5218eccf1af52db62da98e90f1084b4d604c725f704242aff4ff2d087869775d5e52f29fd35
|
data/bin/pretty
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "shellwords"
|
4
|
+
require "git"
|
5
|
+
require "syntax_tree"
|
6
|
+
|
7
|
+
unless ARGV.size.zero?
|
8
|
+
puts "USAGE: pretty"
|
9
|
+
exit
|
10
|
+
end
|
11
|
+
|
12
|
+
ruby_extensions = %w[
|
13
|
+
.rb
|
14
|
+
.arb
|
15
|
+
.axlsx
|
16
|
+
.builder
|
17
|
+
.fcgi
|
18
|
+
.gemfile
|
19
|
+
.gemspec
|
20
|
+
.god
|
21
|
+
.jb
|
22
|
+
.jbuilder
|
23
|
+
.mspec
|
24
|
+
.opal
|
25
|
+
.pluginspec
|
26
|
+
.podspec
|
27
|
+
.rabl
|
28
|
+
.rake
|
29
|
+
.rbuild
|
30
|
+
.rbw
|
31
|
+
.rbx
|
32
|
+
.ru
|
33
|
+
.ruby
|
34
|
+
.schema
|
35
|
+
.spec
|
36
|
+
.thor
|
37
|
+
.watchr
|
38
|
+
]
|
39
|
+
|
40
|
+
ruby_filenames = %w[
|
41
|
+
.irbrc
|
42
|
+
.pryrc
|
43
|
+
.simplecov
|
44
|
+
Appraisals
|
45
|
+
Berksfile
|
46
|
+
Brewfile
|
47
|
+
Buildfile
|
48
|
+
Capfile
|
49
|
+
Cheffile
|
50
|
+
Dangerfile
|
51
|
+
Deliverfile
|
52
|
+
Fastfile
|
53
|
+
Gemfile
|
54
|
+
Guardfile
|
55
|
+
Jarfile
|
56
|
+
Mavenfile
|
57
|
+
Podfile
|
58
|
+
Puppetfile
|
59
|
+
Rakefile
|
60
|
+
rakefile
|
61
|
+
Schemafile
|
62
|
+
Snapfile
|
63
|
+
Steepfile
|
64
|
+
Thorfile
|
65
|
+
Vagabondfile
|
66
|
+
Vagrantfile
|
67
|
+
buildfile
|
68
|
+
]
|
69
|
+
|
70
|
+
Git
|
71
|
+
.open(".")
|
72
|
+
.ls_files
|
73
|
+
.map(&:first)
|
74
|
+
.select do |path|
|
75
|
+
next false if Dir.exist?(path)
|
76
|
+
next true if ruby_filenames.include?(path)
|
77
|
+
next true if ruby_extensions.include?(File.extname(path))
|
78
|
+
next true if File.open(path, &:gets) =~ /#!.*ruby/
|
79
|
+
false
|
80
|
+
end
|
81
|
+
.each do |path|
|
82
|
+
before = File.read(path)
|
83
|
+
after = SyntaxTree.format(before)
|
84
|
+
if before == after
|
85
|
+
puts "\e[37m#{path}\e[0m"
|
86
|
+
else
|
87
|
+
puts path
|
88
|
+
File.write(path, after)
|
89
|
+
end
|
90
|
+
end
|
metadata
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dorian-pretty
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Dorian Marié
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-01-30 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: syntax_tree
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '6'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: git
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1'
|
41
|
+
description: |-
|
42
|
+
Formats files in the current directory
|
43
|
+
|
44
|
+
e.g. `pretty`
|
45
|
+
email: dorian@dorianmarie.fr
|
46
|
+
executables:
|
47
|
+
- pretty
|
48
|
+
extensions: []
|
49
|
+
extra_rdoc_files: []
|
50
|
+
files:
|
51
|
+
- bin/pretty
|
52
|
+
homepage: https://github.com/dorianmariefr/dorian-pretty
|
53
|
+
licenses:
|
54
|
+
- MIT
|
55
|
+
metadata:
|
56
|
+
rubygems_mfa_required: 'true'
|
57
|
+
post_install_message:
|
58
|
+
rdoc_options: []
|
59
|
+
require_paths:
|
60
|
+
- lib
|
61
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
requirements:
|
63
|
+
- - ">="
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '0'
|
71
|
+
requirements: []
|
72
|
+
rubygems_version: 3.5.3
|
73
|
+
signing_key:
|
74
|
+
specification_version: 4
|
75
|
+
summary: Formats files in the current directory
|
76
|
+
test_files: []
|