smarter_bundler 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -11
- data/lib/smarter_bundler/bundle.rb +10 -1
- data/lib/smarter_bundler/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10f203335d8ae0d93458b567e314c4e5851b4249
|
4
|
+
data.tar.gz: 2e015ec0fe6553e0e6d5c343ecf50425dc4421a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53c84d3b071458b4f8a30ee31b3c19eb23d2fbca41e8c90ddef16e39c78fa90c042319e97634161f5a2382437ae517758f1939b1ed387540d0caf3b1a5a64b80
|
7
|
+
data.tar.gz: e0994eb574ced2f6152a02e00a9c221c5fd86e310dc17fa4aa5fb467750b2ecb495b48dd0948b1baa14e3220461178e10b03989d15b6fcbb317da212cf93e5f2
|
data/README.md
CHANGED
@@ -16,11 +16,7 @@ Do not install it via Gemfile, as it needs to execute even if bundle can't insta
|
|
16
16
|
|
17
17
|
Use smarter_bundle instead of the bundle command when installing or upgrading gems.
|
18
18
|
|
19
|
-
|
20
|
-
the more fixes this program does, the longer it takes (since it reruns bundler to check the fixed Gemfile).
|
21
|
-
A reasonable limit would be four to ten times the time it normally takes to install.
|
22
|
-
Once you hit that limit, then check your install log and incorporate the fixes it has found into your Gemfile
|
23
|
-
source to remove the need for it to run bundler multiple times whilst it fixes the Gemfile.
|
19
|
+
Smarter_bundle assumes that the gem bundler complains about is the one that needs to have its version restricted, as it can not determine if its that gem or the gem/s that require it that should be adjusted.
|
24
20
|
|
25
21
|
### Cleaning up afterwards
|
26
22
|
|
@@ -29,13 +25,14 @@ After smarter_bundle has updated the Gemfile, you should examine the changes, as
|
|
29
25
|
2. smarter_bundle does not backtrack and recheck earlier adjustments - this may result in a gem being restricted that is no longer needed because the gem that originally needed ended up being restricted to the point it no longer has so many prerequisites. In the Gemfile.lock you will see that the gem is not required by any other gems, nor was it a gem you directly need.
|
30
26
|
3. smarter_bundle does not know how to handle Gemfiles that are intended to be used with multiple ruby versions, so you will need to make a Gemfile that is intended for the ruby version you are checking it with and then incorporate the changes smarter_bundle makes back into the master Gemfile manually;
|
31
27
|
|
32
|
-
### Using in test scripts
|
33
|
-
|
34
|
-
If for some reason you do not use Gemfile.lock in automated testing (eg when testing gems with travis-ci), and you are testing against older ruby versions, then you may wish to consider using
|
35
|
-
smarter_bundler - instead of the test script failing, smarter_bundler will update the Gemfile on the fly. Of course you are swapping processing time for convienience,
|
36
|
-
so you should implement a time limit and manually update your Gemfile once the tests slow down too much.
|
28
|
+
### Using in test or deploy scripts
|
37
29
|
|
38
|
-
|
30
|
+
If you are using it in an automated deploy (ie where you are not using Gemfile.lock),
|
31
|
+
then monitor the time the deploy takes, as
|
32
|
+
the more fixes this program does, the longer it takes (since it reruns bundler to check the fixed Gemfile).
|
33
|
+
A reasonable limit would be four to ten times the time it normally takes to install.
|
34
|
+
Once you hit that limit, then check your install log and incorporate the fixes it has found into your Gemfile
|
35
|
+
source to remove the need for it to run bundler multiple times whilst it fixes the Gemfile.
|
39
36
|
|
40
37
|
## Notes
|
41
38
|
|
@@ -87,7 +87,16 @@ module SmarterBundler
|
|
87
87
|
end
|
88
88
|
|
89
89
|
def call_bundle(bundle_args)
|
90
|
-
|
90
|
+
require_gems_check = if File.size? 'Rakefile'
|
91
|
+
'bundle exec rake environment'
|
92
|
+
else
|
93
|
+
"ruby -e 'puts \"Checking gems can be loaded ...\" ; " +
|
94
|
+
"require \"rubygems\" ; "+
|
95
|
+
"require \"bundler/setup\" ; "+
|
96
|
+
"Bundler.require(:default) ; "+
|
97
|
+
"puts \"PASSED GEM LOAD TEST\" ' "
|
98
|
+
end
|
99
|
+
shell "bundle #{bundle_args.join(' ')} && #{require_gems_check}"
|
91
100
|
end
|
92
101
|
|
93
102
|
def install_failed_gem(gem, version)
|