Skip to content

Commit

Permalink
fix: parse development deps once
Browse files Browse the repository at this point in the history
  • Loading branch information
name committed Dec 4, 2024
1 parent 3af6e1f commit 37e9332
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/degem/gemfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def initialize(dsl)
end

def rubygems
@rubygems ||= gemfile_dependencies + gemspec_dependencies
@rubygems ||= (gemfile_dependencies + gemspec_dependencies).uniq
end

def rails?
Expand Down
3 changes: 2 additions & 1 deletion test/test_parse_gemfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def test_it_returns_the_parsed_gemfile_including_its_gemspec
spec.files = Dir.glob("lib/**/*") + Dir.glob("exe/*")
spec.authors = ["Riccardo Odone"]
spec.add_dependency "baz", "~> 1.0"
spec.add_development_dependency "foobar", "~> 1.0"
end
CONTENT

Expand All @@ -50,7 +51,7 @@ def test_it_returns_the_parsed_gemfile_including_its_gemspec
File.write(gemfile_path, "\ngemspec", mode: "a")
with_file(path: File.join("app", "bar.gemspec"), content: gemspec) do
actual = Degem::ParseGemfile.new.call(gemfile_path)
assert_array %w[foo bar baz], actual.rubygems.map(&:name)
assert_array %w[foo bar baz foobar], actual.rubygems.map(&:name)
end
end
end
Expand Down

0 comments on commit 37e9332

Please sign in to comment.