dorian-git-ls-ruby-files 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/bin/git-ls-ruby-files +86 -0
  3. metadata +62 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: bca2d4b6c5bbce1fe32d77f1e4387c2b44144919d6026e0aeb166098f65f0367
4
+ data.tar.gz: 926af34171320d022f032c2e4b9c3fdac909c9da46e4b78434cc83aa1b629071
5
+ SHA512:
6
+ metadata.gz: 7c1fa468738aa0213562f7b57ae5f25127705b332aba8d74baaf061d05cec848d658a270b0b94a00d0e295f19ed1db84ed2a58369f2a5e2ed701102523891531
7
+ data.tar.gz: d60d112297ae9f786516315f569c2afd5a04eaff2a806f4f5f70b4643b1846e7ebe4a63de3118b339367a06c949af3c4f0d750a0bb8b73dba9cb1f9d47002d36
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ require "git"
5
+
6
+ unless ARGV.empty?
7
+ puts "USAGE: git ls-ruby-files"
8
+ exit
9
+ end
10
+
11
+ ruby_extensions = %w[
12
+ .rb
13
+ .arb
14
+ .axlsx
15
+ .builder
16
+ .fcgi
17
+ .gemfile
18
+ .gemspec
19
+ .god
20
+ .jb
21
+ .jbuilder
22
+ .mspec
23
+ .opal
24
+ .pluginspec
25
+ .podspec
26
+ .rabl
27
+ .rake
28
+ .rbuild
29
+ .rbw
30
+ .rbx
31
+ .ru
32
+ .ruby
33
+ .schema
34
+ .spec
35
+ .thor
36
+ .watchr
37
+ ]
38
+
39
+ ruby_filenames = %w[
40
+ .irbrc
41
+ .pryrc
42
+ .simplecov
43
+ Appraisals
44
+ Berksfile
45
+ Brewfile
46
+ Buildfile
47
+ Capfile
48
+ Cheffile
49
+ Dangerfile
50
+ Deliverfile
51
+ Fastfile
52
+ Gemfile
53
+ Guardfile
54
+ Jarfile
55
+ Mavenfile
56
+ Podfile
57
+ Puppetfile
58
+ Rakefile
59
+ rakefile
60
+ Schemafile
61
+ Snapfile
62
+ Steepfile
63
+ Thorfile
64
+ Vagabondfile
65
+ Vagrantfile
66
+ buildfile
67
+ ]
68
+
69
+ puts(
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 false unless File.exist?(path)
79
+
80
+ first_line =
81
+ File.open(path, &:gets).to_s.encode("UTF-8", invalid: :replace)
82
+ next true if first_line =~ /#!.*ruby/
83
+
84
+ false
85
+ end
86
+ )
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dorian-git-ls-ruby-files
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-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: git
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1'
27
+ description: |-
28
+ List Tuby files checked in Git
29
+
30
+ e.g. `git ls-ruby-files`
31
+ email: dorian@dorianmarie.fr
32
+ executables:
33
+ - git-ls-ruby-files
34
+ extensions: []
35
+ extra_rdoc_files: []
36
+ files:
37
+ - bin/git-ls-ruby-files
38
+ homepage: https://github.com/dorianmariefr/dorian-git-ls-ruby-files
39
+ licenses:
40
+ - MIT
41
+ metadata:
42
+ rubygems_mfa_required: 'true'
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubygems_version: 3.5.3
59
+ signing_key:
60
+ specification_version: 4
61
+ summary: List Tuby files checked in Git
62
+ test_files: []