bootscale 0.2.1 → 0.2.2
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 +4 -4
- data/.rspec +2 -0
- data/.travis.yml +10 -0
- data/Gemfile +12 -0
- data/README.md +10 -18
- data/Rakefile +5 -0
- data/lib/bootscale/cache_builder.rb +4 -1
- data/lib/bootscale/entry.rb +2 -2
- data/lib/bootscale/file_storage.rb +1 -0
- data/lib/bootscale/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4c56e07c9b3e01042644446a19d693a986849686
|
|
4
|
+
data.tar.gz: e835a0d4b87daa8f9af529a3a7190d870393ba48
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fe838b7b940db0d03c89bdeeb3aa2f48ec75de672322f04c5d7d8856f3b63c143806d63201eda1bb41477272c74a282ca9768d574758a8f24d584b8c965c22c1
|
|
7
|
+
data.tar.gz: 151eb990affe67d0edfa39689193b7f0794830d48a04e0a610c9d51326b494066c8f314267d7e21170e51267ec6d4cd5162840eec613ab851aac5b18a38deace
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
CHANGED
|
@@ -4,3 +4,15 @@ gemspec
|
|
|
4
4
|
|
|
5
5
|
gem 'bundler'
|
|
6
6
|
gem 'rake'
|
|
7
|
+
gem 'rspec'
|
|
8
|
+
|
|
9
|
+
group :dummy do
|
|
10
|
+
gem 'rails', '4.2.3'
|
|
11
|
+
gem 'sqlite3'
|
|
12
|
+
gem 'sass-rails', '~> 5.0'
|
|
13
|
+
gem 'uglifier', '>= 1.3.0'
|
|
14
|
+
gem 'coffee-rails', '~> 4.1.0'
|
|
15
|
+
gem 'jquery-rails'
|
|
16
|
+
gem 'turbolinks'
|
|
17
|
+
gem 'jbuilder', '~> 2.0'
|
|
18
|
+
end
|
data/README.md
CHANGED
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
# Bootscale
|
|
2
2
|
|
|
3
|
-
Speedup applications boot by caching require calls
|
|
3
|
+
Speedup applications boot by caching require calls.
|
|
4
|
+
|
|
5
|
+
Speed gain depends on your number of gems. Under 100 gems you likely won't see the difference,
|
|
6
|
+
but for bigger applications (300+ gems) it can make the application boot up to 30% faster.
|
|
4
7
|
|
|
5
|
-
## Installation
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
## Installation
|
|
8
10
|
|
|
9
11
|
```ruby
|
|
12
|
+
# Gemfile
|
|
10
13
|
gem 'bootscale', require: false
|
|
11
14
|
```
|
|
12
15
|
|
|
13
|
-
And then execute:
|
|
14
|
-
|
|
15
|
-
$ bundle
|
|
16
|
-
|
|
17
16
|
Then you need to add right after `require 'bundler/setup'`:
|
|
18
17
|
|
|
19
18
|
```ruby
|
|
20
19
|
require 'bundler/setup'
|
|
21
20
|
require 'bootscale'
|
|
22
|
-
Bootscale.setup(cache_directory: '/
|
|
21
|
+
Bootscale.setup(cache_directory: 'tmp/bootscale')
|
|
23
22
|
```
|
|
24
23
|
|
|
25
24
|
If your application is a Rails application, you will find this in `config/boot.rb`.
|
|
26
25
|
|
|
27
26
|
### Important
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
Cache should be update everytime `$LOAD_PATH` is modified by calling `Bootscale.regenerate`.
|
|
30
29
|
|
|
31
30
|
For Rails apps it means adding an initializer in `config/application.rb`:
|
|
32
31
|
|
|
@@ -40,17 +39,10 @@ module MyApp
|
|
|
40
39
|
end
|
|
41
40
|
```
|
|
42
41
|
|
|
43
|
-
## Usage
|
|
44
|
-
|
|
45
|
-
Just install it that's all!
|
|
46
|
-
|
|
47
|
-
## How much faster is it?
|
|
48
|
-
|
|
49
|
-
It totally depends on your number of gems. Under 100 gems you likely won't see the difference,
|
|
50
|
-
but for bigger applications (300+ gems) it can make the application boot up to 30% faster.
|
|
51
|
-
|
|
52
42
|
## Contributing
|
|
53
43
|
|
|
54
44
|
Bug reports and pull requests are welcome on GitHub at https://github.com/byroot/bootscale.
|
|
55
45
|
|
|
46
|
+
Local development: your load time will be very slow when using a local copy for development like `gem 'bootscale', path: '~/Code/bootscal'`, use via git instead.
|
|
47
|
+
|
|
56
48
|
Thanks to Aaron Patterson for the idea of converting relative paths to absolute paths.
|
data/Rakefile
CHANGED
|
@@ -7,7 +7,10 @@ module Bootscale
|
|
|
7
7
|
end
|
|
8
8
|
|
|
9
9
|
def generate(load_path)
|
|
10
|
-
ordered_entries = load_path.map
|
|
10
|
+
ordered_entries = load_path.map do |path|
|
|
11
|
+
path = path.to_s
|
|
12
|
+
entries[path] ||= Entry.new(path)
|
|
13
|
+
end
|
|
11
14
|
Hash[ordered_entries.reverse.flat_map(&:features)]
|
|
12
15
|
end
|
|
13
16
|
end
|
data/lib/bootscale/entry.rb
CHANGED
|
@@ -3,7 +3,7 @@ module Bootscale
|
|
|
3
3
|
DL_EXTENSIONS = [
|
|
4
4
|
RbConfig::CONFIG['DLEXT'],
|
|
5
5
|
RbConfig::CONFIG['DLEXT2'],
|
|
6
|
-
].reject
|
|
6
|
+
].reject { |ext| !ext || ext.empty? }.map { |ext| ".#{ext}"}
|
|
7
7
|
FEATURE_FILES = "**/*{#{DOT_RB},#{DL_EXTENSIONS.join(',')}}"
|
|
8
8
|
NORMALIZE_NATIVE_EXTENSIONS = !DL_EXTENSIONS.include?(DOT_SO)
|
|
9
9
|
ALTERNATIVE_NATIVE_EXTENSIONS_PATTERN = /\.(o|bundle|dylib)\z/
|
|
@@ -30,4 +30,4 @@ module Bootscale
|
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
end
|
|
33
|
-
end
|
|
33
|
+
end
|
data/lib/bootscale/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bootscale
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jean Boussier
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-08-
|
|
11
|
+
date: 2015-08-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: msgpack
|
|
@@ -32,6 +32,8 @@ extensions: []
|
|
|
32
32
|
extra_rdoc_files: []
|
|
33
33
|
files:
|
|
34
34
|
- ".gitignore"
|
|
35
|
+
- ".rspec"
|
|
36
|
+
- ".travis.yml"
|
|
35
37
|
- Gemfile
|
|
36
38
|
- LICENSE.txt
|
|
37
39
|
- README.md
|