Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Improve output from rspec -v. #2304

Merged
merged 1 commit into from
Jul 26, 2016
Merged

Improve output from rspec -v. #2304

merged 1 commit into from
Jul 26, 2016

Conversation

myronmarston
Copy link
Member

@myronmarston myronmarston commented Jul 25, 2016

Before this change, this confusing thing could happen:

$ gem install rspec -v 3.5.0 > /dev/null; rspec -v
3.5.1

The user installed RSpec 3.5.0 but rspec -v prints 3.5.1.
This happened because 3.5.0 of the rspec gem depends on 3.5.x
of all the sub-gems, and 3.5.1 is the latest rspec-core.

With this change, it now prints something like:

$ rspec -v
RSpec 3.5
  - rspec-core 3.5.1
  - rspec-expectations 3.5.0
  - rspec-mocks 3.5.0
  - rspec-rails not installed
  - rspec-support 3.5.0

@myronmarston myronmarston force-pushed the myron/version-improvement branch 2 times, most recently from d5eb656 to 80fcb24 Compare July 25, 2016 20:02
begin
require "rspec/#{lib_name}/version"
rescue LoadError
out.puts " - rspec-#{lib_name} not installed"
Copy link
Member

@JonRowe JonRowe Jul 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we need to bother with this, if it's not installed just don't list it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@myronmarston myronmarston force-pushed the myron/version-improvement branch from 80fcb24 to 0e0e206 Compare July 26, 2016 05:56
Before this change, this confusing thing could happen:

```
$ gem install rspec -v 3.5.0 > /dev/null; rspec -v
3.5.1
```

The user installed RSpec 3.5.0 but `rspec -v` prints 3.5.1.
This happened because 3.5.0 of the rspec gem depends on 3.5.x
of all the sub-gems, and 3.5.1 is the latest rspec-core.

With this change, it now prints something like:

```
$ rspec -v
RSpec 3.5
  - rspec-core 3.5.1
  - rspec-expectations 3.5.0
  - rspec-mocks 3.5.0
  - rspec-support 3.5.0
```
@myronmarston myronmarston force-pushed the myron/version-improvement branch from 0e0e206 to e448575 Compare July 26, 2016 06:04
@JonRowe JonRowe merged commit eb47ad0 into master Jul 26, 2016
@JonRowe JonRowe deleted the myron/version-improvement branch July 26, 2016 10:24
MatheusRich pushed a commit to MatheusRich/rspec-core that referenced this pull request Oct 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants