gem_bench 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -9,25 +9,33 @@ It is a fact of RubyGems that many of them do not need to be loaded by your app
9
9
  It is a fact of Bundler that you don't know which ones need to be 'required' while staring at the Gemfile.
10
10
  It is a fact of Heroku that you only have 60 precious seconds to get your app loaded before ❨╯°□°❩╯︵┻━┻
11
11
 
12
- This gem helps by telling you which gems are being loaded during app boot that don't need to be.
12
+ This gem helps by telling you which gems are don't need to be loaded during boot time.
13
+
14
+ You can even use it to evaluate your project's actual Gemfile for easy peasy boot time savings. (see Advanced Usage)
13
15
 
14
16
  ## Installation
15
17
 
16
- You **DO NOT** need to add this gem to your project.
18
+ You *may not* need to add this gem to your project. You have three options, 1, 2 or BEST:
17
19
 
18
20
  ### Option 1
19
21
 
20
- Just install it, and require it in your`irb`/`console` session when you want to use it.
22
+ Just install it, and require it in your`irb`/`console` session when you want to use it. However, if you load your console with `bundle exec` then you only have access to gems in the gemfile, so either load without `bundle exec` or add it to the `Gemfile`.
21
23
 
22
24
  $ gem install gem_bench
23
25
 
24
26
 
25
27
  ### Option 2
26
28
 
27
- If you decide to include it in your project: add this line to your Gemfile in the development group:
29
+ If you decide to include it in your project: add this line to your `Gemfile` in the `:development` group.
28
30
 
29
31
  gem 'gem_bench', :require => false, :group => :development
30
32
 
33
+ ### Option BEST
34
+
35
+ Or better yet [follow the bundle group pattern in your Gemfile][bundle-group-pattern] and setup a console group so it will only load in the console, and not the web app. With it loading only in the console session the `require: false` is completely optional. The gem is tiny, so won't impact console load time much. Requiring it will allow checking your `Gemfile` without needing to first `require 'gem_bench'`.
36
+
37
+ gem 'gem_bench', :group => :console
38
+
31
39
  And then execute:
32
40
 
33
41
  $ bundle
@@ -35,56 +43,396 @@ And then execute:
35
43
 
36
44
  ## Usage
37
45
 
38
- Fire up ab `irb` session or a `rails console` and then:
46
+ Fire up an `irb` session or a `rails console` and then:
39
47
 
40
48
  >> require 'gem_bench'
41
49
  => true
42
- >> team = GemBench.check(true) # true => print output, false => just returns a GemBench::Team object you can inspect.
50
+ >> team = GemBench.check({verbose: true}) # verbose: true => print output, verbose: false => just returns a GemBench::Team object you can inspect.
43
51
 
44
52
  Here is an example `irb` session where I have installed only `gem_bench`, `rails`, and `bundler`. For the first run I don't require any gems besides `gem_bench`.
45
53
 
46
54
  ∴ irb
47
55
  >> require 'gem_bench'
48
56
  => true
49
- >> team = GemBench.check(true) # true => print output, false => just returns a GemBench::Team object you can inspect.
50
- [GemBench] will search for gems in ["/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/gems", "/Users/pboling/.rvm/gems/ruby-1.9.3-head@global/gems", "/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/bundler/gems"]
51
- [GemBench] detected 0 loaded gems (2 will be skipped by GemBench)
52
- [GemBench] Found no gems to load at boot.
53
- [GemBench] 0 gems to skip require in Gemfile (require => false):
54
- => #<GemBench::Team:0x007fd4451207c0 @paths=["/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/gems", "/Users/pboling/.rvm/gems/ruby-1.9.3-head@global/gems", "/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/bundler/gems"], @excluded=[["bundler", "1.2.3"], ["gem_bench", "0.0.1"]], @all=[], @starters=[], @benchers=[], @verbose=true>
57
+ >> team = GemBench.check({verbose: true})
58
+ [GemBench] Will search for gems in ["/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/gems", "/Users/pboling/.rvm/gems/ruby-1.9.3-head@global/gems", "/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/bundler/gems"]
59
+ [GemBench] Will check Gemfile at /Users/pboling/Documents/src/my/gem_bench/Gemfile.
60
+ [GemBench] Detected 0 loaded gems
61
+ (excluding the 2 GemBench is configured to skip)
62
+ [GemBench] No gems were evaluated by GemBench.
63
+ [GemBench] Usage: Require another gem in this session to evaluate it.
64
+ Example:
65
+ require 'rails'
66
+ GemBench.check({verbose: true})
67
+ [GemBench] Evaluated 0 gems against your Gemfile but found no primary dependencies which can safely skip require on boot (require: false).
68
+
69
+ For the second run I `require 'rails'` as well, and now I can see which rails dependencies are required at boot time. I am in a project with a Gemfile, (gem_bench) but it doesn't depend on rails.
55
70
 
56
- For the second run I require rails, and now I can see which rails dependencies are not required at boot time:
71
+ irb
72
+ >> require 'gem_bench'
73
+ => true
74
+ >> require 'rails'
75
+ => true
76
+ >> team = GemBench.check({verbose: true})
77
+ [GemBench] Will search for gems in ["/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/gems", "/Users/pboling/.rvm/gems/ruby-1.9.3-head@global/gems", "/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/bundler/gems"]
78
+ [GemBench] Will check Gemfile at /Users/pboling/Documents/src/my/gem_bench/Gemfile.
79
+ [GemBench] Detected 14 loaded gems
80
+ (excluding the 2 GemBench is configured to skip)
81
+ [GemBench] You might want to verify that activesupport v3.2.13 really has a Rails::Railtie or Rails::Engine. Check these files:
82
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/gems/activesupport-3.2.11/lib/active_support/i18n_railtie.rb", 146]
83
+ [GemBench] You might want to verify that actionpack v3.2.13 really has a Rails::Railtie or Rails::Engine. Check these files:
84
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/gems/actionpack-3.2.11/lib/action_controller/railtie.rb", 248]
85
+ [GemBench] You might want to verify that railties v3.2.13 really has a Rails::Railtie or Rails::Engine. Check these files:
86
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/gems/railties-3.2.11/lib/rails/application/configuration.rb", 245]
87
+ [GemBench] If you want to check for false positives, the files to check for Railties and Engines are listed above.
88
+ [GemBench] 3 out of 14 evaluated gems actually need to be loaded at boot time. They are:
89
+ [SUGGESTION] 1) gem 'activesupport', '~> 3.2.13'
90
+ [SUGGESTION] 2) gem 'actionpack', '~> 3.2.13'
91
+ [SUGGESTION] 3) gem 'railties', '~> 3.2.13'
92
+ [GemBench] Evaluated 14 gems against your Gemfile but found no primary dependencies which can safely skip require on boot (require: false).
57
93
 
94
+ See that? Only 3 of the 14 gems rails loads need to be required when your app boots, technically!
95
+ However, in order to prevent loading them we would have to make them primary dependencies, listed in the Gemfile, which isn't really the best idea. Moving on...
96
+ If you run the check against a real app's Gemfile it will find numerous primary dependencies that don't need to be required at app boot. See Advanced Usage :)
97
+
98
+ In a random directory, in an irb session, where there is no Gemfile in sight it will give a lot more information:
99
+
100
+ ∴ irb
101
+ >> require 'gem_bench'
102
+ => true
58
103
  >> require 'rails'
