Gemfile Specs! New for gem_bench v1.0.2

Gemfile Specs! New for 1.0.2

Version constraints are important. Give the Gemfile some love in your CI build

Create a spec/gemfile_spec.rb like:

Rspec.describe "Gemfile" do
  it("has version constraint on every gem") do
    requirements = GemBench::StrictVersionRequirement.new({verbose: false})
    expect(requirements.list_missing_version_constraints).to eq([])
  end
end

Then your build will fail as soon as a gem is added without a proper constraint:

Failures:

1) Gemfile has version constraint on every gem
Failure/Error: expect(requirements.list_missing_version_constraints).to eq([])

  expected: []
       got: ["puma"]

  (compared using ==)
# ./spec/gemfile_spec.rb:7:in `block (2 levels) in <top (required)>'

For :git/:github sources, :ref and :tag are considered as “constraints”, while :branch is not, because branches may be a moving target, and this gem aims to make Gemfiles production-ready. For string version constraints anything is allowed (e.g. '~> 1.0'), as it assumes the constraint placed is well considered.

What is gem_bench?

Ruby Gemfile analysis.

gem_bench is for static Gemfile and installed gem library source code analysis.

gem_bench can also be used to trim down app load times by keeping your worst players on the bench.

Gem: “Put me in coach!” You: ❨╯°□°❩╯︵┻━┻

Total Downloads Downloads Today Network Stars Version Build Maintainability Test Coverage Depfu Open Source Helpers Chat License: MIT

More Reading
Newer// CV
comments powered by Disqus