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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12ea5a06403c7393943ebed8fabd492141757710
4
- data.tar.gz: 6711af8a89ae7e9483fe3f7e8c71762f7530dadb
3
+ metadata.gz: 4c56e07c9b3e01042644446a19d693a986849686
4
+ data.tar.gz: e835a0d4b87daa8f9af529a3a7190d870393ba48
5
5
  SHA512:
6
- metadata.gz: f17b863872f0d6e491f7cd67339d484cbb97fc07a473abb21680fd1aabf7662170ec7276d30c4d4018a32a9db38b533e355347772663d4d450d72078d563cda8
7
- data.tar.gz: 05d00b2038da7b9436b3c729358f2c19718e94a44c282852872af91bca9c43d4a45484b811e16c8f93f2837c6f8ba8a0ea2ee13dcdbe7dc7499b0d5691b14383
6
+ metadata.gz: fe838b7b940db0d03c89bdeeb3aa2f48ec75de672322f04c5d7d8856f3b63c143806d63201eda1bb41477272c74a282ca9768d574758a8f24d584b8c965c22c1
7
+ data.tar.gz: 151eb990affe67d0edfa39689193b7f0794830d48a04e0a610c9d51326b494066c8f314267d7e21170e51267ec6d4cd5162840eec613ab851aac5b18a38deace
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ sudo: false
3
+ rvm:
4
+ - '1.9'
5
+ - '2.0'
6
+ - '2.1'
7
+ - '2.2'
8
+ - rbx-2
9
+ before_install: gem install bundler -v 1.10.6
10
+
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
- Add this line to your application's Gemfile:
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: '/path/to/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
- You must regenerate the cache everytime `$LOAD_PATH` is modified by calling `Bootscale.regenerate`.
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
@@ -1 +1,6 @@
1
1
  require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -7,7 +7,10 @@ module Bootscale
7
7
  end
8
8
 
9
9
  def generate(load_path)
10
- ordered_entries = load_path.map { |path| entries.fetch(path) { entries[path] = Entry.new(path) } }
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
@@ -3,7 +3,7 @@ module Bootscale
3
3
  DL_EXTENSIONS = [
4
4
  RbConfig::CONFIG['DLEXT'],
5
5
  RbConfig::CONFIG['DLEXT2'],
6
- ].reject(&:empty?).map { |ext| ".#{ext}"}
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
@@ -15,6 +15,7 @@ module Bootscale
15
15
  def dump(load_path, cache)
16
16
  path = cache_path(load_path)
17
17
  return if File.exist?(path)
18
+ FileUtils.mkdir_p(File.dirname(path))
18
19
  File.open(path, 'wb+') { |f| f.write(MessagePack.dump(cache)) }
19
20
  end
20
21
 
@@ -1,3 +1,3 @@
1
1
  module Bootscale
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
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.1
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-23 00:00:00.000000000 Z
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