heavy_control 0.1.1 → 0.1.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: 08e7942c5b0ff2f50c6789dc6ba6bcd94df3a360
4
- data.tar.gz: 1a18431ca2cee0e11df32a86a227f9f06c90dd64
3
+ metadata.gz: 8b5ec538f294519e937d47ddaafd9df7613866f1
4
+ data.tar.gz: 4d798f0a29f4a42d6a849a1d8c0cb00fb42c17e5
5
5
  SHA512:
6
- metadata.gz: ce2fb2c1e7a5e7cbe67ef8a9dee248f25bea372a1bbd901b1d973e97333997870540f38e98eea23032e61ac19ef8e323f407e2049adf59b63f07263fec3905eb
7
- data.tar.gz: 3e21e424e0707ecea61fe762db22fb969a820f1cfa48e042485a0166526a8de0b93d944732876956b69e5ba0188ab52ba6968e4c91589f2ce949a29c94ccbfdb
6
+ metadata.gz: e6d95d61ca8a18d8fee643874bc78e9f6727aa2313742d7a5ae5dd4e5f8c31a0a9e9fc43075dcf27501e8f1cb2a51060cd6855d57fbe8efd48529c24a3e19133
7
+ data.tar.gz: 7a8e074f37dca4b93db496faad9e159be06a3762f43bcc4be5847b50da901787ebbea67e25958b1c537044920971b9b0bd90b559f518f3aac096043c655caeb9
data/.codeclimate.yml ADDED
@@ -0,0 +1,6 @@
1
+ engines:
2
+ duplication:
3
+ enabled: true
4
+ config:
5
+ languages:
6
+ - ruby
data/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 TODO: Write your name
3
+ Copyright (c) 2016 Roman Kolesnev
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
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.0)
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.0)
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)
@@ -33,4 +33,5 @@ Gem::Specification.new do |spec|
33
33
  spec.add_development_dependency 'pry'
34
34
  spec.add_development_dependency 'rubocop'
35
35
  spec.add_development_dependency 'appraisal'
36
+ spec.add_development_dependency 'codeclimate-test-reporter'
36
37
  end
@@ -21,8 +21,8 @@ module HeavyControl
21
21
  }
22
22
  end
23
23
 
24
- def debug(_value = true)
25
- @config[:debug] = true
24
+ def debug(value = true)
25
+ @config[:debug] = value
26
26
  end
27
27
 
28
28
  def ignore_subfolder(subfolder)
@@ -15,12 +15,6 @@ module HeavyControl
15
15
 
16
16
  nil
17
17
  end
18
-
19
- private
20
-
21
- def hc_log(msg)
22
- Rails.logger.debug "HeavyControl: #{msg}"
23
- end
24
18
  end
25
19
  end
26
20
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module HeavyControl
3
- VERSION = '0.1.1'
3
+ VERSION = '0.1.2'
4
4
  end
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.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-09-25 00:00:00.000000000 Z
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"