iseq_rails_tools 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b5e048c97ff3fdbd635135e589ac488d70bc0c4
4
- data.tar.gz: 2a614cd2aa085f5a9638f2157b683dcf522a2c21
3
+ metadata.gz: 41adbda1e1b89000183500297f553297069a38bf
4
+ data.tar.gz: 2037d45bda86a9e59d2a01375342bd2f13c32643
5
5
  SHA512:
6
- metadata.gz: 6cdf29659c15bdde45f5ccb455cf15fedfa17440929a6befc68d16849a3c89e43a1ec70849b0d150aaa1c000b8ab3ae251ce98d8ac17fcdadb4b42930f6e4509
7
- data.tar.gz: 3707519c3391f1553d918295451ce636dcaa2a43be8c9305fb9eefcea211a0cff9ce964841f91c63bd1c1d47d6b5c818090afbdf964f171568aefbd7293dfd1c
6
+ metadata.gz: cecb536938e03c599314815ccce2a02237d2ee7c236ddd65eaea3be223a398e0f56378179664bdaea81c604c1c412b1c65d8c1933de8e781a7d413023926481d
7
+ data.tar.gz: 4e89dc8c64eca43d8306d15b40b1acec176e7c132c726b925baa05fd9c1f183ebbac928af2f720a7dd43724003fddedd4cef20a629a40d451f75a7f97ccdb7f8
data/README.md CHANGED
@@ -1,12 +1,13 @@
1
1
  # IseqRailsTools
2
2
 
3
3
  [![Build Status](https://travis-ci.org/kddeisz/iseq-rails-tools.svg?branch=master)](https://travis-ci.org/kddeisz/iseq-rails-tools)
4
+ [![Gem](https://img.shields.io/gem/v/iseq_rails_tools.svg)](https://rubygems.org/gems/iseq_rails_tools)
4
5
 
5
6
  Since Ruby 2.3, we've had the ability to dump out compiled Ruby bytecode to files to alleviate that process when ruby files are required. This can significantly boost boot times, especially when running with larger Ruby projects.
6
7
 
7
8
  This gem hooks into ActiveSupport's autoloading in development mode to bring AOT compiling to Rails. This can improve both the console and server boot times.
8
9
 
9
- When deploying to production, you can take advantage of the quicker boot times by adding the `iseq:all` rake task to your deploy script.
10
+ When deploying to production, you can take advantage of the quicker boot times by adding the `iseq:all` rake task to your deploy script. A simple way to do this is to make `iseq:all` a prerequisite of `assets:precompile`, like so: `Rake::Task['assets:precompile'].enhance(['iseq:all'])`.
10
11
 
11
12
  ## Usage
12
13
 
@@ -1,8 +1,6 @@
1
1
  require 'digest/sha1'
2
2
  require 'fileutils'
3
-
4
3
  require 'iseq_rails_tools/compiler'
5
- require 'iseq_rails_tools/railtie'
6
4
 
7
5
  module IseqRailsTools
8
6
  class NullCompiler
@@ -29,12 +27,19 @@ module IseqRailsTools
29
27
  self.compiler = NullCompiler.new
30
28
  end
31
29
 
32
- RubyVM::InstructionSequence.singleton_class.prepend(Module.new do
33
- def load_iseq(filepath)
34
- if ::IseqRailsTools.compiler.watching?(filepath)
35
- ::IseqRailsTools.compiler.load_iseq(filepath)
36
- elsif method(:load_iseq).super_method
37
- super
30
+ # Only actually hook into Rails when the environment isn't test so that tools
31
+ # like simplecov will continue to function as expected. Also people do weird
32
+ # stuff in test mode, so who knows.
33
+ unless Rails.env.test?
34
+ require 'iseq_rails_tools/railtie'
35
+
36
+ RubyVM::InstructionSequence.singleton_class.prepend(Module.new do
37
+ def load_iseq(filepath)
38
+ if ::IseqRailsTools.compiler.watching?(filepath)
39
+ ::IseqRailsTools.compiler.load_iseq(filepath)
40
+ elsif method(:load_iseq).super_method
41
+ super
42
+ end
38
43
  end
39
- end
40
- end)
44
+ end)
45
+ end
@@ -1,3 +1,3 @@
1
1
  module IseqRailsTools
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iseq_rails_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Deisz