loader 2.2.1 → 2.2.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 +4 -4
- data/README.md +12 -57
- data/VERSION +1 -1
- data/loader.gemspec +1 -1
- metadata +3 -9
- data/.idea/.name +0 -1
- data/.idea/encodings.xml +0 -4
- data/.idea/misc.xml +0 -32
- data/.idea/modules.xml +0 -8
- data/.idea/scopes/scope_settings.xml +0 -5
- data/.idea/vcs.xml +0 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86dfc036308966d0b042d76012e3617e7efc551d
|
4
|
+
data.tar.gz: b15f9a16ff7a2175a6f9cd58eb68c934d73f68d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75b91adebe704612c434ed08802ae65bee5835b3e0ba2033c3dc07ff8afd840883844ecef248f9d2cf861860208f8050d22821f95670c467655845848f13cf57
|
7
|
+
data.tar.gz: d0bd2bd7da1751632bbc2f644832d608ab13bf3e6e9f7d59f278ddaa2252b2cca42bff6fd3ec97f6394e8febd58a8bd2f3c99a47b08f078cdf26bc21b93e7d9b
|
data/README.md
CHANGED
@@ -21,6 +21,8 @@ The end goal is to make an easy ruby file loader for apps and gems.
|
|
21
21
|
load relative directory (not based on Dir.pwd but the caller files position)
|
22
22
|
if you pass multiple string as argument it will be joined by file separator that the OS use
|
23
23
|
|
24
|
+
#### Manual loading folders
|
25
|
+
|
24
26
|
```ruby
|
25
27
|
|
26
28
|
require 'loader'
|
@@ -35,73 +37,26 @@ if you pass multiple string as argument it will be joined by file separator that
|
|
35
37
|
|
36
38
|
```
|
37
39
|
|
38
|
-
|
39
|
-
you can use the constant based autoload function
|
40
|
-
|
41
|
-
simple as this:
|
42
|
-
|
43
|
-
# lib/dog
|
44
|
-
```ruby
|
45
|
-
|
46
|
-
class Dog
|
47
|
-
def self.say
|
48
|
-
"Wuff"
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
```
|
40
|
+
#### Autoload folders
|
53
41
|
|
54
|
-
# lib/cat
|
55
42
|
```ruby
|
56
43
|
|
57
|
-
|
58
|
-
|
59
|
-
end
|
44
|
+
require 'loader'
|
45
|
+
Loader.autoload
|
60
46
|
|
61
47
|
```
|
62
48
|
|
63
|
-
|
49
|
+
optionally you can tell the project root folder if you work with in a gem.
|
50
|
+
|
64
51
|
```ruby
|
65
52
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
def self.grab
|
70
|
-
"MEOW!!!"
|
71
|
-
end
|
72
|
-
|
73
|
-
end
|
74
|
-
end
|
53
|
+
require 'loader'
|
54
|
+
Loader.autoload(File.dirname(__FILE__))
|
75
55
|
|
76
56
|
```
|
77
57
|
|
78
|
-
# lib/cat/pawn.rb
|
79
|
-
```ruby
|
80
58
|
|
81
|
-
|
82
|
-
|
83
|
-
end
|
84
|
-
end
|
85
|
-
|
86
|
-
```
|
87
|
-
|
88
|
-
# lib/bootstrap
|
89
|
-
```ruby
|
90
|
-
|
91
|
-
require 'loader/autoload'
|
92
|
-
|
93
|
-
# from this point missing constants will be searched by file system path that is based on Object namespace
|
94
|
-
Loader.autoload
|
95
|
-
|
96
|
-
# no need to load the files , only when they required
|
97
|
-
Cat::Tail.grab #> "MEOW!!!"
|
98
|
-
|
99
|
-
class Cat
|
100
|
-
Pawn #> Pawn Constant loaded and returned
|
101
|
-
end
|
102
|
-
|
103
|
-
class Cat
|
104
|
-
Dog #> return Top lvl Dog Constant after file is loaded by this Constant request
|
105
|
-
end
|
59
|
+
If you like the basic idea that the app should not do any kind of Eager Load and become slow,
|
60
|
+
you can use the constant based autoload function
|
106
61
|
|
107
|
-
|
62
|
+
##### [Sketch about how it works](https://github.com/adamluzsi/loader.rb/blob/master/doc/sketch)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.2
|
data/loader.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.description = %q{ easy to use File loader that allow directories/project both Lazy Load and Eager load for files and constants. The Eager load for relative directory made for gems by default }
|
13
13
|
spec.summary = %q{ easy to use File loader that allow directories/project both Lazy Load and Eager load for files and constants. The Eager load for relative directory made for gems by default }
|
14
14
|
|
15
|
-
spec.homepage = 'https://github.com/adamluzsi/loader'
|
15
|
+
spec.homepage = 'https://github.com/adamluzsi/loader.rb'
|
16
16
|
|
17
17
|
spec.files = `git ls-files`.split($/)
|
18
18
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -48,12 +48,6 @@ extensions: []
|
|
48
48
|
extra_rdoc_files: []
|
49
49
|
files:
|
50
50
|
- ".gitignore"
|
51
|
-
- ".idea/.name"
|
52
|
-
- ".idea/encodings.xml"
|
53
|
-
- ".idea/misc.xml"
|
54
|
-
- ".idea/modules.xml"
|
55
|
-
- ".idea/scopes/scope_settings.xml"
|
56
|
-
- ".idea/vcs.xml"
|
57
51
|
- Gemfile
|
58
52
|
- LICENSE
|
59
53
|
- README.md
|
@@ -89,7 +83,7 @@ files:
|
|
89
83
|
- test/sub/test2.rb
|
90
84
|
- test/test.rb
|
91
85
|
- test/test_autoload.rb
|
92
|
-
homepage: https://github.com/adamluzsi/loader
|
86
|
+
homepage: https://github.com/adamluzsi/loader.rb
|
93
87
|
licenses: []
|
94
88
|
metadata: {}
|
95
89
|
post_install_message:
|
data/.idea/.name
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
loader
|
data/.idea/encodings.xml
DELETED
data/.idea/misc.xml
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<project version="4">
|
3
|
-
<component name="DaemonCodeAnalyzer">
|
4
|
-
<disable_hints />
|
5
|
-
</component>
|
6
|
-
<component name="DependencyValidationManager">
|
7
|
-
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
|
8
|
-
</component>
|
9
|
-
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
|
10
|
-
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
11
|
-
<OptionsSetting value="true" id="Add" />
|
12
|
-
<OptionsSetting value="true" id="Remove" />
|
13
|
-
<OptionsSetting value="true" id="Checkout" />
|
14
|
-
<OptionsSetting value="true" id="Update" />
|
15
|
-
<OptionsSetting value="true" id="Status" />
|
16
|
-
<OptionsSetting value="true" id="Edit" />
|
17
|
-
<ConfirmationsSetting value="0" id="Add" />
|
18
|
-
<ConfirmationsSetting value="0" id="Remove" />
|
19
|
-
</component>
|
20
|
-
<component name="ProjectModuleManager">
|
21
|
-
<modules />
|
22
|
-
</component>
|
23
|
-
<component name="ProjectRootManager" version="2" project-jdk-name="RVM: ruby-2.1.2" project-jdk-type="RUBY_SDK" />
|
24
|
-
<component name="PropertiesComponent">
|
25
|
-
<property name="options.lastSelected" value="preferences.general" />
|
26
|
-
<property name="options.splitter.main.proportions" value="0.3" />
|
27
|
-
<property name="options.splitter.details.proportions" value="0.2" />
|
28
|
-
</component>
|
29
|
-
<component name="RunManager">
|
30
|
-
<list size="0" />
|
31
|
-
</component>
|
32
|
-
</project>
|
data/.idea/modules.xml
DELETED