Skip to content

Commit 82597bd

Browse files
committed
Call parse_gemspec only if gemspec file found
Closes: #1
1 parent 312df2a commit 82597bd

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

gemfileparser/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,12 @@ def parse_gemfile(self, path=''):
167167
if len(gemspec_list) > 1:
168168
print("Multiple gemspec files found")
169169
continue
170-
gemspec_file = gemspec_list[0]
171-
self.parse_gemspec(path=os.path.join(gemfiledir, gemspec_file))
170+
elif len(gemspec_list) < 1:
171+
print("No gemspec file found. Ignoring the gemspec call")
172+
else:
173+
gemspec_file = gemspec_list[0]
174+
self.parse_gemspec(
175+
path=os.path.join(gemfiledir, gemspec_file))
172176
elif line.startswith('gem '):
173177
self.parse_line(line)
174178
return self.dependencies

0 commit comments

Comments
 (0)