gem_bench 0.0.6 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +12 -2
- data/README.md +25 -0
- data/lib/gem_bench/player.rb +12 -1
- data/lib/gem_bench/team.rb +4 -3
- data/lib/gem_bench/version.rb +1 -1
- data/lib/gem_bench.rb +1 -1
- metadata +15 -18
- data/.gitignore +0 -17
- data/Gemfile +0 -4
- data/gem_bench.gemspec +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7709c90fcd4cbb3197647d563af1394c48a33f5f
|
4
|
+
data.tar.gz: a42acb1c16d5aa9271193336d8197d5b40300c35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f20b735303e993af008611a2321ae6a35fe4ff8f0b28564702c0ad8f33c8b1c583badee4372944bbd6492cd31ea85bf46f668f6c89df1e943410ae59085f7ab0
|
7
|
+
data.tar.gz: 999ca2bfe06f754e49d9691361963fa5453db09da12c9100caee1cc8ecfe08d079326f0a58919ece3be51536edb1a3e880af4171cf93da2ce0f385a73e83a7e5
|
data/CHANGELOG
CHANGED
@@ -1,6 +1,16 @@
|
|
1
|
+
Version 0.0.8 - JAN.16.2014
|
2
|
+
* Corrected issues with 0.0.7 release.
|
3
|
+
* More Documentation
|
4
|
+
* removed git dependency from gemspec
|
5
|
+
|
6
|
+
Version 0.0.7 - DEC.23.2013 (Yanked immediately)
|
7
|
+
* Attempt to fix failure on encoding problem, with a rescue fallback (Issue #1) by Peter Boling
|
8
|
+
* Readme / Documentation improvements by John Bachir
|
9
|
+
* Runtime output improvements by John Bachir
|
10
|
+
|
1
11
|
Version 0.0.6 - AUG.29.2013
|
2
12
|
* Added license to gemspec by Peter Boling
|
3
|
-
* No longer altering Ruby load path - Let the gem manager do that
|
13
|
+
* No longer altering Ruby load path - Let the gem manager do that by Peter Boling
|
4
14
|
|
5
15
|
Version 0.0.5 - AUG.28.2013
|
6
16
|
* Encode as UTF-8 prior to comparison by Peter Boling
|
@@ -9,7 +19,7 @@ Version 0.0.4 - APR.06.2013
|
|
9
19
|
* Expanded exclusion list by Peter Boling
|
10
20
|
|
11
21
|
Version 0.0.3 - APR.06.2013
|
12
|
-
* Late night coding needs more coffee
|
22
|
+
* Late night coding needs more coffee by Peter Boling
|
13
23
|
|
14
24
|
Version 0.0.2 - APR.06.2013
|
15
25
|
* Works against 265 dependency Gemfile by Peter Boling
|
data/README.md
CHANGED
@@ -43,6 +43,8 @@ And then execute:
|
|
43
43
|
|
44
44
|
## Usage
|
45
45
|
|
46
|
+
Works with Ruby >= 1.9.2 due to use of stabby lambdas and the new hash syntax, and probably other stuff.
|
47
|
+
|
46
48
|
Fire up an `irb` session or a `rails console` and then:
|
47
49
|
|
48
50
|
>> require 'gem_bench'
|
@@ -431,6 +433,22 @@ So here's a [*fat* Gemfile][bundle-group-pattern] weighing in at 265 gem depende
|
|
431
433
|
[SUGGESTION] 45) gem 'vestal_versions', '~> 1.2.3'
|
432
434
|
|
433
435
|
`gem_bench` found 45 gems which are listed as primary dependencies in my `Gemfile` which I can add `require: false` to.
|
436
|
+
After adding `require: false`, try all these locally:
|
437
|
+
|
438
|
+
1. running your tests
|
439
|
+
2. starting the console
|
440
|
+
3. starting the server and using your app
|
441
|
+
4. running rake tasks if you have any special ones
|
442
|
+
|
443
|
+
When doing these, you will probably encounter errors saying that a library is not available. You should then
|
444
|
+
add `require "foo"` where the error happens. Keep in mind that if this is in an initializer or environment file,
|
445
|
+
you aren't saving any time when the rails server is booting. However,
|
446
|
+
it does save time when running a rake task that does not invoke the environment (some do, some don't). So, if
|
447
|
+
you don't think saving this time is worth the minor additinoal code complexity, you can exclude the `require: false`s
|
448
|
+
in these cases.
|
449
|
+
|
450
|
+
After adding your `require: false`s, run gem_bench again. The gem's logic isn't perfect so it sometimes
|
451
|
+
will find new suggested exclusions.
|
434
452
|
|
435
453
|
How much faster will my app boot loading 45 fewer gems? A bit.
|
436
454
|
|
@@ -443,6 +461,9 @@ A future verison will also look for initializers, because gems which have code t
|
|
443
461
|
|
444
462
|
## Contributing
|
445
463
|
|
464
|
+
If you see: `is feeling very lost right now` then I'd like to know.
|
465
|
+
Create an issue and tell me about it, or fix it yo'sef.
|
466
|
+
|
446
467
|
1. Fork it
|
447
468
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
448
469
|
3. Commit your changes (`git commit -am 'Added some feature'`)
|
@@ -474,3 +495,7 @@ For example:
|
|
474
495
|
[semver]: http://semver.org/
|
475
496
|
[pvc]: http://docs.rubygems.org/read/chapter/16#page74
|
476
497
|
[bundle-group-pattern]: https://gist.github.com/pboling/4564780
|
498
|
+
|
499
|
+
|
500
|
+
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/pboling/gem_bench/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
501
|
+
|
data/lib/gem_bench/player.rb
CHANGED
@@ -19,7 +19,14 @@ module GemBench
|
|
19
19
|
if GemBench::DO_NOT_SCAN.include? self.name
|
20
20
|
false
|
21
21
|
else
|
22
|
-
|
22
|
+
begin
|
23
|
+
File.read(file_path).encode('utf-8', :invalid => :replace, :undef => :replace, :replace => '_') =~ GemBench::RAILTIE_REGEX
|
24
|
+
rescue ArgumentError => e
|
25
|
+
if e.message =~ /invalid byte sequence/
|
26
|
+
puts "[GemBench] checking #{file_path} failed due to unparseable file content"
|
27
|
+
false # Assume the likelihood of files with encoding issues that also contain railtie to be low, so: false.
|
28
|
+
end
|
29
|
+
end
|
23
30
|
end
|
24
31
|
end
|
25
32
|
self.stats << [file_path,scan] if scan
|
@@ -53,6 +60,10 @@ module GemBench
|
|
53
60
|
"\t[SUGGESTION] #{num}) #{self.how}"
|
54
61
|
end
|
55
62
|
|
63
|
+
def info(num)
|
64
|
+
"\t[INFO] #{num}) #{self.how}"
|
65
|
+
end
|
66
|
+
|
56
67
|
def careful(num)
|
57
68
|
"\t[BE CAREFUL] #{num}) #{self.how}"
|
58
69
|
end
|
data/lib/gem_bench/team.rb
CHANGED
@@ -49,16 +49,17 @@ module GemBench
|
|
49
49
|
else
|
50
50
|
if self.starters.length > 0
|
51
51
|
string << "\n#{GemBench::USAGE}" unless self.check_gemfile
|
52
|
+
string << "[GemBench] We found a Rails::Railtie or Rails::Engine in the following files. However, it is possible that there are false positives, so you may want to verify that this is the case.\n\n"
|
52
53
|
self.starters.each do |starter|
|
53
|
-
string << "
|
54
|
+
string << "\t#{starter}:\n"
|
54
55
|
starter.stats.each do |stat|
|
55
|
-
string << "\t#{stat}\n"
|
56
|
+
string << "\t\t#{stat[0]}:#{stat[1]}\n"
|
56
57
|
end
|
57
58
|
end
|
58
59
|
string << "[GemBench] If you want to check for false positives, the files to check for Railties and Engines are listed above.\n"
|
59
60
|
string << "[GemBench] #{self.starters.length} out of #{self.all.length} evaluated gems actually need to be loaded at boot time. They are:\n"
|
60
61
|
self.starters.each_with_index do |starter, index|
|
61
|
-
string << "#{starter.
|
62
|
+
string << "#{starter.info(index + 1)}\n"
|
62
63
|
end
|
63
64
|
else
|
64
65
|
string << "[GemBench] Congrats! No gems to load at boot.\n"
|
data/lib/gem_bench/version.rb
CHANGED
data/lib/gem_bench.rb
CHANGED
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem_bench
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Boling
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - '>'
|
17
|
+
- - ! '>'
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - '>'
|
24
|
+
- - ! '>'
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: gem-release
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - '>='
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
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
40
|
version: '0'
|
41
41
|
description: trim down app load times by keeping your worst players on the bench
|
@@ -45,17 +45,14 @@ executables: []
|
|
45
45
|
extensions: []
|
46
46
|
extra_rdoc_files: []
|
47
47
|
files:
|
48
|
-
- .gitignore
|
49
|
-
- CHANGELOG
|
50
|
-
- Gemfile
|
51
|
-
- LICENSE.txt
|
52
|
-
- README.md
|
53
|
-
- Rakefile
|
54
|
-
- gem_bench.gemspec
|
55
|
-
- lib/gem_bench.rb
|
56
48
|
- lib/gem_bench/player.rb
|
57
49
|
- lib/gem_bench/team.rb
|
58
50
|
- lib/gem_bench/version.rb
|
51
|
+
- lib/gem_bench.rb
|
52
|
+
- LICENSE.txt
|
53
|
+
- README.md
|
54
|
+
- CHANGELOG
|
55
|
+
- Rakefile
|
59
56
|
homepage: http://github.com/acquaintable/gem_bench
|
60
57
|
licenses:
|
61
58
|
- MIT
|
@@ -66,18 +63,18 @@ require_paths:
|
|
66
63
|
- lib
|
67
64
|
required_ruby_version: !ruby/object:Gem::Requirement
|
68
65
|
requirements:
|
69
|
-
- - '>='
|
66
|
+
- - ! '>='
|
70
67
|
- !ruby/object:Gem::Version
|
71
68
|
version: '0'
|
72
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
70
|
requirements:
|
74
|
-
- - '>='
|
71
|
+
- - ! '>='
|
75
72
|
- !ruby/object:Gem::Version
|
76
73
|
version: '0'
|
77
74
|
requirements: []
|
78
75
|
rubyforge_project:
|
79
|
-
rubygems_version: 2.
|
76
|
+
rubygems_version: 2.1.11
|
80
77
|
signing_key:
|
81
78
|
specification_version: 4
|
82
|
-
summary: 'Gem: "Put me in coach" You: ❨╯°□°❩╯︵┻━┻'
|
79
|
+
summary: ! 'Gem: "Put me in coach" You: ❨╯°□°❩╯︵┻━┻'
|
83
80
|
test_files: []
|
data/.gitignore
DELETED
data/Gemfile
DELETED
data/gem_bench.gemspec
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
require File.expand_path('../lib/gem_bench/version', __FILE__)
|
3
|
-
|
4
|
-
Gem::Specification.new do |gem|
|
5
|
-
gem.name = "gem_bench"
|
6
|
-
gem.version = GemBench::VERSION
|
7
|
-
gem.authors = ["Peter Boling"]
|
8
|
-
gem.email = ["peter.boling@gmail.com"]
|
9
|
-
gem.description = %q{trim down app load times by keeping your worst players on the bench}
|
10
|
-
gem.summary = %q{Gem: "Put me in coach"
|
11
|
-
You: ❨╯°□°❩╯︵┻━┻}
|
12
|
-
gem.homepage = "http://github.com/acquaintable/gem_bench"
|
13
|
-
|
14
|
-
gem.licenses = ['MIT']
|
15
|
-
gem.platform = Gem::Platform::RUBY
|
16
|
-
|
17
|
-
gem.files = `git ls-files`.split($/)
|
18
|
-
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
19
|
-
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
20
|
-
gem.require_paths = ["lib"]
|
21
|
-
|
22
|
-
gem.add_runtime_dependency(%q<bundler>, ["> 1.2"])
|
23
|
-
gem.add_development_dependency( 'gem-release' )
|
24
|
-
|
25
|
-
end
|