Skip to content

Commit

Permalink
Merge #2967
Browse files Browse the repository at this point in the history
2967: Set deprecation warning on query command r=bronzdoc a=bronzdoc

# Description:
We have been discouraging user for the use of the query command for a long time.
```
Summary:
    Query gem information in local or remote repositories

  Description:
    The query command is the basis for the list and search commands.

    You should really use the list and search commands instead.  This command
    is too hard to use.
```

 It's time to deprecate it.

This will setup a deprecation warning whenever is used.

______________
I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).


Co-authored-by: bronzdoc <lsagastume1990@gmail.com>
  • Loading branch information
bundlerbot and bronzdoc committed Nov 29, 2019
2 parents 3d14cd2 + 2e789c4 commit b89d261
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rubygems/commands/query_command.rb
Expand Up @@ -4,9 +4,13 @@
require 'rubygems/spec_fetcher'
require 'rubygems/version_option'
require 'rubygems/text'
require 'rubygems/deprecate'

class Gem::Commands::QueryCommand < Gem::Command

extend Gem::Deprecate
deprecate_command(2019, 12)

include Gem::Text
include Gem::LocalRemoteOptions
include Gem::VersionOption
Expand Down
4 changes: 4 additions & 0 deletions test/rubygems/test_gem_commands_query_command.rb
Expand Up @@ -844,6 +844,10 @@ def test_execute_exact_multiple
assert_equal expected, @stub_ui.output
end

def test_depprecated
assert @cmd.deprecated?
end

private

def add_gems_to_fetcher
Expand Down

0 comments on commit b89d261

Please sign in to comment.