59
104
  => true
60
- >> team = GemBench.check(true)
61
- [GemBench] will search for gems in ["/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/gems", "/Users/pboling/.rvm/gems/ruby-1.9.3-head@global/gems", "/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/bundler/gems"]
62
- [GemBench] detected 14 loaded gems (2 will be skipped by GemBench)
63
- You might want to verify that activesupport v3.2.13 really has a Railtie (or Rails::Engine). Check here:
105
+ >> team = GemBench.check({verbose: true})
106
+ [GemBench] Will search for gems in ["/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/gems", "/Users/pboling/.rvm/gems/ruby-1.9.3-head@global/gems"]
107
+ [GemBench] No Gemfile found.
108
+ [GemBench] Will show bad ideas. Be Careful.
109
+ [GemBench] Detected 14 loaded gems
110
+ (excluding the 2 GemBench is configured to skip)
111
+
112
+ [GemBench] Usage: Require another gem in this session to evaluate it.
113
+ Example:
114
+ require 'rails'
115
+ GemBench.check({verbose: true})
116
+ [GemBench] You might want to verify that activesupport v3.2.13 really has a Rails::Railtie or Rails::Engine. Check these files:
64
117
  ["/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/gems/activesupport-3.2.11/lib/active_support/i18n_railtie.rb", 146]
65
- You might want to verify that actionpack v3.2.13 really has a Railtie (or Rails::Engine). Check here:
118
+ [GemBench] You might want to verify that actionpack v3.2.13 really has a Rails::Railtie or Rails::Engine. Check these files:
66
119
  ["/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/gems/actionpack-3.2.11/lib/action_controller/railtie.rb", 248]
67
- You might want to verify that railties v3.2.13 really has a Railtie (or Rails::Engine). Check here:
120
+ [GemBench] You might want to verify that railties v3.2.13 really has a Rails::Railtie or Rails::Engine. Check these files:
68
121
  ["/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/gems/railties-3.2.11/lib/rails/application/configuration.rb", 245]
