awesome_loader 1.3.0 → 1.4.0

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
  SHA1:
3
- metadata.gz: a8d1e0254ff832c3f8dbdc6ab4198a7ef5a6d7ad
4
- data.tar.gz: 7e1f8bb5dce71966b91ea1b1e00a3cb5b1b61906
3
+ metadata.gz: 919667aabf3f1cb9d99ea7d797efb9037be63809
4
+ data.tar.gz: 9fc479c1d118c60da58e29be0b5fcc8d4ca2c5c9
5
5
  SHA512:
6
- metadata.gz: cf7502582e600441d8873161ec2cda3fa94105c97d6d128c416d09f0c78655280a60b426ac6dee6348cbdccfc3ea749729d9b948d921af1dfbd2908f460e4112
7
- data.tar.gz: 51645940d502c3fd65ec678dd2d20b9e8d55d372a58b972a4ae78d5291b45c0d58a24e0d61f5de18ce90de7b6a546e740a54734b3a5fd700e8d9e14176543efc
6
+ metadata.gz: 88da0edf50dc24d44121f84b1d5ec2b622c474f4a93ae5f624835885c016432cd09135b40936379f434c52948cf7d589d047649fa1f847ce6f3e68ca4214d9c7
7
+ data.tar.gz: cbaca37c893d68f59a1b2fe7c9804a4881d3d0bc9c01dcf1468a86c9ac9525f18010abe5dcca4ec49c5a27133aa456b1f1eacb01ffa68c68ad3da29ef6e0b54d
@@ -9,9 +9,8 @@ module AwesomeLoader
9
9
  # Set up an AwesomeLoader::Autoloader instance.
10
10
  #
11
11
  # AwesomeLoader.autoload root_depth: 2 do
12
- # paths %w(app models ** *.rb)
13
- # paths %w(app helpers ** *.rb)
14
12
  # paths %w(app routes ** *.rb), root_depth: 1
13
+ # paths %w(app ** *.rb)
15
14
  # end
16
15
  #
17
16
  # @param root_depth [Integer] Tells AwesomeLoader to start creating Modules for dirs *after* this level (default 2)
@@ -33,9 +32,8 @@ module AwesomeLoader
33
32
  # The autoloader. Normally it's used indirectly through `AwesomeLoader.autoload`, but you can use it directly if you like:
34
33
  #
35
34
  # AwesomeLoader::Autoloader.new(root_depth: 2).
36
- # paths(%w(app models ** *.rb)).
37
- # paths(%w(app helpers *.rb)).
38
- # paths(%w(app routes ** *.rb), root_depth: 1).
35
+ # paths(['app', 'routes', '**', '*.rb'], root_depth: 1).
36
+ # paths(['app', '**', '*.rb']).
39
37
  # finalize!
40
38
  #
41
39
  class Autoloader
@@ -82,7 +80,7 @@ module AwesomeLoader
82
80
  builder = ModuleBuilder.new(root_depth: root_depth, root_module: root_module)
83
81
  Dir.glob(File.join root_path.to_s, *glob).each do |full_path|
84
82
  next if all_files.include? full_path
85
- all_files << full_path if eager_load
83
+ all_files << full_path
86
84
 
87
85
  rel_path = full_path.sub root_path.to_s, ''
88
86
  dir_path, file_name = File.split rel_path
@@ -21,7 +21,8 @@ module AwesomeLoader
21
21
 
22
22
  #
23
23
  # Returns (recursively creating if necessary) the Module represented by the dir path. The path should be relative
24
- # to your application root/working directory.
24
+ # to your application root/working directory. Directories are expected to use snake case, and the Modules will
25
+ # use camel case.
25
26
  #
26
27
  # # Since root_depth is 2, the first 2 dirs in any path will be ignored
27
28
  # builder = ModuleBuilder.new(root_depth: 2)
@@ -1,4 +1,4 @@
1
1
  module AwesomeLoader
2
2
  # Library version
3
- VERSION = '1.3.0'.freeze
3
+ VERSION = '1.4.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awesome_loader
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Hollinger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-04-13 00:00:00.000000000 Z
11
+ date: 2017-05-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: An awesome wrapper for Ruby's built-in autoload
14
14
  email: jordan.hollinger@gmail.com