rails-dev-tweaks 0.3.1 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -3,23 +3,27 @@ A collection of tweaks to improve your Rails (3.1+) development experience.
3
3
 
4
4
  To install, simply add it to your gemfile:
5
5
 
6
- gem 'rails-dev-tweaks', '~> 0.3.1'
6
+ gem 'rails-dev-tweaks', '~> 0.4.0'
7
7
 
8
8
  At the moment, the current tweaks center around speeding up requests by giving granular control over which requests
9
- cause the Rails autoloader to kick in:
9
+ cause the Rails reloader to kick in.
10
10
 
11
11
 
12
- # Granular Autoload
13
- Rails' autoloading facility is a wonderful help for development mode, but sometimes it's a little overkill and ends up
14
- hampering your rate of iteration while developing a Rails app. rails-dev-tweaks introduces granular control over which
15
- kinds of requests are autoloaded.
12
+ ## Intended Usage
13
+ This gem is intended to provide a default configuration that covers most rails apps. You should be aware of some of
14
+ the more imposing defaults, in case they don't jive with your workflow. Important points of note:
15
+
16
+ * _All_ asset requests _will not_ reload your app's code. This is probably only a problem if you are using custom sass
17
+ functions, or otherwise referencing your app from within assets.
18
+
19
+ * _All_ XHR requests _will not_ reload your app's code until you make a regular content request! The assumption is
20
+ that you generally do not debug XHR responses without reloading the base page first.
16
21
 
17
- However, why should you use request-based autoload control instead of smart autoloaders that check file modification
18
- times, such as [rails-dev-boost](https://github.com/thedarkone/rails-dev-boost)? The primary worry with smart
19
- autoloaders is that they have an extremely difficult time tracking all dependencies of a particular constant. This can
20
- result in extremely confusing and difficult to debug issues; Theoretically, request-based autoloading should be a bit
21
- less finicky.
22
+ If any of these points don't work out for you, don't fret! You can override the defaults with some simple
23
+ configuration tweaks to your environment. Read on:
22
24
 
25
+
26
+ # Granular Autoload
23
27
  You can specify autoload rules for your app via a configuration block in your application or environment configuration.
24
28
  These rules are specified via exclusion (`skip`) and inclusion (`keep`). Rules defined later override those defined
25
29
  before.
@@ -44,6 +48,7 @@ The default autoload rules should cover most development patterns:
44
48
 
45
49
  skip '/favicon.ico'
46
50
  skip :assets
51
+ skip :xhr
47
52
  keep :forced
48
53
  end
49
54
 
@@ -64,10 +69,6 @@ packager is mounted using the traditional Rails dispatching infrastructure, it's
64
69
  (unloader). This matcher will match any requests that are routed to Sprockets (specifically any mounted
65
70
  Sprockets::Environment instance).
66
71
 
67
- _The downside_ to this matcher is that your Rails environment won't reload until you make a regular request to the dev
68
- server (which should be your usual request pattern, anyway). Assets still reload properly (unless you're referencing
69
- your application's Ruby code).
70
-
71
72
  ### :forced
72
73
  To aid in live-debugging when you need to, this matcher will match any request that has `force_autoload` set as a
73
74
  parameter (GET or POST), or that has the `Force-Autoload` header set to something.
@@ -11,6 +11,7 @@ class RailsDevTweaks::Configuration
11
11
 
12
12
  skip '/favicon.ico'
13
13
  skip :assets
14
+ skip :xhr
14
15
  keep :forced
15
16
  end
16
17
  end
@@ -1,4 +1,4 @@
1
1
  module RailsDevTweaks
2
- VERSION = '0.3.1'
2
+ VERSION = '0.4.0'
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-dev-tweaks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &2167156100 !ruby/object:Gem::Requirement
17
+ requirement: &2158338760 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ~>
@@ -22,7 +22,7 @@ dependencies:
22
22
  version: 3.1.0.rc4
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *2167156100
25
+ version_requirements: *2158338760
26
26
  description: A collection of tweaks to improve your Rails (3.1+) development experience.
27
27
  email:
28
28
  - info@wavii.com
@@ -56,18 +56,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
56
56
  - - ! '>='
57
57
  - !ruby/object:Gem::Version
58
58
  version: '0'
59
- segments:
60
- - 0
61
- hash: -1289302315746076260
62
59
  required_rubygems_version: !ruby/object:Gem::Requirement
63
60
  none: false
64
61
  requirements:
65
62
  - - ! '>='
66
63
  - !ruby/object:Gem::Version
67
64
  version: '0'
68
- segments:
69
- - 0
70
- hash: -1289302315746076260
71
65
  requirements: []
72
66
  rubyforge_project: rails-dev-tweaks
73
67
  rubygems_version: 1.6.2