heavy_control 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +6 -0
- data/LICENSE.txt +1 -1
- data/README.md +24 -0
- data/gemfiles/rails_4.2.gemfile.lock +10 -1
- data/gemfiles/rails_5.0.gemfile.lock +11 -1
- data/heavy_control.gemspec +1 -0
- data/lib/heavy_control/configurable.rb +2 -2
- data/lib/heavy_control/extensions/ignore_subfolders.rb +0 -6
- data/lib/heavy_control/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b5ec538f294519e937d47ddaafd9df7613866f1
|
4
|
+
data.tar.gz: 4d798f0a29f4a42d6a849a1d8c0cb00fb42c17e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6d95d61ca8a18d8fee643874bc78e9f6727aa2313742d7a5ae5dd4e5f8c31a0a9e9fc43075dcf27501e8f1cb2a51060cd6855d57fbe8efd48529c24a3e19133
|
7
|
+
data.tar.gz: 7a8e074f37dca4b93db496faad9e159be06a3762f43bcc4be5847b50da901787ebbea67e25958b1c537044920971b9b0bd90b559f518f3aac096043c655caeb9
|
data/.codeclimate.yml
ADDED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/heavy_control.svg)](http://badge.fury.io/rb/heavy_control)
|
4
4
|
[![Build Status](https://travis-ci.org/ffloyd/heavy_control.svg?branch=master)](https://travis-ci.org/ffloyd/heavy_control)
|
5
5
|
[![Code Climate](https://codeclimate.com/github/ffloyd/heavy_control.svg)](https://codeclimate.com/github/ffloyd/heavy_control)
|
6
|
+
[![Test Coverage](https://codeclimate.com/github/ffloyd/heavy_control/badges/coverage.svg)](https://codeclimate.com/github/ffloyd/heavy_control/coverage)
|
7
|
+
[![Issue Count](https://codeclimate.com/github/ffloyd/heavy_control/badges/issue_count.svg)](https://codeclimate.com/github/ffloyd/heavy_control)
|
6
8
|
[![git.legal](https://git.legal/projects/1859/badge.svg "Number of libraries approved")](https://git.legal/projects/1859)
|
7
9
|
|
8
10
|
HeavyControl adds tools which allows you to modify Rails autoloading logic.
|
@@ -60,6 +62,8 @@ HeavyControl: and found '/vagrant/app/models/organization.rb'
|
|
60
62
|
HeavyControl: Require of load '/vagrant/app/models/organization' with const_path 'Organization'
|
61
63
|
```
|
62
64
|
|
65
|
+
You may also turn off previously enabled debugging using `debug false`.
|
66
|
+
|
63
67
|
### Ignore subfolders
|
64
68
|
|
65
69
|
Rails automatically adds all folders under `/app` into autoloading paths. When you use constant (class, module) first time autoloading will search for file
|
@@ -74,6 +78,24 @@ HeavyControl.config do
|
|
74
78
|
end
|
75
79
|
```
|
76
80
|
|
81
|
+
For example lets write substitution to [trailblazer-loader](https://github.com/trailblazer/trailblazer-loader). README of this gem describes three naming and directory layout styles: _Compound-Singular_, _Explicit-Singular_ and _Explicit-Plural_.
|
82
|
+
|
83
|
+
#### Compound-Singular
|
84
|
+
|
85
|
+
It's very non-rails style. It forces us to keep from one to several class definitions in a single file. If you are using Rails I suggest you to avoid this. Currently, heavy_control doesn't support any code-placement styles where we put several classes inside one file.
|
86
|
+
|
87
|
+
#### Explicit-Singular and Explicit-Plural
|
88
|
+
|
89
|
+
This directory layout styles will work with classic rails autoloading correctly, except 'operation' and 'operations' folders. Given directories doesn't affect class namespaces. So, we will easy express this rule via `ignore_subfolder` option.
|
90
|
+
|
91
|
+
```ruby
|
92
|
+
# config/initializers/heavy_control.rb
|
93
|
+
HeavyControl.config do
|
94
|
+
ignore_subfolder 'operation' # singular
|
95
|
+
ignore_subfolder 'operations' # plural
|
96
|
+
end
|
97
|
+
```
|
98
|
+
|
77
99
|
### 'Toplevel constant referenced' situations
|
78
100
|
|
79
101
|
Sometimes we can get errors related to warnings like this:
|
@@ -91,6 +113,8 @@ HeavyControl.config do
|
|
91
113
|
end
|
92
114
|
```
|
93
115
|
|
116
|
+
In other words, for `always_load` you should use constant name which displays right after 'referenced by' words in a warning text.
|
117
|
+
|
94
118
|
You may write several names separated by comma.
|
95
119
|
|
96
120
|
`always_load` differs from `require_dependency`. It explicitly resolves constant names on initalization via `constantize` (before other constants are loaded). Also it happens each reload in development.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
heavy_control (0.1.
|
4
|
+
heavy_control (0.1.1)
|
5
5
|
rails (> 4)
|
6
6
|
|
7
7
|
GEM
|
@@ -49,9 +49,12 @@ GEM
|
|
49
49
|
arel (6.0.3)
|
50
50
|
ast (2.3.0)
|
51
51
|
builder (3.2.2)
|
52
|
+
codeclimate-test-reporter (0.6.0)
|
53
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
52
54
|
coderay (1.1.1)
|
53
55
|
concurrent-ruby (1.0.2)
|
54
56
|
diff-lcs (1.2.5)
|
57
|
+
docile (1.1.5)
|
55
58
|
erubis (2.7.0)
|
56
59
|
globalid (0.3.7)
|
57
60
|
activesupport (>= 4.1.0)
|
@@ -127,6 +130,11 @@ GEM
|
|
127
130
|
ruby-progressbar (~> 1.7)
|
128
131
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
129
132
|
ruby-progressbar (1.8.1)
|
133
|
+
simplecov (0.12.0)
|
134
|
+
docile (~> 1.1.0)
|
135
|
+
json (>= 1.8, < 3)
|
136
|
+
simplecov-html (~> 0.10.0)
|
137
|
+
simplecov-html (0.10.0)
|
130
138
|
slop (3.6.0)
|
131
139
|
sprockets (3.7.0)
|
132
140
|
concurrent-ruby (~> 1.0)
|
@@ -147,6 +155,7 @@ PLATFORMS
|
|
147
155
|
DEPENDENCIES
|
148
156
|
appraisal
|
149
157
|
bundler (~> 1.12)
|
158
|
+
codeclimate-test-reporter
|
150
159
|
heavy_control!
|
151
160
|
pry
|
152
161
|
rails (~> 4.2)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
heavy_control (0.1.
|
4
|
+
heavy_control (0.1.1)
|
5
5
|
rails (> 4)
|
6
6
|
|
7
7
|
GEM
|
@@ -51,13 +51,17 @@ GEM
|
|
51
51
|
arel (7.1.1)
|
52
52
|
ast (2.3.0)
|
53
53
|
builder (3.2.2)
|
54
|
+
codeclimate-test-reporter (0.6.0)
|
55
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
54
56
|
coderay (1.1.1)
|
55
57
|
concurrent-ruby (1.0.2)
|
56
58
|
diff-lcs (1.2.5)
|
59
|
+
docile (1.1.5)
|
57
60
|
erubis (2.7.0)
|
58
61
|
globalid (0.3.7)
|
59
62
|
activesupport (>= 4.1.0)
|
60
63
|
i18n (0.7.0)
|
64
|
+
json (2.0.2)
|
61
65
|
loofah (2.0.3)
|
62
66
|
nokogiri (>= 1.5.9)
|
63
67
|
mail (2.6.4)
|
@@ -128,6 +132,11 @@ GEM
|
|
128
132
|
ruby-progressbar (~> 1.7)
|
129
133
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
130
134
|
ruby-progressbar (1.8.1)
|
135
|
+
simplecov (0.12.0)
|
136
|
+
docile (~> 1.1.0)
|
137
|
+
json (>= 1.8, < 3)
|
138
|
+
simplecov-html (~> 0.10.0)
|
139
|
+
simplecov-html (0.10.0)
|
131
140
|
slop (3.6.0)
|
132
141
|
sprockets (3.7.0)
|
133
142
|
concurrent-ruby (~> 1.0)
|
@@ -151,6 +160,7 @@ PLATFORMS
|
|
151
160
|
DEPENDENCIES
|
152
161
|
appraisal
|
153
162
|
bundler (~> 1.12)
|
163
|
+
codeclimate-test-reporter
|
154
164
|
heavy_control!
|
155
165
|
pry
|
156
166
|
rails (~> 5.0)
|
data/heavy_control.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: heavy_control
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Roman Kolesnev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -108,6 +108,20 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: codeclimate-test-reporter
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
111
125
|
description: Take rails constants' loading under control
|
112
126
|
email:
|
113
127
|
- rvkolesnev@gmail.com
|
@@ -115,6 +129,7 @@ executables: []
|
|
115
129
|
extensions: []
|
116
130
|
extra_rdoc_files: []
|
117
131
|
files:
|
132
|
+
- ".codeclimate.yml"
|
118
133
|
- ".gitignore"
|
119
134
|
- ".rspec"
|
120
135
|
- ".rubocop.yml"
|