missing_rspec 0.0.1 → 0.0.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/lib/missing_rspec/folder_types_finder.rb +30 -5
- data/lib/missing_rspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 513b1ff6dc1280c5a1f67754bd404462e7be694f3bdc513fd5ed6cd9c6042db0
|
4
|
+
data.tar.gz: f7202135b767911e2eb016df90d375655bc7267b825bc8ab396ef7248bd3ecf7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caef5841515f222526f8c9f578b2c2cae57a0d43e2c78a26495d798c31ada4e1fdd01089f68e0cb0674c106b00c416c3b6f5e4b69df45254a719568fd6819548
|
7
|
+
data.tar.gz: 72a9a5e974fbd5101cccb94e51e8fb7aeabe24a0ddc575fe59dc2174a745078c1e652a3ede89e18d055b78a2bf4a9e7b18b9740c3da8a5064427c592e0ae2414
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -21,7 +21,7 @@ bin/rails runner "puts Rails.root.to_s"
|
|
21
21
|
Example when rails path is /app
|
22
22
|
|
23
23
|
```shell
|
24
|
-
bin/rails
|
24
|
+
bin/rails missing_rspec[/app]
|
25
25
|
```
|
26
26
|
|
27
27
|
### How to specify the rails path in the environment variable
|
@@ -39,12 +39,12 @@ RAILS_APP_PATH=/app
|
|
39
39
|
```
|
40
40
|
|
41
41
|
```shell
|
42
|
-
bin/rails
|
42
|
+
bin/rails missing_rspec
|
43
43
|
```
|
44
44
|
## Execution example
|
45
45
|
|
46
46
|
```shell
|
47
|
-
root@be31b61b9f18:/app/missing_rspec# bin/rails
|
47
|
+
root@be31b61b9f18:/app/missing_rspec# bin/rails missing_rspec
|
48
48
|
|
49
49
|
|
50
50
|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
module MissingRspec
|
2
2
|
class FolderTypesFinder
|
3
|
-
EXCLUDED_FOLDER_TYPES = %w[assets javascript views]
|
4
|
-
|
5
3
|
attr_reader :app_path
|
6
4
|
|
7
5
|
def initialize(app_path)
|
@@ -11,9 +9,36 @@ module MissingRspec
|
|
11
9
|
def fetch_folder_types
|
12
10
|
Dir.chdir(app_path)
|
13
11
|
Dir.chdir('app')
|
14
|
-
|
15
|
-
|
16
|
-
|
12
|
+
fetch_target_folders
|
13
|
+
end
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def fetch_target_folders
|
18
|
+
folders = Hash.new{ |hash, key| hash[key] = [] }
|
19
|
+
|
20
|
+
trace_dir = lambda do |dir, deep_level|
|
21
|
+
Dir.chdir(dir)
|
22
|
+
dir_files = Dir.glob('*').sort
|
23
|
+
lower_dirs = dir_files.select { |df| File.directory?(df) }
|
24
|
+
files = dir_files - lower_dirs
|
25
|
+
|
26
|
+
lower_dirs.each do |lower_dir|
|
27
|
+
trace_dir.call(lower_dir, deep_level + 1)
|
28
|
+
end
|
29
|
+
|
30
|
+
files.each do |file|
|
31
|
+
if /.rb$/ =~ file
|
32
|
+
folders[deep_level] << dir
|
33
|
+
break
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
Dir.chdir('..')
|
38
|
+
end
|
39
|
+
trace_dir.call('.', 0)
|
40
|
+
|
41
|
+
folders[1]
|
17
42
|
end
|
18
43
|
end
|
19
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: missing_rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keiichi Kayama
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-08-
|
11
|
+
date: 2022-08-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: This Gem extracts RSpec files that have not yet been created.
|
14
14
|
email:
|