69
- [GemBench] 3 gems to load at boot:
70
- [GemBench] If you want to check for false positives, the files to check for Railties and Engines are listed above:
71
- gem 'activesupport', '~> 3.2.13'
72
- gem 'actionpack', '~> 3.2.13'
73
- gem 'railties', '~> 3.2.13'
74
- [GemBench] 11 gems to skip require in Gemfile (require => false):
75
- gem 'i18n', :require => false, '~> 0.6.1'
76
- gem 'builder', :require => false, '~> 3.0.4'
77
- gem 'activemodel', :require => false, '~> 3.2.13'
78
- gem 'rack-cache', :require => false, '~> 1.2'
79
- gem 'rack', :require => false, '~> 1.4.5'
80
- gem 'rack-test', :require => false, '~> 0.6.2'
81
- gem 'journey', :require => false, '~> 1.0.4'
82
- gem 'hike', :require => false, '~> 1.2.1'
83
- gem 'tilt', :require => false, '~> 1.3.3'
84
- gem 'sprockets', :require => false, '~> 2.2.2'
85
- gem 'erubis', :require => false, '~> 2.7.0'
86
-
87
- See that? Lots of those gems that rails brings don't need to be required when your app boots!
122
+ [GemBench] If you want to check for false positives, the files to check for Railties and Engines are listed above.
123
+ [GemBench] 3 out of 14 evaluated gems actually need to be loaded at boot time. They are:
124
+ [SUGGESTION] 1) gem 'activesupport', '~> 3.2.13'
125
+ [SUGGESTION] 2) gem 'actionpack', '~> 3.2.13'
126
+ [SUGGESTION] 3) gem 'railties', '~> 3.2.13'
127
+ [GemBench] Evaluated 14 loaded gems and found 11 which may be able to skip boot loading (require: false).
128
+ *** => WARNING <= ***: Be careful adding non-primary dependencies to your Gemfile as it is generally a bad idea.
129
+ To safely evaluate a Gemfile:
130
+ 1. Make sure you are in the root of a project with a Gemfile
131
+ 2. Make sure the gem is actually a dependency in the Gemfile
132
+ [BE CAREFUL] 1) gem 'i18n', require: false, '~> 0.6.1'
133
+ [BE CAREFUL] 2) gem 'builder', require: false, '~> 3.0.4'
134
+ [BE CAREFUL] 3) gem 'activemodel', require: false, '~> 3.2.13'
135
+ [BE CAREFUL] 4) gem 'rack-cache', require: false, '~> 1.2'
136
+ [BE CAREFUL] 5) gem 'rack', require: false, '~> 1.4.5'
137
+ [BE CAREFUL] 6) gem 'rack-test', require: false, '~> 0.6.2'
138
+ [BE CAREFUL] 7) gem 'journey', require: false, '~> 1.0.4'
139
+ [BE CAREFUL] 8) gem 'hike', require: false, '~> 1.2.1'
140
+ [BE CAREFUL] 9) gem 'tilt', require: false, '~> 1.3.3'
141
+ [BE CAREFUL] 10) gem 'sprockets', require: false, '~> 2.2.2'
142
+ [BE CAREFUL] 11) gem 'erubis', require: false, '~> 2.7.0'
143
+
144
+ ## Advanced Usage
145
+
146
+ In order to *also* see list gems may *not* be required at boot time you need to:
147
+
148
+ 1. Make sure you are in the root of a project with a Gemfile
149
+ 2. Make sure the gem is actually a dependency in the Gemfile
150
+
151
+ So here's a [*fat* Gemfile][bundle-group-pattern] weighing in at 265 gem dependencies. We'll use it for this example:
152
+
153
+ ∴ bundle exec rails console
154
+ Welcome to RAILS. You are using ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-darwin12.2.1]. Have fun ;)
155
+ Loading development environment (Rails 3.2.13)
156
+ [1] pry(main)> a = GemBench.check({verbose: true})
157
+ [GemBench] Will search for gems in ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems", "/Users/pboling/.rvm/gems/ruby-1.9.3-p392@global/gems", "/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/bundler/gems"]
158
+ [GemBench] Will check Gemfile at /Users/pboling/Documents/RubyMineProjects/simple/Gemfile.
159
+ [GemBench] Detected 265 loaded gems
160
+ (excluding the 2 GemBench is configured to skip)
161
+ [GemBench] You might want to verify that activesupport v3.2.13 really has a Rails::Railtie or Rails::Engine. Check these files:
162
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/activesupport-3.2.12/lib/active_support/i18n_railtie.rb", 146]
163
+ [GemBench] You might want to verify that sprockets v2.2.2 really has a Rails::Railtie or Rails::Engine. Check these files:
164
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/sprockets-rails-1.0.0/lib/sprockets/rails/railtie.rb", 495]
165
+ [GemBench] You might want to verify that actionpack v3.2.13 really has a Rails::Railtie or Rails::Engine. Check these files:
166
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/actionpack-3.2.12/lib/action_controller/railtie.rb", 248]
167
+ [GemBench] You might want to verify that actionmailer v3.2.13 really has a Rails::Railtie or Rails::Engine. Check these files:
168
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/actionmailer-3.2.12/lib/action_mailer/railtie.rb", 133]
169
+ [GemBench] You might want to verify that activerecord v3.2.13 really has a Rails::Railtie or Rails::Engine. Check these files:
170
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/activerecord-3.2.12/lib/active_record/railtie.rb", 409]
171
+ [GemBench] You might want to verify that activerecord-postgres-array v0.0.9 really has a Rails::Railtie or Rails::Engine. Check these files:
172
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/bundler/gems/activerecord-postgres-array-07c5291804a2/lib/activerecord-postgres-array.rb", 55]
173
+ [GemBench] You might want to verify that activerecord-postgres-hstore v0.7.6 really has a Rails::Railtie or Rails::Engine. Check these files:
174
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/activerecord-postgres-hstore-0.7.5/lib/activerecord-postgres-hstore/railties.rb", 226]
175
+ [GemBench] You might want to verify that activeresource v3.2.13 really has a Rails::Railtie or Rails::Engine. Check these files:
176
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/activeresource-3.2.12/lib/active_resource/railtie.rb", 83]
177
+ [GemBench] You might want to verify that railties v3.2.13 really has a Rails::Railtie or Rails::Engine. Check these files:
178
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/railties-3.2.12/lib/rails/application/configuration.rb", 245]
179
+ [GemBench] You might want to verify that acts-as-messageable v0.4.8 really has a Rails::Railtie or Rails::Engine. Check these files:
180
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/acts-as-messageable-0.4.8/lib/acts-as-messageable/railtie.rb", 110]
181
+ [GemBench] You might want to verify that airbrake v3.1.10 really has a Rails::Railtie or Rails::Engine. Check these files:
182
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/airbrake-3.1.10/lib/airbrake/railtie.rb", 109]
183
+ [GemBench] You might want to verify that asset_sync v0.5.4 really has a Rails::Railtie or Rails::Engine. Check these files:
184
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/asset_sync-0.5.4/lib/asset_sync/engine.rb", 34]
185
+ [GemBench] You might want to verify that slim v1.3.6 really has a Rails::Railtie or Rails::Engine. Check these files:
186
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/slim-rails-1.1.0/lib/slim-rails.rb", 81]
187
+ [GemBench] You might want to verify that sidekiq v2.10.0 really has a Rails::Railtie or Rails::Engine. Check these files:
188
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/sidekiq-2.7.4/lib/sidekiq/rails.rb", 290]
189
+ [GemBench] You might want to verify that aws-sdk v1.8.5 really has a Rails::Railtie or Rails::Engine. Check these files:
190
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/aws-sdk-1.8.3.1/lib/aws/rails.rb", 705]
191
+ [GemBench] You might want to verify that better_errors v0.8.0 really has a Rails::Railtie or Rails::Engine. Check these files:
192
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/better_errors-0.6.0/lib/better_errors/rails.rb", 51]
193
+ [GemBench] You might want to verify that sass v3.2.7 really has a Rails::Railtie or Rails::Engine. Check these files:
194
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/sass-rails-3.2.6/lib/sass/rails/railtie.rb", 68]
195
+ [GemBench] You might want to verify that bootstrap-sass v2.3.1.0 really has a Rails::Railtie or Rails::Engine. Check these files:
196
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/bootstrap-sass-2.3.0.1/lib/bootstrap-sass/engine.rb", 53]
197
+ [GemBench] You might want to verify that haml v4.0.1 really has a Rails::Railtie or Rails::Engine. Check these files:
198
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/haml-4.0.0/lib/haml/railtie.rb", 232]
199
+ [GemBench] You might want to verify that bullet v4.5.0 really has a Rails::Railtie or Rails::Engine. Check these files:
200
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/bullet-4.3.0/lib/bullet.rb", 683]
201
+ [GemBench] You might want to verify that parallel v0.6.4 really has a Rails::Railtie or Rails::Engine. Check these files:
202
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/parallel_tests-0.10.0/lib/parallel_tests/railtie.rb", 67]
203
+ [GemBench] You might want to verify that cells v3.8.8 really has a Rails::Railtie or Rails::Engine. Check these files:
204
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/cells-3.8.8/lib/cell/rails4_0_strategy.rb", 773]
205
+ [GemBench] You might want to verify that coffee-rails v3.2.2 really has a Rails::Railtie or Rails::Engine. Check these files:
206
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/coffee-rails-3.2.2/lib/coffee/rails/engine.rb", 74]
207
+ [GemBench] You might want to verify that compass v0.12.2 really has a Rails::Railtie or Rails::Engine. Check these files:
208
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/compass-rails-1.0.3/lib/compass-rails/railties/3_0.rb", 49]
209
+ [GemBench] You might want to verify that compass-rails v1.0.3 really has a Rails::Railtie or Rails::Engine. Check these files:
210
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/compass-rails-1.0.3/lib/compass-rails/railties/3_0.rb", 49]
211
+ [GemBench] You might want to verify that csv_pirate v5.0.7 really has a Rails::Railtie or Rails::Engine. Check these files:
212
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/csv_pirate-5.0.7/lib/csv_pirate/railtie.rb", 35]
213
+ [GemBench] You might want to verify that devise v2.2.3 really has a Rails::Railtie or Rails::Engine. Check these files:
214
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/devise-2.2.3/lib/devise/rails.rb", 101]
215
+ [GemBench] You might want to verify that devise_invitable v1.1.3 really has a Rails::Railtie or Rails::Engine. Check these files:
216
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/bundler/gems/devise_invitable-5af50a925e0a/lib/devise_invitable/rails.rb", 42]
217
+ [GemBench] You might want to verify that rails v3.2.13 really has a Rails::Railtie or Rails::Engine. Check these files:
218
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/bundler/gems/rails_admin-05a029da6fab/lib/rails_admin/engine.rb", 373]
219
+ [GemBench] You might want to verify that dismissible_helpers v0.1.5 really has a Rails::Railtie or Rails::Engine. Check these files:
220
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/dismissible_helpers-0.1.5/lib/dismissible_helpers/engine.rb", 44]
221
+ [GemBench] You might want to verify that dotenv v0.6.0 really has a Rails::Railtie or Rails::Engine. Check these files:
222
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/dotenv-0.5.0/lib/dotenv/railtie.rb", 32]
223
+ [GemBench] You might want to verify that dry_views v0.0.2 really has a Rails::Railtie or Rails::Engine. Check these files:
224
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/dry_views-0.0.2/lib/dry_views/railtie.rb", 138]
225
+ [GemBench] You might want to verify that sass-rails v3.2.6 really has a Rails::Railtie or Rails::Engine. Check these files:
226
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/sass-rails-3.2.6/lib/sass/rails/railtie.rb", 68]
227
+ [GemBench] You might want to verify that font-awesome-sass-rails v3.0.2.2 really has a Rails::Railtie or Rails::Engine. Check these files:
228
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/font-awesome-sass-rails-3.0.2.2/lib/font-awesome-sass-rails/engine.rb", 89]
229
+ [GemBench] You might want to verify that foundation-icons-sass-rails v2.0.0 really has a Rails::Railtie or Rails::Engine. Check these files:
230
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/foundation-icons-sass-rails-2.0.0/lib/foundation-icons-sass-rails/engine.rb", 95]
231
+ [GemBench] You might want to verify that g v1.7.2 really has a Rails::Railtie or Rails::Engine. Check these files:
232
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/gem_bench-0.0.2/lib/gem_bench/team.rb", 2462]
233
+ [GemBench] You might want to verify that geocoder v1.1.6 really has a Rails::Railtie or Rails::Engine. Check these files:
234
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/geocoder-1.1.6/lib/geocoder/railtie.rb", 90]
235
+ [GemBench] You might want to verify that geokit v1.6.5 really has a Rails::Railtie or Rails::Engine. Check these files:
236
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/bundler/gems/geokit-rails3-9988045e1c4b/lib/geokit-rails3/railtie.rb", 76]
237
+ [GemBench] You might want to verify that geokit-rails3 v0.1.5 really has a Rails::Railtie or Rails::Engine. Check these files:
238
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/bundler/gems/geokit-rails3-9988045e1c4b/lib/geokit-rails3/railtie.rb", 76]
239
+ [GemBench] You might want to verify that pry v0.9.12 really has a Rails::Railtie or Rails::Engine. Check these files:
240
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/pry-rails-0.2.2/lib/pry-rails/railtie.rb", 53]
241
+ [GemBench] You might want to verify that rspec v2.13.0 really has a Rails::Railtie or Rails::Engine. Check these files:
242
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/rspec-rails-2.12.2/lib/rspec-rails.rb", 50]
243
+ [GemBench] You might want to verify that spork v1.0.0rc3 really has a Rails::Railtie or Rails::Engine. Check these files:
244
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/spork-rails-3.2.1/lib/spork/app_framework/rails.rb", 1267]
245
+ [GemBench] You might want to verify that haml-rails v0.4 really has a Rails::Railtie or Rails::Engine. Check these files:
246
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/haml-rails-0.4/lib/haml-rails.rb", 81]
247
+ [GemBench] You might want to verify that handlebars_assets v0.12.0 really has a Rails::Railtie or Rails::Engine. Check these files:
248
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/handlebars_assets-0.12.0/lib/handlebars_assets/engine.rb", 43]
249
+ [GemBench] You might want to verify that hirefire-resource v0.0.2 really has a Rails::Railtie or Rails::Engine. Check these files:
250
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/hirefire-resource-0.0.2/lib/hirefire/railtie.rb", 55]
251
+ [GemBench] You might want to verify that jquery-rails v2.2.1 really has a Rails::Railtie or Rails::Engine. Check these files:
252
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/jquery-rails-2.1.4/lib/jquery/rails/engine.rb", 50]
253
+ [GemBench] You might want to verify that html5-rails v0.0.7 really has a Rails::Railtie or Rails::Engine. Check these files:
254
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/html5-rails-0.0.6/lib/html5/rails/engine.rb", 49]
255
+ [GemBench] You might want to verify that jquery-ui-rails v3.0.1 really has a Rails::Railtie or Rails::Engine. Check these files:
256
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/jquery-ui-rails-3.0.1/lib/jquery/ui/rails/engine.rb", 66]
257
+ [GemBench] You might want to verify that kaminari v0.14.1 really has a Rails::Railtie or Rails::Engine. Check these files:
258
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/kaminari-0.14.1/lib/kaminari/engine.rb", 44]
259
+ [GemBench] You might want to verify that neography v1.0.9 really has a Rails::Railtie or Rails::Engine. Check these files:
260
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/neography-1.0.6/lib/neography/railtie.rb", 52]
261
+ [GemBench] You might want to verify that neoid v0.1.2 really has a Rails::Railtie or Rails::Engine. Check these files:
262
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/neoid-0.1.2/lib/neoid/railtie.rb", 59]
263
+ [GemBench] You might want to verify that nested_form v0.3.2 really has a Rails::Railtie or Rails::Engine. Check these files:
264
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/nested_form-0.3.1/lib/nested_form/engine.rb", 54]
265
+ [GemBench] You might want to verify that newrelic_rpm v3.6.0.78 really has a Rails::Railtie or Rails::Engine. Check these files:
266
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/newrelic_rpm-3.5.5.540.dev/lib/newrelic_rpm.rb", 863]
267
+ [GemBench] You might want to verify that parallel_tests v0.10.4 really has a Rails::Railtie or Rails::Engine. Check these files:
268
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/parallel_tests-0.10.0/lib/parallel_tests/railtie.rb", 67]
269
+ [GemBench] You might want to verify that pg v0.15.0 really has a Rails::Railtie or Rails::Engine. Check these files:
270
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/pg_power-1.3.0/lib/pg_power/engine.rb", 43]
271
+ [GemBench] You might want to verify that rspec-rails v2.13.0 really has a Rails::Railtie or Rails::Engine. Check these files:
272
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/rspec-rails-2.12.2/lib/rspec-rails.rb", 50]
273
+ [GemBench] You might want to verify that pg_power v1.3.1 really has a Rails::Railtie or Rails::Engine. Check these files:
274
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/pg_power-1.3.0/lib/pg_power/engine.rb", 43]
275
+ [GemBench] You might want to verify that pry-rails v0.2.2 really has a Rails::Railtie or Rails::Engine. Check these files:
276
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/pry-rails-0.2.2/lib/pry-rails/railtie.rb", 53]
277
+ [GemBench] You might want to verify that quiet_assets v1.0.2 really has a Rails::Railtie or Rails::Engine. Check these files:
278
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/quiet_assets-1.0.2/lib/quiet_assets.rb", 38]
279
+ [GemBench] You might want to verify that remotipart v1.0.5 really has a Rails::Railtie or Rails::Engine. Check these files:
280
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/remotipart-1.0.5/lib/remotipart/rails/engine.rb", 77]
281
+ [GemBench] You might want to verify that rails_admin v0.4.6 really has a Rails::Railtie or Rails::Engine. Check these files:
282
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/bundler/gems/rails_admin-05a029da6fab/lib/rails_admin/engine.rb", 373]
283
+ [GemBench] You might want to verify that requirejs-rails v0.9.1.1 really has a Rails::Railtie or Rails::Engine. Check these files:
284
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/requirejs-rails-0.9.0/lib/requirejs/rails/engine.rb", 107]
285
+ [GemBench] You might want to verify that rolify v3.2.0 really has a Rails::Railtie or Rails::Engine. Check these files:
286
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/rolify-3.2.0/lib/rolify/railtie.rb", 66]
287
+ [GemBench] You might want to verify that rspec-cells v0.1.6 really has a Rails::Railtie or Rails::Engine. Check these files:
288
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/bundler/gems/rspec-cells-47232afed355/lib/rspec-cells.rb", 50]
289
+ [GemBench] You might want to verify that sanitize_email v1.0.6 really has a Rails::Railtie or Rails::Engine. Check these files:
290
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/sanitize_email-1.0.6/lib/sanitize_email/engine.rb", 144]
291
+ [GemBench] You might want to verify that simplecov v0.7.1 really has a Rails::Railtie or Rails::Engine. Check these files:
292
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/simplecov-0.7.1/lib/simplecov/railtie.rb", 37]
293
+ [GemBench] You might want to verify that spork-rails v3.2.1 really has a Rails::Railtie or Rails::Engine. Check these files:
294
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/spork-rails-3.2.1/lib/spork/app_framework/rails.rb", 1267]
295
+ [GemBench] You might want to verify that sprockets-rails v0.0.1 really has a Rails::Railtie or Rails::Engine. Check these files:
296
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/sprockets-rails-1.0.0/lib/sprockets/rails/railtie.rb", 495]
297
+ [GemBench] You might want to verify that stackable_flash v0.0.7 really has a Rails::Railtie or Rails::Engine. Check these files:
298
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/stackable_flash-0.0.7/lib/stackable_flash/railtie.rb", 40]
299
+ [GemBench] You might want to verify that state_machine v1.2.0 really has a Rails::Railtie or Rails::Engine. Check these files:
300
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/state_machine-1.1.2/lib/state_machine/initializers/rails.rb", 262]
301
+ [GemBench] You might want to verify that teabag v0.4.6 really has a Rails::Railtie or Rails::Engine. Check these files:
302
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/bundler/gems/teabag-0d3fde2505b9/lib/teabag/engine.rb", 33]
303
+ [GemBench] You might want to verify that turbo-sprockets-rails3 v0.3.6 really has a Rails::Railtie or Rails::Engine. Check these files:
304
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/turbo-sprockets-rails3-0.3.6/lib/turbo-sprockets/railtie.rb", 179]
305
+ [GemBench] You might want to verify that turbolinks v1.1.1 really has a Rails::Railtie or Rails::Engine. Check these files:
306
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/turbolinks-0.6.1/lib/turbolinks.rb", 650]
307
+ [GemBench] You might want to verify that zurb-foundation v4.1.1 really has a Rails::Railtie or Rails::Engine. Check these files:
308
+ ["/Users/pboling/.rvm/gems/ruby-1.9.3-p392@simple/gems/zurb-foundation-3.2.5/lib/foundation/engine.rb", 35]
309
+ [GemBench] If you want to check for false positives, the files to check for Railties and Engines are listed above.
310
+ [GemBench] 74 out of 265 evaluated gems actually need to be loaded at boot time. They are:
311
+ [SUGGESTION] 1) gem 'activesupport', '~> 3.2.13'
312
+ [SUGGESTION] 2) gem 'sprockets', '~> 2.2.2'
313
+ [SUGGESTION] 3) gem 'actionpack', '~> 3.2.13'
314
+ [SUGGESTION] 4) gem 'actionmailer', '~> 3.2.13'
315
+ [SUGGESTION] 5) gem 'activerecord', '~> 3.2.13'
316
+ [SUGGESTION] 6) gem 'activerecord-postgres-array', '~> 0.0.9'
317
+ [SUGGESTION] 7) gem 'activerecord-postgres-hstore', '~> 0.7.6'
318
+ [SUGGESTION] 8) gem 'activeresource', '~> 3.2.13'
319
+ [SUGGESTION] 9) gem 'railties', '~> 3.2.13'
320
+ [SUGGESTION] 10) gem 'acts-as-messageable', '~> 0.4.8'
321
+ [SUGGESTION] 11) gem 'airbrake', '~> 3.1.10'
322
+ [SUGGESTION] 12) gem 'asset_sync', '~> 0.5.4'
323
+ [SUGGESTION] 13) gem 'slim', '~> 1.3.6'
324
+ [SUGGESTION] 14) gem 'sidekiq', '~> 2.10.0'
325
+ [SUGGESTION] 15) gem 'aws-sdk', '~> 1.8.5'
326
+ [SUGGESTION] 16) gem 'better_errors', '~> 0.8.0'
327
+ [SUGGESTION] 17) gem 'sass', '~> 3.2.7'
328
+ [SUGGESTION] 18) gem 'bootstrap-sass', '~> 2.3.1.0'
329
+ [SUGGESTION] 19) gem 'haml', '~> 4.0.1'
330
+ [SUGGESTION] 20) gem 'bullet', '~> 4.5.0'
331
+ [SUGGESTION] 21) gem 'parallel', '~> 0.6.4'
332
+ [SUGGESTION] 22) gem 'cells', '~> 3.8.8'
333
+ [SUGGESTION] 23) gem 'coffee-rails', '~> 3.2.2'
334
+ [SUGGESTION] 24) gem 'compass', '~> 0.12.2'
335
+ [SUGGESTION] 25) gem 'compass-rails', '~> 1.0.3'
336
+ [SUGGESTION] 26) gem 'csv_pirate', '~> 5.0.7'
337
+ [SUGGESTION] 27) gem 'devise', '~> 2.2.3'
338
+ [SUGGESTION] 28) gem 'devise_invitable', '~> 1.1.3'
339
+ [SUGGESTION] 29) gem 'rails', '~> 3.2.13'
340
+ [SUGGESTION] 30) gem 'dismissible_helpers', '~> 0.1.5'
341
+ [SUGGESTION] 31) gem 'dotenv', '~> 0.6.0'
342
+ [SUGGESTION] 32) gem 'dry_views', '~> 0.0.2'
343
+ [SUGGESTION] 33) gem 'sass-rails', '~> 3.2.6'
344
+ [SUGGESTION] 34) gem 'font-awesome-sass-rails', '~> 3.0.2.2'
345
+ [SUGGESTION] 35) gem 'foundation-icons-sass-rails', '~> 2.0.0'
346
+ [SUGGESTION] 36) gem 'g', '~> 1.7.2'
347
+ [SUGGESTION] 37) gem 'geocoder', '~> 1.1.6'
348
+ [SUGGESTION] 38) gem 'geokit', '~> 1.6.5'
349
+ [SUGGESTION] 39) gem 'geokit-rails3', '~> 0.1.5'
350
+ [SUGGESTION] 40) gem 'pry', '~> 0.9.12'
351
+ [SUGGESTION] 41) gem 'rspec', '~> 2.13.0'
352
+ [SUGGESTION] 42) gem 'spork', '~> 1.0.0rc3'
353
+ [SUGGESTION] 43) gem 'haml-rails', '~> 0.4'
354
+ [SUGGESTION] 44) gem 'handlebars_assets', '~> 0.12.0'
355
+ [SUGGESTION] 45) gem 'hirefire-resource', '~> 0.0.2'
356
+ [SUGGESTION] 46) gem 'jquery-rails', '~> 2.2.1'
357
+ [SUGGESTION] 47) gem 'html5-rails', '~> 0.0.7'
358
+ [SUGGESTION] 48) gem 'jquery-ui-rails', '~> 3.0.1'
359
+ [SUGGESTION] 49) gem 'kaminari', '~> 0.14.1'
360
+ [SUGGESTION] 50) gem 'neography', '~> 1.0.9'
361
+ [SUGGESTION] 51) gem 'neoid', '~> 0.1.2'
362
+ [SUGGESTION] 52) gem 'nested_form', '~> 0.3.2'
363
+ [SUGGESTION] 53) gem 'newrelic_rpm', '~> 3.6.0.78'
364
+ [SUGGESTION] 54) gem 'parallel_tests', '~> 0.10.4'
365
+ [SUGGESTION] 55) gem 'pg', '~> 0.15.0'
366
+ [SUGGESTION] 56) gem 'rspec-rails', '~> 2.13.0'
367
+ [SUGGESTION] 57) gem 'pg_power', '~> 1.3.1'
368
+ [SUGGESTION] 58) gem 'pry-rails', '~> 0.2.2'
369
+ [SUGGESTION] 59) gem 'quiet_assets', '~> 1.0.2'
370
+ [SUGGESTION] 60) gem 'remotipart', '~> 1.0.5'
371
+ [SUGGESTION] 61) gem 'rails_admin', '~> 0.4.6'
372
+ [SUGGESTION] 62) gem 'requirejs-rails', '~> 0.9.1.1'
373
+ [SUGGESTION] 63) gem 'rolify', '~> 3.2.0'
374
+ [SUGGESTION] 64) gem 'rspec-cells', '~> 0.1.6'
375
+ [SUGGESTION] 65) gem 'sanitize_email', '~> 1.0.6'
376
+ [SUGGESTION] 66) gem 'simplecov', '~> 0.7.1'
377
+ [SUGGESTION] 67) gem 'spork-rails', '~> 3.2.1'
378
+ [SUGGESTION] 68) gem 'sprockets-rails', '~> 0.0.1'
379
+ [SUGGESTION] 69) gem 'stackable_flash', '~> 0.0.7'
380
+ [SUGGESTION] 70) gem 'state_machine', '~> 1.2.0'
381
+ [SUGGESTION] 71) gem 'teabag', '~> 0.4.6'
382
+ [SUGGESTION] 72) gem 'turbo-sprockets-rails3', '~> 0.3.6'
383
+ [SUGGESTION] 73) gem 'turbolinks', '~> 1.1.1'
384
+ [SUGGESTION] 74) gem 'zurb-foundation', '~> 4.1.1'
385
+ [GemBench] Evaluated 265 gems and Gemfile at /Users/pboling/Documents/RubyMineProjects/simple/Gemfile.
386
+ [GemBench] Here are 45 suggestions for improvement:
387
+ [SUGGESTION] 1) gem 'tilt', require: false, '~> 1.3.6'
388
+ [SUGGESTION] 2) gem 'json', require: false, '~> 1.7.7'
389
+ [SUGGESTION] 3) gem 'annotate', require: false, '~> 2.5.0'
390
+ [SUGGESTION] 4) gem 'nokogiri', require: false, '~> 1.5.9'
391
+ [SUGGESTION] 5) gem 'redis', require: false, '~> 3.0.3'
392
+ [SUGGESTION] 6) gem 'sinatra', require: false, '~> 1.3.6'
393
+ [SUGGESTION] 7) gem 'autoscaler', require: false, '~> 0.2.1'
394
+ [SUGGESTION] 8) gem 'binding_of_caller', require: false, '~> 0.7.1'
395
+ [SUGGESTION] 9) gem 'bourne', require: false, '~> 1.4.0'
396
+ [SUGGESTION] 10) gem 'brakeman', require: false, '~> 1.9.5'
397
+ [SUGGESTION] 11) gem 'cancan', require: false, '~> 1.6.9'
398
+ [SUGGESTION] 12) gem 'capybara', require: false, '~> 2.0.3'
399
+ [SUGGESTION] 13) gem 'chronic', require: false, '~> 0.9.1'
400
+ [SUGGESTION] 14) gem 'compass-h5bp', require: false, '~> 0.1.1'
401
+ [SUGGESTION] 15) gem 'database_cleaner', require: false, '~> 0.9.1'
402
+ [SUGGESTION] 16) gem 'debugger', require: false, '~> 1.5.0'
403
+ [SUGGESTION] 17) gem 'devise-async', require: false, '~> 0.7.0'
404
+ [SUGGESTION] 18) gem 'dotenv-rails', require: false, '~> 0.6.0'
405
+ [SUGGESTION] 19) gem 'email_spec', require: false, '~> 1.4.0'
406
+ [SUGGESTION] 20) gem 'fabrication', require: false, '~> 2.6.4'
407
+ [SUGGESTION] 21) gem 'fakeweb', require: false, '~> 1.3.0'
408
+ [SUGGESTION] 22) gem 'flag_shih_tzu', require: false, '~> 0.3.2'
409
+ [SUGGESTION] 23) gem 'friendly_id', require: false, '~> 4.0.9'
410
+ [SUGGESTION] 24) gem 'guard', require: false, '~> 1.7.0'
411
+ [SUGGESTION] 25) gem 'guard-rspec', require: false, '~> 2.5.2'
412
+ [SUGGESTION] 26) gem 'i18n-airbrake', require: false, '~> 0.0.2'
413
+ [SUGGESTION] 27) gem 'km', require: false, '~> 1.1.3'
414
+ [SUGGESTION] 28) gem 'localtunnel', require: false, '~> 0.3'
415
+ [SUGGESTION] 29) gem 'mailcatcher', require: false, '~> 0.5.10'
416
+ [SUGGESTION] 30) gem 'numbers_and_words', require: false, '~> 0.6.0'
417
+ [SUGGESTION] 31) gem 'oj', require: false, '~> 2.0.10'
418
+ [SUGGESTION] 32) gem 'omniauth-facebook', require: false, '~> 1.4.1'
419
+ [SUGGESTION] 33) gem 'poltergeist', require: false, '~> 1.0.2'
420
+ [SUGGESTION] 34) gem 'pry-doc', require: false, '~> 0.4.5'
421
+ [SUGGESTION] 35) gem 'puma', require: false, '~> 2.0.0.b7'
422
+ [SUGGESTION] 36) gem 'queryable_array', require: false, '~> 0.0.1'
423
+ [SUGGESTION] 37) gem 'rails_best_practices', require: false, '~> 1.13.4'
424
+ [SUGGESTION] 38) gem 'redcarpet', require: false, '~> 2.2.2'
425
+ [SUGGESTION] 39) gem 'redis-rails', require: false, '~> 3.2.3'
426
+ [SUGGESTION] 40) gem 'shoulda-matchers', require: false, '~> 1.4.2'
427
+ [SUGGESTION] 41) gem 'sidekiq-status', require: false, '~> 0.3.0'
428
+ [SUGGESTION] 42) gem 'terminal-notifier', require: false, '~> 1.4.2'
429
+ [SUGGESTION] 43) gem 'test-unit', require: false, '~> 2.5.4'
430
+ [SUGGESTION] 44) gem 'uglifier', require: false, '~> 1.3.0'
431
+ [SUGGESTION] 45) gem 'vestal_versions', require: false, '~> 1.2.3'
432
+
433
+ If found 45 gems which are listed as primary dependencies in my `Gemfile` which I can add `require: false` to.
434
+
435
+ How much faster will my app boot loading 45 fewer gems? A bit.
88
436
 
