eitil 1.3.4 → 1.3.5
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0a89a4609655c28ab6ee41d45b0c74d34b47d31cef1f494b0d942717cdf5371
|
4
|
+
data.tar.gz: 905882089b4723ee74710f4877eaecc612ac35c75b9ea954efd9edeb656d8cda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8d395e454f20dffb4d7f4a5b9d77944fdbb4603013e5c562ad09d4768642a5df4b98fe8b2e6a10510535b0428aa6f506edab944a787954a8847cac27480df4da
|
7
|
+
data.tar.gz: c117f0a635d79282a6b7d54dd72a71de77d054c209f25b3c4cd76aae7469320af507c1f35f25b6770041b7b3fbfe3198b9c193c2bec8ed51acf6115a4f75ddcf
|
data/eitil_core/README.md
CHANGED
@@ -385,6 +385,35 @@ transform_string_values!(&block)
|
|
385
385
|
# bang variant of .transform_string_values, which recursively modifies all objects it is called on.
|
386
386
|
```
|
387
387
|
|
388
|
+
|
389
|
+
## Kernel
|
390
|
+
|
391
|
+
```ruby
|
392
|
+
|
393
|
+
require "eitil_core/kernel"
|
394
|
+
|
395
|
+
```
|
396
|
+
|
397
|
+
```ruby
|
398
|
+
# require "eitil_core/kernel/loadquire"
|
399
|
+
|
400
|
+
loadquire(current_path, *relative_paths, ext: '.rb')
|
401
|
+
# use .loadquire to pickup code changes on reload in development environment, while not creating overhead in production through 'load' usage
|
402
|
+
# call as: loadquire __dir__, 'user'
|
403
|
+
# => loads '../user.rb' in development environment, requires '../user.rb' in all other environments
|
404
|
+
```
|
405
|
+
|
406
|
+
```ruby
|
407
|
+
# require "eitil_core/kernel/loadquire_bang"
|
408
|
+
|
409
|
+
loadquire!(*relative_paths, ext: '.rb')
|
410
|
+
# use .loadquire! to pickup code changes on reload in development environment, while not creating overhead in production through 'load' usage
|
411
|
+
# call as: loadquire! 'user'
|
412
|
+
# => loads '../user.rb' in development environment, requires '../user.rb' in all other environments
|
413
|
+
|
414
|
+
```
|
415
|
+
|
416
|
+
|
388
417
|
## Lookups
|
389
418
|
|
390
419
|
```ruby
|
@@ -0,0 +1,25 @@
|
|
1
|
+
|
2
|
+
# require "eitil_core/kernel/loadquire"
|
3
|
+
|
4
|
+
Kernel.module_eval do
|
5
|
+
|
6
|
+
def loadquire(current_path, *relative_paths, ext: '.rb')
|
7
|
+
|
8
|
+
file_paths = relative_paths.map do |relative_path|
|
9
|
+
File.expand_path(relative_path, current_path).concat(ext)
|
10
|
+
end
|
11
|
+
|
12
|
+
if Object.const_defined?('Rails') && Rails.env.development?
|
13
|
+
file_paths.each do |path|
|
14
|
+
load(path)
|
15
|
+
end
|
16
|
+
|
17
|
+
else
|
18
|
+
file_paths.each do |path|
|
19
|
+
require(path)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
|
2
|
+
# require "eitil_core/kernel/loadquire_bang"
|
3
|
+
|
4
|
+
Kernel.module_eval do
|
5
|
+
|
6
|
+
def loadquire!(*relative_paths, ext: '.rb')
|
7
|
+
|
8
|
+
current_path = caller.first.split('/')[0..-2].join('/')
|
9
|
+
file_paths = relative_paths.map do |relative_path|
|
10
|
+
File.expand_path(relative_path, current_path).concat(ext)
|
11
|
+
end
|
12
|
+
|
13
|
+
if Object.const_defined?('Rails') && Rails.env.development?
|
14
|
+
file_paths.each do |path|
|
15
|
+
load(path)
|
16
|
+
end
|
17
|
+
|
18
|
+
else
|
19
|
+
file_paths.each do |path|
|
20
|
+
require(path)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
data/lib/eitil/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eitil
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jurriaan Schrofer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-09-
|
11
|
+
date: 2021-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -208,6 +208,8 @@ files:
|
|
208
208
|
- eitil_core/lib/eitil_core/hash/transform_string_values.rb
|
209
209
|
- eitil_core/lib/eitil_core/kernel.rb
|
210
210
|
- eitil_core/lib/eitil_core/kernel/always_require_relative.rb
|
211
|
+
- eitil_core/lib/eitil_core/kernel/loadquire.rb
|
212
|
+
- eitil_core/lib/eitil_core/kernel/loadquire_bang.rb
|
211
213
|
- eitil_core/lib/eitil_core/lookups.rb
|
212
214
|
- eitil_core/lib/eitil_core/lookups/all_methods.rb
|
213
215
|
- eitil_core/lib/eitil_core/lookups/gem_path.rb
|