opened
zeljkofilipin
username_0
For example, mediawiki_selenium gem reports warnings when building the gem. Code example from commit [172518](https://gerrit.wikimedia.org/r/#/c/172518/):

```
$ gem build mediawiki_selenium.gemspec
WARNING:  open-ended dependency on redcarpet (>= 0, development) is not
recommended
  if redcarpet is semantically versioned, use:
    add_development_dependency 'redcarpet', '~> 0'
WARNING:  open-ended dependency on yard (>= 0, development) is not
recommended
  if yard is semantically versioned, use:
    add_development_dependency 'yard', '~> 0'
WARNING:  See http://guides.rubygems.org/specification-reference/ for
help
  Successfully built RubyGem
  Name: mediawiki_selenium
  Version: 0.4.1
  File: mediawiki_selenium-0.4.1.gem
```

I would like for the jenkins job that builds the gem to fail if there are any warnings. Looking at [gem build](http://guides.rubygems.org/command-reference/#gem-build) documentation, I do not see a way for the build to fail if there are any warnings.

What I am looking for is something like this:

```
$ gem build mediawiki_selenium.gemspec --strict
WARNING:  open-ended dependency on redcarpet (>= 0, development) is not
recommended
  if redcarpet is semantically versioned, use:
    add_development_dependency 'redcarpet', '~> 0'
...
Gem build failed because of warnings.
```

I have [asked](http://help.rubygems.org/discussions/questions/8986-can-gem-build-fail-if-there-are-_any_-warnings) at help.rubygems.org and got the answer to file a bug here.
Can "gem build" fail if there are _any_ warnings?
issue
created
djberg96
username_1
I like the idea, but wonder if this would be better suited as a plugin.
comment
created
segiddins
username_2
You can manually load up the gem spec and validate it for packaging in the interim, and I have an open PR to disallow warnings that I need to finish up.
comment
created
drbrain
username_3
It needs to be built-in, otherwise projects that build gems through API (not `gem build`) can't take advantage of it.
comment
created
djberg96
username_1
@username_3 Ok, sounds alright to me, then.

@username_0 we just need a PR now. :)
comment
created
drbrain
username_3
There's #1335 by @username_2 that is in-progress
comment
created
copiousfreetime
username_4
Calling this as a duplicate of #1334
comment
closed
copiousfreetime
username_4
issue