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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1910c0f8c2bc805658481b0fe924c81178d6523
4
- data.tar.gz: 59a3de60bfcfa792a81cad5b23ba77cf569c259c
3
+ metadata.gz: 69c0e41819c37acab365f77c1c8659c765c5f5be
4
+ data.tar.gz: d9d5b708748bf54ba0bd88e6d4296f604ef87144
5
5
  SHA512:
6
- metadata.gz: e92fdb899f3ad0beba37ed43de71a7da699aaa0eb58496057f7632a1d3c1631479cac601f36a90423e61856e1ff30aa9e468d577ca0ef5699995b3b3cfb2449b
7
- data.tar.gz: 46c3e353e3a89151609f7621e92b7cdd07a5ff89897f10d5e75b26cc360c133b4c07222d8c22f40db3ff5d75019ff74da52e79d5b2945d80174dafe843d90966
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
- log "- #{spec_file_path} - already exists", :gray
28
- next
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
@@ -1,3 +1,3 @@
1
1
  module DRG
2
- VERSION = '0.15.2'.freeze
2
+ VERSION = '0.15.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.2
4
+ version: 0.15.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Buckley