89
437
  ## Contributing
90
438
 
@@ -111,10 +459,11 @@ For example:
111
459
 
112
460
  spec.add_dependency 'gem_bench', '~> 0.0'
113
461
 
114
- [semver]: http://semver.org/
115
- [pvc]: http://docs.rubygems.org/read/chapter/16#page74
116
-
117
462
  ## Legal
118
463
 
119
464
  * MIT License
120
465
  * Copyright (c) 2013 [Peter H. Boling](http://www.railsbling.com), and Acquaintable [http://acquaintable.com/]
466
+
467
+ [semver]: http://semver.org/
468
+ [pvc]: http://docs.rubygems.org/read/chapter/16#page74
469
+ [bundle-group-pattern]: https://gist.github.com/pboling/4564780
@@ -1,8 +1,6 @@
1
1
  module GemBench
2
2
  class Player
3
3
 
4
- DO_NOT_SCAN = []
5
-
6
4
  attr_accessor :name, :version, :state, :stats
7
5
 
8
6
  def initialize(options = {})
@@ -13,25 +11,30 @@ module GemBench
13
11
  end
14
12
 
15
13
  def path_glob
16
- "#{self.name}*/lib/**/*.rb"
14
+ GemBench::PATH_GLOB.call(self.name)
17
15
  end
18
16
 
19
17
  def set_starter(file_path)
20
18
  scan = begin
21
- if DO_NOT_SCAN.include? self.name
19
+ if GemBench::DO_NOT_SCAN.include? self.name
22
20
  false
23
21
  else
24
- File.read(file_path) =~ /Rails::Engine|Rails::Railtie/
22
+ File.read(file_path) =~ GemBench::RAILTIE_REGEX
25
23
  end
26
24
  end
27
25
  self.stats << [file_path,scan] if scan
28
26
  self.state = !!scan ?
29
- 'starter' :
30
- 'bench'
27
+ GemBench::PLAYER_STATES[:starter] :
28
+ GemBench::PLAYER_STATES[:bench]
31
29
  end
32
30
 
33
31
  def starter?
34
- self.state == 'starter'
32
+ self.state == GemBench::PLAYER_STATES[:starter]
33
+ end
34
+
35
+ # Used to find the line of the Gemfile which creates the primary dependency on this gem
36
+ def gemfile_regex
37
+ GemBench::DEPENDENCY_REGEX.call(self.name)
35
38
  end
36
39
 
37
40
  def to_s
@@ -39,11 +42,20 @@ module GemBench
39
42
  end
40
43
 
41
44
  def how
42
- case state
43
- when 'starter' then "gem '#{self.name}', '~> #{self.version}'"
44
- when 'bench' then "gem '#{self.name}', :require => false, '~> #{self.version}'"
45
- else "I'm not sure where I am."
45
+ case self.state
46
+ when GemBench::PLAYER_STATES[:starter] then "gem '#{self.name}', '~> #{self.version}'"
47
+ when GemBench::PLAYER_STATES[:bench] then "gem '#{self.name}', require: false, '~> #{self.version}'"
48
+ else "#{self} is feeling very lost right now."
46
49
  end
47
50
  end
51
+
52
+ def suggest(num)
53
+ "\t[SUGGESTION] #{num}) #{self.how}"
54
+ end
55
+
56
+ def careful(num)
57
+ "\t[BE CAREFUL] #{num}) #{self.how}"
58
+ end
59
+
48
60
  end
49
61
  end
@@ -2,56 +2,130 @@ module GemBench
2
2
  class Team
3
3
 
4
4
  EXCLUDE = ['bundler','gem_bench']
5
+ # A comment preceding the require: false anywhere on the line should not be considered an active require: false
5
6
 
6
- attr_accessor :paths, :all, :excluded, :starters, :benchers, :verbose
7
7
 
8
- def initialize(verbose = false)
9
- #>> Bundler.install_path
10
- #=> #<Pathname:/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss/bundler/gems>
11
- #>> Bundler.bundle_path
12
- #=> #<Pathname:/Users/pboling/.rvm/gems/ruby-1.9.3-head@foss>
8
+ attr_accessor :paths, :all, :excluded, :starters, :benchers, :verbose, :gemfile_lines, :trash_lines, :check_gemfile, :current_gemfile_suggestions, :bad_ideas, :gemfile_path
9
+
10
+ def initialize(options = {})
13
11
  possibles = [Bundler.rubygems.gem_dir, Bundler.rubygems.gem_path]
14
12
  @paths = possibles.flatten.compact.uniq.map {|x| x.to_s }.reject { |p| p.empty? }.map {|x| "#{x}/gems" }
15
- self.paths << "#{Bundler.install_path}"
16
- self.paths << "#{Bundler.bundle_path}/gems"
13
+ begin
14
+ self.paths << "#{Bundler.install_path}"
15
+ self.paths << "#{Bundler.bundle_path}/gems"
16
+ @check_gemfile = true
17
+ @gemfile_path = "#{Dir.pwd}/Gemfile"
18
+ rescue Bundler::GemfileNotFound => e
19
+ # Don't fail here
20
+ ensure
21
+ @check_gemfile ||= false
22
+ @gemfile_path ||= nil
23
+ end
17
24
  self.paths.uniq!
18
- puts "[GemBench] will search for gems in #{self.paths.inspect}"
19
25
  # Gem.loaded_specs are the gems that have been loaded / required.
20
26
  # Among these there may be some that did not need to be.
21
27
  totes = Gem.loaded_specs.values.map {|x| [x.name, x.version.to_s] }
22
28
  @excluded, @all = totes.partition {|x| EXCLUDE.include?(x[0]) }
23
- puts "[GemBench] detected #{self.all.length} loaded gems (#{self.excluded.length} will be skipped by GemBench)"
29
+ exclusions = "\t(excluding the #{self.excluded.length} GemBench is configured to skip)\n" if @excluded.length > 0
24
30
  @starters = []
25
31
  @benchers = []
26
- @verbose = verbose
32
+ @current_gemfile_suggestions = []
33
+ @verbose = options[:verbose]
27
34
  self.check_all
28
- self.print if self.verbose
35
+ @bad_ideas = options[:bad_ideas] ? true : self.check_gemfile ? false : options[:bad_ideas] == false ? false : true
36
+ puts "[GemBench] Will search for gems in #{self.paths.inspect}\n#{self.check_gemfile ? "[GemBench] Will check Gemfile at #{self.gemfile_path}.\n" : "[GemBench] No Gemfile found.\n"}#{self.bad_ideas ? "[GemBench] Will show bad ideas. Be Careful.\n" : ''}[GemBench] Detected #{self.all.length} loaded gems\n#{exclusions}"
37
+ self.compare_gemfile if self.check_gemfile
38
+ self.print if self.verbose
29
39
  end
30
40
 
31
41
  def print
32
42
  string = ''
33
- if self.starters.empty?
34
- string << "[GemBench] Found no gems to load at boot.\n"
43
+ if self.all.empty?
44
+ string << nothing
45
+ elsif self.starters.empty?
46
+ string << "[GemBench] Found no gems that need to load at boot time.\n"
35
47
  else
36
- self.starters.each do |starter|
37
- string << "You might want to verify that #{starter} really has a Railtie (or Rails::Engine). Check here:\n"
38
- starter.stats.each do |stat|
39
- string << "\t#{stat}\n"
48
+ if self.starters.length > 0
49
+ string << "\n#{GemBench::USAGE}" unless self.check_gemfile
50
+ self.starters.each do |starter|
51
+ string << "[GemBench] You might want to verify that #{starter} really has a Rails::Railtie or Rails::Engine. Check these files:\n"
52
+ starter.stats.each do |stat|
53
+ string << "\t#{stat}\n"
54
+ end
55
+ end
56
+ string << "[GemBench] If you want to check for false positives, the files to check for Railties and Engines are listed above.\n"
57
+ string << "[GemBench] #{self.starters.length} out of #{self.all.length} evaluated gems actually need to be loaded at boot time. They are:\n"
58
+ self.starters.each_with_index do |starter, index|
59
+ string << "#{starter.suggest(index + 1)}\n"
40
60
  end
61
+ else
62
+ string << "[GemBench] Congrats! No gems to load at boot.\n"
63
+ string << "\n#{GemBench::USAGE}" unless self.check_gemfile
41
64
  end
42
- string << "[GemBench] #{self.starters.length} gems to load at boot:\n"
43
- string << "[GemBench] If you want to check for false positives, the files to check for Railties and Engines are listed above:\n"
44
- self.starters.each do |starter|
45
- string << "\t#{starter.how}\n"
65
+ end
66
+ if self.check_gemfile
67
+ if self.current_gemfile_suggestions.length > 0
68
+ string << "[GemBench] Evaluated #{self.all.length} gems and Gemfile at #{self.gemfile_path}.\n[GemBench] Here are #{self.current_gemfile_suggestions.length} suggestions for improvement:\n"
69
+ self.current_gemfile_suggestions.each_with_index do |player, index|
70
+ string << "#{player.suggest(index + 1)}\n"
71
+ end
72
+ else
73
+ string << self.strike_out
46
74
  end
47
75
  end
48
- string << "[GemBench] #{self.benchers.length} gems to skip require in Gemfile (require => false):\n"
49
- self.benchers.each do |starter|
50
- string << "\t#{starter.how}\n"
76
+
77
+ if self.bad_ideas
78
+ # Only bad ideas if you are evaluating an actual Gemfile. If just evaluating loaded gems, then info is fine.
79
+ string << self.prepare_bad_ideas
51
80
  end
81
+
52
82
  puts string
53
83
  end
54
84
 
85
+ def strike_out
86
+ self.check_gemfile ?
87
+ "[GemBench] Evaluated #{self.all.length} gems against your Gemfile but found no primary dependencies which can safely skip require on boot (require: false).\n" :
88
+ "[GemBench] Evaluated #{self.all.length} gems but found none which can safely skip require on boot (require: false).\n"
89
+ end
90
+
91
+ def nothing
92
+ "[GemBench] No gems were evaluated by GemBench.\n#{GemBench::USAGE}"
93
+ end
94
+
95
+ def prepare_bad_ideas
96
+ string = ''
97
+ if self.benchers.length > 0
98
+ gemfile_instruction = self.check_gemfile ? '' : "To safely evaluate a Gemfile:\n\t1. Make sure you are in the root of a project with a Gemfile\n\t2. Make sure the gem is actually a dependency in the Gemfile\n"
99
+ string << "[GemBench] Evaluated #{self.all.length} loaded gems and found #{self.benchers.length} which may be able to skip boot loading (require: false).\n*** => WARNING <= ***: Be careful adding non-primary dependencies to your Gemfile as it is generally a bad idea.\n#{gemfile_instruction}"
100
+ self.benchers.each_with_index do |player, index|
101
+ string << "#{player.careful(index + 1)}\n"
102
+ end
103
+ else
104
+ string << self.strike_out
105
+ end
106
+ string
107
+ end
108
+
109
+ def compare_gemfile
110
+ f = File.open(self.gemfile_path)
111
+ # Get all lines as an array
112
+ all_lines = f.readlines
113
+ # Remove all the commented || blank lines
114
+ self.trash_lines, self.gemfile_lines = all_lines.partition {|x| x =~ GemBench::TRASH_REGEX}
115
+ self.benchers.each_with_index do |player, index|
116
+ self.gemfile_lines.each do |line|
117
+ found = (line =~ player.gemfile_regex)
118
+ if found
119
+ # remove the found line from the array, because no sane person has more than one gem dependency per line... right?
120
+ line = self.gemfile_lines.delete_at(self.gemfile_lines.index(line))
121
+ # does the line already have require: false?
122
+ self.current_gemfile_suggestions << self.benchers.delete_at(self.benchers.index(player)) unless line =~ GemBench::REQUIRE_FALSE_REGEX
123
+ break # outside of the inner loop
124
+ end
125
+ end
126
+ end
127
+ end
128
+
55
129
  def check_all
56
130
  self.all.each do |player_data|
57
131
  player = GemBench::Player.new({name: player_data[0], version: player_data[1]})
@@ -1,3 +1,3 @@
1
1
  module GemBench
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/gem_bench.rb CHANGED
@@ -1,10 +1,22 @@
1
- require 'bundler' # This gem utilizes bundler as a tool.
2
- require 'gem_bench/version'
3
- require 'gem_bench/team'
4
- require 'gem_bench/player'
5
-
6
1
  module GemBench
7
2
 
3
+ USAGE = "[GemBench] Usage: Require another gem in this session to evaluate it.\n\tExample:\n\t\trequire 'rails'\n\t\tGemBench.check({verbose: true})\n"
4
+ RAILTIE_REGEX = /Rails::Engine|Rails::Railtie/
5
+ TRASH_REGEX = /^(\s*)([#]+.*)?$/
6
+ REQUIRE_FALSE_REGEX = /^[^#]+require(([:]\s*)|(\s*=>\s*))false.*/
7
+ DEPENDENCY_REGEX = ->(name) { /^\s*[^#]*\s*gem\s+['"]{1}#{name}['"]{1}/ }
8
+ PATH_GLOB = ->(name) { "#{name}*/lib/**/*.rb" }
9
+ DO_NOT_SCAN = []
10
+ PLAYER_STATES = {
11
+ starter: :starter,
12
+ bench: :bench
13
+ }
14
+
15
+ require 'bundler' # This gem utilizes bundler as a tool.
16
+ require 'gem_bench/version'
17
+ require 'gem_bench/team'
18
+ require 'gem_bench/player'
19
+
8
20
  class << self
9
21
  attr_accessor :roster
10
22
  def check(verbose = false)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_bench
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-05 00:00:00.000000000 Z
12
+ date: 2013-04-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler