Skip to content

Commit

Permalink
Merge pull request #28 from rubygems/dep-req-space
Browse files Browse the repository at this point in the history
Remove trimming of space from requirements
  • Loading branch information
sonalkr132 authored May 25, 2020
2 parents 4d2c3ee + 5e581e8 commit ec1740b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/compact_index/gem_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def deps_line
end

def join_multiple(requirements)
requirements.gsub(/[[:space:]]/, "").split(",").sort.join("&")
requirements.split(", ").sort.join("&")
end
end
end
6 changes: 3 additions & 3 deletions spec/compact_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@
it "dependencies have platform" do
param = [build_version(:number => "1.0.1", :dependencies => [
CompactIndex::Dependency.new("a", "=1.1", "jruby", "abc123"),
CompactIndex::Dependency.new("b", "=1.2", "darwin-13", "abc123"),
CompactIndex::Dependency.new("b", "= 1.2", "darwin-13", "abc123"),
])]
expect(CompactIndex.info(param)).to eq("---\n1.0.1 a:=1.1-jruby,b:=1.2-darwin-13|checksum:sum+test_gem+1.0.1\n")
expect(CompactIndex.info(param)).to eq("---\n1.0.1 a:=1.1-jruby,b:= 1.2-darwin-13|checksum:sum+test_gem+1.0.1\n")
end

it "show ruby required version" do
Expand All @@ -95,7 +95,7 @@

it "show ruby required version with multiple requirements" do
param = [build_version(:number => "1.0.1", :ruby_version => "< 2.5, >=2.2")]
expect(CompactIndex.info(param)).to eq("---\n1.0.1 |checksum:sum+test_gem+1.0.1,ruby:<2.5&>=2.2\n")
expect(CompactIndex.info(param)).to eq("---\n1.0.1 |checksum:sum+test_gem+1.0.1,ruby:< 2.5&>=2.2\n")
end

it "show rubygems required version" do
Expand Down

0 comments on commit ec1740b

Please sign in to comment.