drg 0.15.2 → 0.15.3
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/lib/drg/tasks/spec_runner.rb +13 -10
- data/lib/drg/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69c0e41819c37acab365f77c1c8659c765c5f5be
|
4
|
+
data.tar.gz: d9d5b708748bf54ba0bd88e6d4296f604ef87144
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eeee5b43f72123668474dcc67f19a053587133e8e833d20b7255f1e711faea040d08582b5de88f8b05597d9c9b9f25635a71bc27dbc32cc2532967ba8c1d7830
|
7
|
+
data.tar.gz: 2c028a172eae58d4bdd9d16b8e191680974ce480bc175b7cbc1008d034cce4555cd5a68eb9c281c15a059ff433a037e24b0e88284187f422aa82a51e7e64804d
|
@@ -15,18 +15,11 @@ module DRG
|
|
15
15
|
def perform
|
16
16
|
fail ArgumentError, %Q(File or directory does not exist: "#{file}") if !File.exists?(file) && !File.exists?("#{file}.rb")
|
17
17
|
ruby_files.each do |ruby_file|
|
18
|
-
file_path = Pathname.new(File.expand_path(ruby_file))
|
19
|
-
spec = DRG::Spec.generate(file_path)
|
20
|
-
unless spec
|
21
|
-
log "- #{ruby_file} - no methods", :gray
|
22
|
-
next
|
23
|
-
end
|
24
18
|
rspec_file = Pathname.new(spec_file(ruby_file))
|
25
19
|
spec_file_path = rspec_file.to_s[%r|/(spec/.+)|, 1]
|
26
|
-
if rspec_file.exist
|
27
|
-
|
28
|
-
|
29
|
-
end
|
20
|
+
next if rspec_file.exist?.tap { |result| log "- #{spec_file_path} - already exists", :gray if result }
|
21
|
+
spec = generate_spec(ruby_file)
|
22
|
+
next unless spec
|
30
23
|
log "+ #{spec_file_path}"
|
31
24
|
FileUtils.mkdir_p(rspec_file.parent)
|
32
25
|
File.open(rspec_file, 'wb') do |f|
|
@@ -35,6 +28,16 @@ module DRG
|
|
35
28
|
end
|
36
29
|
end
|
37
30
|
|
31
|
+
def generate_spec(ruby_file)
|
32
|
+
spec = DRG::Spec.generate Pathname.new(File.expand_path(ruby_file))
|
33
|
+
if spec
|
34
|
+
spec
|
35
|
+
else
|
36
|
+
log "- #{ruby_file} - no methods", :gray
|
37
|
+
nil
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
38
41
|
def ruby_files
|
39
42
|
if File.directory?(file)
|
40
43
|
Dir[File.join(file, '**', '*.rb')]
|
data/lib/drg/version.rb
CHANGED