Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/bundler/cli/outdated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def print_gems_table(gems_list)
)
end

print_indented([table_header] + data)
print_indented([table_header] + data, !options_include_groups)
end

def print_gem(current_spec, active_spec, dependency, groups)
Expand Down Expand Up @@ -294,7 +294,7 @@ def get_version_semver_portion_value(spec, version_portion_index)
version_section.to_a[0].to_i
end

def print_indented(matrix)
def print_indented(matrix, sort = true)
header = matrix[0]
data = matrix[1..-1]

Expand All @@ -304,7 +304,7 @@ def print_indented(matrix)

Bundler.ui.info justify(header, column_sizes)

data.sort_by! {|row| row[0] }
data.sort_by! {|row| row[0] } if sort

data.each do |row|
Bundler.ui.info justify(row, column_sizes)
Expand Down
6 changes: 5 additions & 1 deletion spec/commands/outdated_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ def test_group_option(group)
build_repo2 do
build_git "foo", path: lib_path("foo")
build_git "zebra", path: lib_path("zebra")
build_gem "zondrian", "1.2"
end

install_gemfile <<-G
Expand All @@ -284,6 +285,7 @@ def test_group_option(group)
group :development, :test do
gem 'activesupport', '2.3.5'
gem "duradura", '7.0'
gem "zondrian", '1.2'
end
G
end
Expand All @@ -298,15 +300,17 @@ def test_group_option(group)
build_gem "activesupport", "3.0"
build_gem "terranova", "9"
build_gem "duradura", "8.0"
build_gem "zondrian", "1.3"
end

bundle "outdated --groups", raise_on_error: false

expected_output = <<~TABLE.strip
Gem Current Latest Requested Groups Release Date
terranova 8 9 = 8 default
activesupport 2.3.5 3.0 = 2.3.5 development, test
duradura 7.0 8.0 = 7.0 development, test
terranova 8 9 = 8 default
zondrian 1.2 1.3 = 1.2 development, test
TABLE

expect(out).to end_with(expected_output)
Expand Down