gem_bench 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.travis.yml +6 -6
- data/CHANGELOG +4 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +17 -18
- data/README.md +54 -32
- data/gem_bench.gemspec +3 -4
- data/lib/gem_bench/version.rb +1 -1
- metadata +7 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d0150f098c58edf7279abc13c963078e6e2a200c8191c9c123e2c4fd01dfc082
|
4
|
+
data.tar.gz: e9ce289e93f6949152cdc2440d0124b5b84c11c124678adcdf9d247fe89f5a4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e5f931b2ebc0df56cbf9a5e2b99dfa408d14aebaadb6b7897077f10be7d809f89b65dff0061f22b33e925330f88501a54e77ab0473020c1914c426650f39449
|
7
|
+
data.tar.gz: f5c3e302abf1b337081e06d4f77ce8eb2e1f49d2faf735d2336e4660df0f99a09cf5ebc8c3297b423bca7502a2db385010d72c4685bf5a69a6c1c36606d534ff
|
data/.travis.yml
CHANGED
data/CHANGELOG
CHANGED
data/Gemfile
CHANGED
@@ -2,5 +2,11 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
gem "bundler" # For specs!
|
4
4
|
|
5
|
+
group :test do
|
6
|
+
gem 'rubocop', '~> 0.53.0', platforms: [:mri_21, :mri_22, :mri_23, :mri_24, :mri_25]
|
7
|
+
gem 'rubocop-rspec', '~> 1.24.0', platforms: [:mri_21, :mri_22, :mri_23, :mri_24, :mri_25]
|
8
|
+
gem 'byebug', platforms: [:mri_22, :mri_23, :mri_24, :mri_25]
|
9
|
+
end
|
10
|
+
|
5
11
|
# Specify your gem's dependencies in gem_bench.gemspec
|
6
12
|
gemspec
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,21 @@
|
|
1
|
-
Copyright (c) 2013 Peter Boling
|
2
|
-
|
3
1
|
MIT License
|
4
2
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
the
|
3
|
+
Copyright (c) 2013 - 2018 Peter H. Boling, http://railsbling.com
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
12
11
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
15
14
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
OF
|
22
|
-
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# GemBench
|
1
|
+
# GemBench
|
2
2
|
|
3
3
|
`gem_bench` is for static Gemfile and installed gem library source code analysis.
|
4
4
|
|
@@ -7,8 +7,29 @@
|
|
7
7
|
Gem: "Put me in coach!"
|
8
8
|
You: ❨╯°□°❩╯︵┻━┻
|
9
9
|
|
10
|
-
|
10
|
+
| Project | GemBench |
|
11
|
+
|------------------------ | ----------------------- |
|
12
|
+
| gem name | [gem_bench](https://rubygems.org/gems/gem_bench) |
|
13
|
+
| license | [](https://opensource.org/licenses/MIT) |
|
14
|
+
| download rank | [](https://github.com/pboling/gem_bench) |
|
15
|
+
| version | [](https://rubygems.org/gems/gem_bench) |
|
16
|
+
| dependencies | [](https://depfu.com/github/pboling/activerecord-tablefree?project_id=5613) |
|
17
|
+
| continuous integration | [](https://travis-ci.org/pboling/gem_bench) |
|
18
|
+
| test coverage | [](https://codeclimate.com/github/pboling/gem_bench/test_coverage) |
|
19
|
+
| maintainability | [](https://codeclimate.com/github/pboling/gem_bench/maintainability) |
|
20
|
+
| code triage | [](https://www.codetriage.com/pboling/gem_bench) |
|
21
|
+
| homepage | [on Github.com][homepage] |
|
22
|
+
| documentation | [on Rdoc.info][documentation] |
|
23
|
+
| inline documenation | [](http://inch-ci.org/github/pboling/gem_bench) |
|
24
|
+
| live chat | [](https://gitter.im/pboling/gem_bench?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
|
25
|
+
| expert support | [](https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github) |
|
26
|
+
| Spread ~♡ⓛⓞⓥⓔ♡~ | [🌍 🌎 🌏](https://about.me/peter.boling), [🍚](https://www.crowdrise.com/helprefugeeswithhopefortomorrowliberia/fundraiser/peterboling), [➕](https://plus.google.com/+PeterBoling/posts), [👼](https://angel.co/peter-boling), [🐛](https://www.topcoder.com/members/pboling/), [:shipit:][coderwall], [](http://twitter.com/galtzo) |
|
11
27
|
|
28
|
+
### New for 1.0.2 - Gemfile specs
|
29
|
+
|
30
|
+
Version constraints are important. Give the Gemfile some love in your CI build
|
31
|
+
|
32
|
+
Create a `spec/gemfile_spec.rb` like:
|
12
33
|
```ruby
|
13
34
|
Rspec.describe "Gemfile" do
|
14
35
|
it("has version constraint on every gem") do
|
@@ -18,7 +39,27 @@ Rspec.describe "Gemfile" do
|
|
18
39
|
end
|
19
40
|
```
|
20
41
|
|
21
|
-
|
42
|
+
Then your build will fail as soon as a gem is added without a proper constraint:
|
43
|
+
|
44
|
+
```
|
45
|
+
Failures:
|
46
|
+
|
47
|
+
1) Gemfile has version constraint on every gem
|
48
|
+
Failure/Error: expect(requirements.list_missing_version_constraints).to eq([])
|
49
|
+
|
50
|
+
expected: []
|
51
|
+
got: ["puma"]
|
52
|
+
|
53
|
+
(compared using ==)
|
54
|
+
# ./spec/gemfile_spec.rb:7:in `block (2 levels) in <top (required)>'
|
55
|
+
```
|
56
|
+
|
57
|
+
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.
|
58
|
+
For string version constraints anything is allowed (e.g. `'~> 1.0'`), as it assumes the constraint placed is well considered.
|
59
|
+
|
60
|
+
### New for 1.0.0 - Find WAT Dragons in 3rd party source code
|
61
|
+
|
62
|
+
Search the Ruby source code of all the gems loaded by your Gemfile for a specified regex, to find out which gems have wat DRAGONS.
|
22
63
|
|
23
64
|
Gem: "I have no wat DRAGONS!"
|
24
65
|
You: ❨╯°□°❩╯︵┻━┻
|
@@ -30,34 +71,10 @@ You: ❨╯°□°❩╯︵┻━┻
|
|
30
71
|
byebug has wat DRAGONS at [["/Users/pboling/.rvm/gems/ruby-2.4.0@foss/gems/byebug-9.0.6/lib/byebug/commands/frame.rb", 954]]
|
31
72
|
=> nil
|
32
73
|
```
|
74
|
+
|
33
75
|
NOTE: The number (954, above) is not a line number. The file which contains the text `wat` was the 954th file evaluated, i.e. the number doesn't matter.
|
34
76
|
NOTE: This is a contrived example. The occurrence of `wat` in byebug is meaningless: `byebug/commands/frame.rb:34` has ` if there is a front end also watching over things.`. This is just an example! You can find anything you want, perhaps even something important!
|
35
77
|
|
36
|
-
| Project | GemBench |
|
37
|
-
|------------------------ | ----------------- |
|
38
|
-
| gem name | gem_bench |
|
39
|
-
| license | [](https://opensource.org/licenses/MIT) |
|
40
|
-
| expert support | [](https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github) |
|
41
|
-
| download rank | [](https://rubygems.org/gems/gem_bench) |
|
42
|
-
| version | [](http://badge.fury.io/rb/gem_bench) |
|
43
|
-
| dependencies | [](https://gemnasium.com/pboling/gem_bench) |
|
44
|
-
| code quality | [](https://codeclimate.com/github/pboling/gem_bench) |
|
45
|
-
| inline documenation | [](http://inch-ci.org/github/pboling/gem_bench) |
|
46
|
-
| continuous integration | [](https://travis-ci.org/pboling/gem_bench) |
|
47
|
-
| test coverage | [](https://coveralls.io/r/pboling/gem_bench) |
|
48
|
-
| homepage | [on Github.com][homepage] |
|
49
|
-
| documentation | [on Rdoc.info][documentation] |
|
50
|
-
| live chat | [](https://gitter.im/pboling/gem_bench?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
|
51
|
-
| Spread ~♡ⓛⓞⓥⓔ♡~ | [on Coderwall][coderwall] |
|
52
|
-
|
53
|
-
[semver]: http://semver.org/
|
54
|
-
[pvc]: http://docs.rubygems.org/read/chapter/16#page74
|
55
|
-
[railsbling]: http://www.railsbling.com
|
56
|
-
[peterboling]: http://www.peterboling.com
|
57
|
-
[coderwall]: http://coderwall.com/pboling
|
58
|
-
[documentation]: http://rdoc.info/github/pboling/gem_bench/frames
|
59
|
-
[homepage]: https://github.com/pboling/gem_bench
|
60
|
-
|
61
78
|
It is a fact of RubyGems that many of them do not need to be loaded by your app at boot time.
|
62
79
|
It is a fact of Bundler that you don't know which ones need to be 'required' while staring at the Gemfile.
|
63
80
|
It is a fact of Heroku that you only have 60, 75, or 120 ([by special request](https://devcenter.heroku.com/articles/error-codes#h20-app-boot-timeout)) precious seconds to get your app loaded before ❨╯°□°❩╯︵┻━┻
|
@@ -116,14 +133,14 @@ Find out what gems may be causing it by defining `context`!
|
|
116
133
|
```
|
117
134
|
>> require 'gem_bench'
|
118
135
|
=> true
|
119
|
-
>>
|
136
|
+
>> bad_context_maybes = GemBench.find(look_for_regex: /def context/).starters
|
120
137
|
[GemBench] Will search for gems in ["/Users/pboling/.rvm/gems/ruby-2.4.0@foss/gems", "/Users/pboling/.rvm/gems/ruby-2.4.0@global/gems", "/Users/pboling/.rvm/gems/ruby-2.4.0@foss/bundler/gems"]
|
121
138
|
[GemBench] Detected 11 loaded gems + 2 loaded gems which GemBench is configured to ignore.
|
122
139
|
=> [byebug, diff-lcs]
|
123
140
|
```
|
124
141
|
Then find the file with the first occurrence of the regex in each:
|
125
142
|
```
|
126
|
-
>>
|
143
|
+
>> bad_context_maybes.map { |bcm| bcm.stats.map(&:first) }
|
127
144
|
=> [["/Users/pboling/.rvm/gems/ruby-2.4.0@foss/gems/byebug-9.0.6/lib/byebug/command.rb"], ["/Users/pboling/.rvm/gems/ruby-2.4.0@foss/gems/diff-lcs-1.3/lib/diff/lcs/hunk.rb"]]
|
128
145
|
```
|
129
146
|
|
@@ -386,9 +403,14 @@ For example:
|
|
386
403
|
|
387
404
|
## Legal
|
388
405
|
|
389
|
-
* MIT
|
390
|
-
* Copyright (c) 2013 [Peter H. Boling]
|
406
|
+
* [](https://opensource.org/licenses/MIT)
|
407
|
+
* Copyright (c) 2013 - 2018 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
|
391
408
|
|
392
409
|
[semver]: http://semver.org/
|
393
410
|
[pvc]: http://docs.rubygems.org/read/chapter/16#page74
|
394
411
|
[bundle-group-pattern]: https://gist.github.com/pboling/4564780
|
412
|
+
[railsbling]: http://www.railsbling.com
|
413
|
+
[peterboling]: http://www.peterboling.com
|
414
|
+
[coderwall]: http://coderwall.com/pboling
|
415
|
+
[documentation]: http://rdoc.info/github/pboling/gem_bench/frames
|
416
|
+
[homepage]: https://github.com/pboling/gem_bench
|
data/gem_bench.gemspec
CHANGED
@@ -17,7 +17,7 @@ Trim down app load times by keeping your worst players on the bench (useful for
|
|
17
17
|
|
18
18
|
spec.licenses = ['MIT']
|
19
19
|
spec.platform = Gem::Platform::RUBY
|
20
|
-
spec.required_ruby_version = ">= 2.0.0" #
|
20
|
+
spec.required_ruby_version = ">= 2.0.0" # for named parameters with default values
|
21
21
|
|
22
22
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
23
23
|
f.match(%r{^(test|spec|features)/})
|
@@ -29,9 +29,8 @@ Trim down app load times by keeping your worst players on the bench (useful for
|
|
29
29
|
|
30
30
|
# Yes, it *is* actually a run-time dependency. This gem is sort of a bundler add-on.
|
31
31
|
spec.add_runtime_dependency "bundler", "~> 1.14"
|
32
|
-
spec.add_development_dependency "rake", "~>
|
32
|
+
spec.add_development_dependency "rake", "~> 12.2"
|
33
33
|
spec.add_development_dependency "rspec", "~> 3.5"
|
34
|
-
spec.add_development_dependency "
|
35
|
-
spec.add_development_dependency "gem-release", "~> 0.5"
|
34
|
+
spec.add_development_dependency "gem-release", "~> 2.0"
|
36
35
|
spec.add_development_dependency "awesome_print"
|
37
36
|
end
|
data/lib/gem_bench/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem_bench
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Boling
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '12.2'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '12.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,34 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.5'
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: byebug
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - "~>"
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '9.0'
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - "~>"
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '9.0'
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: gem-release
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
72
58
|
requirements:
|
73
59
|
- - "~>"
|
74
60
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0
|
61
|
+
version: '2.0'
|
76
62
|
type: :development
|
77
63
|
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
66
|
- - "~>"
|
81
67
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0
|
68
|
+
version: '2.0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: awesome_print
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -144,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
144
130
|
version: '0'
|
145
131
|
requirements: []
|
146
132
|
rubyforge_project:
|
147
|
-
rubygems_version: 2.
|
133
|
+
rubygems_version: 2.7.7
|
148
134
|
signing_key:
|
149
135
|
specification_version: 4
|
150
136
|
summary: Static Gemfile and installed gem library source code analysis
|